mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
refactor: Add GDI profiling
Resolves: NEO-9236 Related-To: NEO-10036 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7bd33af394
commit
8d56f8fb6b
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -10,21 +10,3 @@
|
||||
#define SYSTEM_LEAVE(id)
|
||||
#define WAIT_ENTER()
|
||||
#define WAIT_LEAVE()
|
||||
|
||||
#if KMD_PROFILING == 1
|
||||
#undef SYSTEM_ENTER
|
||||
#undef SYSTEM_LEAVE
|
||||
#undef WAIT_ENTER
|
||||
#undef WAIT_LEAVE
|
||||
|
||||
#define SYSTEM_ENTER() \
|
||||
PerfProfiler::create(); \
|
||||
gPerfProfiler->systemEnter();
|
||||
|
||||
#define SYSTEM_LEAVE(id) \
|
||||
gPerfProfiler->systemLeave(id);
|
||||
#define WAIT_ENTER() \
|
||||
SYSTEM_ENTER()
|
||||
#define WAIT_LEAVE() \
|
||||
SYSTEM_LEAVE(0)
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -95,23 +95,4 @@ class PerfProfiler {
|
||||
std::unique_ptr<std::ostream> sysLogFile;
|
||||
std::vector<SystemLog> systemLogs;
|
||||
};
|
||||
|
||||
#if KMD_PROFILING == 1
|
||||
|
||||
extern thread_local PerfProfiler *gPerfProfiler;
|
||||
|
||||
struct PerfProfilerApiWrapper {
|
||||
PerfProfilerApiWrapper(const char *funcName)
|
||||
: funcName(funcName) {
|
||||
PerfProfiler::create();
|
||||
gPerfProfiler->apiEnter();
|
||||
}
|
||||
|
||||
~PerfProfilerApiWrapper() {
|
||||
gPerfProfiler->apiLeave(funcName);
|
||||
}
|
||||
|
||||
const char *funcName;
|
||||
};
|
||||
#endif
|
||||
}; // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user