Skip to content

Commit

Permalink
Make runtime tracing toggleable for backwards compatibility
Browse files Browse the repository at this point in the history
Adds the cmake option `ENABLE_RUNTIME_TRACING`
  • Loading branch information
lisanna-dettwyler authored and Jemale committed Apr 17, 2024
1 parent e94215d commit f0df576
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ cd boost
### Dependencies

The HEAD of this repo is compatible with the latest Level Zero Loader release. Please report incompatibilities at https://github.com/oneapi-src/level-zero-tests/issues.

To build against loader releases prior to [v1.15.7](https://github.com/oneapi-src/level-zero/releases/tag/v1.15.7), add the cmake flag `-DENABLE_RUNTIME_TRACING=OFF`.

You can either build against the version you have installed on your system (automatic, Linux only),
or specify an install prefix with the `CMAKE_PREFIX_PATH` cmake flag during configuration.
This `CMAKE_PREFIX_PATH` must point to the top-level install directory where level-zero was installed.
Expand Down
11 changes: 8 additions & 3 deletions layer_tests/tracing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set(ipc_libraries
Boost::system
)

option(ENABLE_RUNTIME_TRACING "Enable runtime tracing" ON)
if(ENABLE_RUNTIME_TRACING)
set(defines_runtime_tracing USE_RUNTIME_TRACING)
endif()

if(UNIX)
list(APPEND ipc_event_libraries rt)
endif()
Expand Down Expand Up @@ -37,7 +42,7 @@ add_lzt_test(
${ipc_libraries}
${ipc_event_libraries}
level_zero_tests::net
DEFINES USE_RUNTIME_TRACING
DEFINES ${defines_runtime_tracing}
)

add_lzt_test_executable(
Expand All @@ -62,7 +67,7 @@ add_lzt_test_executable(
${ipc_libraries}
${ipc_event_libraries}
level_zero_tests::net
DEFINES USE_RUNTIME_TRACING
DEFINES ${defines_runtime_tracing}
)

add_lzt_test_executable(
Expand All @@ -87,5 +92,5 @@ add_lzt_test_executable(
${ipc_libraries}
${ipc_event_libraries}
level_zero_tests::net
DEFINES USE_RUNTIME_TRACING
DEFINES ${defines_runtime_tracing}
)

0 comments on commit f0df576

Please sign in to comment.