-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bazel] Build libpfm as a dependency to allow collection of perf coun…
…ters (#1408) * Build libpfm as a dependency to allow collection of perf counters This commit builds libpfm using rules_foreign_cc and lets the default build of the benchmark library support perf counter collection without needing additional work from users. Tested with a custom target: ``` bazel run \ --override_repository=com_github_google_benchmark=/home/raghu/benchmark \ -c opt :test-bench -- "--benchmark_perf_counters=INSTRUCTIONS,CYCLES" Using profile: local <snip> ---------------------------------------------------------------------- Benchmark Time CPU Iterations UserCounters... ---------------------------------------------------------------------- BM_Test 0.279 ns 0.279 ns 1000000000 CYCLES=1.00888 INSTRUCTIONS=2 ``` Signed-off-by: Raghu Raja <[email protected]> * Adding myself to the CONTRIBUTORS file per CLA guidance Enfabrica has already signed a corporate CLA. Signed-off-by: Raghu Raja <[email protected]> Signed-off-by: Raghu Raja <[email protected]>
- Loading branch information
Showing
6 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ Norman Heino <[email protected]> | |
Oleksandr Sochka <[email protected]> | ||
Ori Livneh <[email protected]> | ||
Paul Redmond <[email protected]> | ||
Raghu Raja <[email protected]> | ||
Radoslav Yovchev <[email protected]> | ||
Rainer Orth <[email protected]> | ||
Roman Lebedev <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ Paul Redmond <[email protected]> | |
Pierre Phaneuf <[email protected]> | ||
Radoslav Yovchev <[email protected]> | ||
Rainer Orth <[email protected]> | ||
Raghu Raja <[email protected]> | ||
Raul Marin <[email protected]> | ||
Ray Glover <[email protected]> | ||
Robert Guo <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Build rule for libpfm, which is required to collect performance counters for | ||
# BENCHMARK_ENABLE_LIBPFM builds. | ||
|
||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "make") | ||
|
||
filegroup( | ||
name = "pfm_srcs", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
make( | ||
name = "libpfm", | ||
lib_source = ":pfm_srcs", | ||
lib_name = "libpfm", | ||
copts = [ | ||
"-Wno-format-truncation", | ||
], | ||
visibility = [ | ||
"//visibility:public", | ||
], | ||
) |