[PATCH] D84076: [llvm-exegesis] Unset HAVE_LIBPFM if the kernel is too old.
Vy Nguyen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 22 20:18:25 PDT 2020
oontvoo updated this revision to Diff 280015.
oontvoo added a comment.
Use Cmake's CheckStructHasMember to check for `cycles` field.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84076/new/
https://reviews.llvm.org/D84076
Files:
llvm/cmake/modules/FindLibpfm.cmake
Index: llvm/cmake/modules/FindLibpfm.cmake
===================================================================
--- llvm/cmake/modules/FindLibpfm.cmake
+++ llvm/cmake/modules/FindLibpfm.cmake
@@ -7,6 +7,7 @@
include(CheckIncludeFile)
include(CheckLibraryExists)
+include(CheckStructHasMember)
if (LLVM_ENABLE_LIBPFM)
check_library_exists(pfm pfm_initialize "" HAVE_LIBPFM_INITIALIZE)
@@ -16,6 +17,11 @@
check_include_file(perfmon/pfmlib_perf_event.h HAVE_PERFMON_PFMLIB_PERF_EVENT_H)
if(HAVE_PERFMON_PERF_EVENT_H AND HAVE_PERFMON_PFMLIB_H AND HAVE_PERFMON_PFMLIB_PERF_EVENT_H)
set(HAVE_LIBPFM 1)
+ # Check to see if this versions have `cycles` in `struct perf_branch_entry`
+ Check_struct_has_member("struct perf_branch_entry" cycles perfmon/perf_event.h HAS_CYCLES LANGUAGE C)
+ if(HAS_CYCLES)
+ set(LIBPFM_HAS_FIELD_CYCLES 1)
+ endif()
endif()
endif()
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84076.280015.patch
Type: text/x-patch
Size: 925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200723/5ee6b530/attachment.bin>
More information about the llvm-commits
mailing list