Add libpfm support to Google Benchmark
This enables support for reporting hardware performance counters with
benchmark results.
Change-Id: I1ff6b2ea9c7ad0c7db1f24a02657ab0c684323c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6932868
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Kevin Graney <kmg@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Cr-Commit-Position: refs/heads/main@{#1514344}
NOKEYCHECK=True
GitOrigin-RevId: c38725a0e23f206f11ed72be271075ca0b61a6d7
diff --git a/BUILD.gn b/BUILD.gn
index 00f9282..6d1e9b1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -78,6 +78,12 @@
# google_benchmark expects a BENCHMARK_VERSION definition
"BENCHMARK_VERSION=\"1.9.0\"",
]
+
+ if (is_linux) {
+ # Include hardware performance counter support.
+ defines += [ "HAVE_LIBPFM=1" ]
+ deps = [ "//third_party/libpfm4" ]
+ }
}
component("benchmark_main") {