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:
Lukasz Jobczyk
2024-01-22 07:28:27 +00:00
committed by Compute-Runtime-Automation
parent 7bd33af394
commit 8d56f8fb6b
16 changed files with 203 additions and 189 deletions

View File

@@ -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

View File

@@ -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