Skip to content

Commit

Permalink
#2302: Improve perf metrics configuration error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrepebay committed Dec 12, 2024
1 parent 796e2a0 commit c7100f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmake/load_perf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (vt_perf_enabled)
# check if linux
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# check if there's the perf header we need
INCLUDE(CheckIncludeFiles)
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES("linux/perf_event.h" HAVE_PERF_EVENT_H)
if (HAVE_PERF_EVENT_H)
# check if the kernel is recent enough
Expand All @@ -26,22 +26,22 @@ if (vt_perf_enabled)
set(vt_perf_enabled "1")
set(vt_perf_found "1")
else ()
message(WARNING "Perf measurements enabled but couldn't run perf stat successfully. Disabling perf measurements.")
message(WARNING "Perf disabled: \"perf stat\" results in non-zero error code.")
set(vt_perf_enabled "0")
set(vt_perf_found "0")
endif ()
else ()
message(WARNING "Perf measurements enabled but Kernel major version is less than 4. Disabling perf measurements.")
message(WARNING "Perf disabled: kernel major version is less than 4.")
set(vt_perf_enabled "0")
set(vt_perf_found "0")
endif ()
else ()
message(WARNING "Perf measurements enabled but couldn't find perf_event.h. Disabling perf measurements.")
message(WARNING "Perf disabled: could not find \"perf_event.h\".")
set(vt_perf_enabled "0")
set(vt_perf_found "0")
endif ()
else ()
message(WARNING "Perf measurements enabled but system is not Linux. Disabling perf measurements.")
message(WARNING "Perf disabled: system name is not Linux.")
set(vt_perf_enabled "0")
set(vt_perf_found "0")
endif ()
Expand Down

0 comments on commit c7100f7

Please sign in to comment.