mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix: use llx for fprintf and IoctlFunctions
Changed format for address printing from %lx to %llx for fprintf introduced in drm_neo.cpp, and then use IoctlFunctions::fprintf instead of std::printf to avoid errors on gcc. Changed formate for address printing from %lx to %llx for snprintf introduced in drm_test.cpp, and then type casted to long long unsigned int explictly to avoid errors. Related-To: GSD-7611 Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1ffc826808
commit
49cc1a0ba0
@@ -45,6 +45,7 @@
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/utilities/api_intercept.h"
|
||||
#include "shared/source/utilities/directory.h"
|
||||
#include "shared/source/utilities/io_functions.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
@@ -267,22 +268,22 @@ bool Drm::checkResetStatus(OsContext &osContext) {
|
||||
UNRECOVERABLE_IF(retVal != 0);
|
||||
if (checkToDisableScratchPage() && ioctlHelper->validPageFault(fault.flags)) {
|
||||
bool banned = ((status & ioctlHelper->getStatusForResetStats(true)) != 0);
|
||||
fprintf(stderr, "FATAL: Unexpected page fault from GPU at 0x%lx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
fault.addr,
|
||||
resetStats.contextId,
|
||||
EngineHelpers::engineTypeToString(osContext.getEngineType()).c_str(),
|
||||
fault.type, GpuPageFaultHelpers::faultTypeToString(static_cast<FaultType>(fault.type)).c_str(),
|
||||
fault.level, GpuPageFaultHelpers::faultLevelToString(static_cast<FaultLevel>(fault.level)).c_str(),
|
||||
fault.access, GpuPageFaultHelpers::faultAccessToString(static_cast<FaultAccess>(fault.access)).c_str(),
|
||||
banned);
|
||||
fprintf(stdout, "FATAL: Unexpected page fault from GPU at 0x%lx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
fault.addr,
|
||||
resetStats.contextId,
|
||||
EngineHelpers::engineTypeToString(osContext.getEngineType()).c_str(),
|
||||
fault.type, GpuPageFaultHelpers::faultTypeToString(static_cast<FaultType>(fault.type)).c_str(),
|
||||
fault.level, GpuPageFaultHelpers::faultLevelToString(static_cast<FaultLevel>(fault.level)).c_str(),
|
||||
fault.access, GpuPageFaultHelpers::faultAccessToString(static_cast<FaultAccess>(fault.access)).c_str(),
|
||||
banned);
|
||||
IoFunctions::fprintf(stderr, "FATAL: Unexpected page fault from GPU at 0x%llx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
fault.addr,
|
||||
resetStats.contextId,
|
||||
EngineHelpers::engineTypeToString(osContext.getEngineType()).c_str(),
|
||||
fault.type, GpuPageFaultHelpers::faultTypeToString(static_cast<FaultType>(fault.type)).c_str(),
|
||||
fault.level, GpuPageFaultHelpers::faultLevelToString(static_cast<FaultLevel>(fault.level)).c_str(),
|
||||
fault.access, GpuPageFaultHelpers::faultAccessToString(static_cast<FaultAccess>(fault.access)).c_str(),
|
||||
banned);
|
||||
IoFunctions::fprintf(stdout, "FATAL: Unexpected page fault from GPU at 0x%llx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
fault.addr,
|
||||
resetStats.contextId,
|
||||
EngineHelpers::engineTypeToString(osContext.getEngineType()).c_str(),
|
||||
fault.type, GpuPageFaultHelpers::faultTypeToString(static_cast<FaultType>(fault.type)).c_str(),
|
||||
fault.level, GpuPageFaultHelpers::faultLevelToString(static_cast<FaultLevel>(fault.level)).c_str(),
|
||||
fault.access, GpuPageFaultHelpers::faultAccessToString(static_cast<FaultAccess>(fault.access)).c_str(),
|
||||
banned);
|
||||
UNRECOVERABLE_IF(true);
|
||||
}
|
||||
if (resetStats.batchActive > 0 || resetStats.batchPending > 0) {
|
||||
|
||||
@@ -1472,8 +1472,8 @@ TEST(DrmDeathTest, GivenResetStatsWithValidFaultWhenIsGpuHangIsCalledThenProcess
|
||||
|
||||
drm.ioctlHelper = std::move(ioctlHelper);
|
||||
|
||||
int strSize = std::snprintf(nullptr, 0, "FATAL: Unexpected page fault from GPU at 0x%lx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
resetStatsFaultExpected.addr,
|
||||
int strSize = std::snprintf(nullptr, 0, "FATAL: Unexpected page fault from GPU at 0x%llx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
static_cast<long long unsigned int>(resetStatsFaultExpected.addr),
|
||||
resetStatsExpected.contextId,
|
||||
EngineHelpers::engineTypeToString(aub_stream::ENGINE_BCS).c_str(),
|
||||
resetStatsFaultExpected.type, GpuPageFaultHelpers::faultTypeToString(static_cast<FaultType>(resetStatsFaultExpected.type)).c_str(),
|
||||
@@ -1483,8 +1483,8 @@ TEST(DrmDeathTest, GivenResetStatsWithValidFaultWhenIsGpuHangIsCalledThenProcess
|
||||
1;
|
||||
|
||||
std::unique_ptr<char[]> buf(new char[strSize]);
|
||||
std::snprintf(buf.get(), strSize, "FATAL: Unexpected page fault from GPU at 0x%lx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
resetStatsFaultExpected.addr,
|
||||
std::snprintf(buf.get(), strSize, "FATAL: Unexpected page fault from GPU at 0x%llx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
|
||||
static_cast<long long unsigned int>(resetStatsFaultExpected.addr),
|
||||
resetStatsExpected.contextId,
|
||||
EngineHelpers::engineTypeToString(aub_stream::ENGINE_BCS).c_str(),
|
||||
resetStatsFaultExpected.type, GpuPageFaultHelpers::faultTypeToString(static_cast<FaultType>(resetStatsFaultExpected.type)).c_str(),
|
||||
|
||||
Reference in New Issue
Block a user