Message ID | 20200411074631.9486-3-irogers@google.com |
---|---|
State | Not Applicable |
Delegated to: | BPF Maintainers |
Headers | show |
Series | perf tools: add support for libpfm4 | expand |
On Sat, Apr 11, 2020 at 12:46:29AM -0700, Ian Rogers wrote: > From: Stephane Eranian <eranian@google.com> > > libpfm4 provides an alternate command line encoding of perf events. > > Signed-off-by: Stephane Eranian <eranian@google.com> > Reviewed-by: Ian Rogers <irogers@google.com> > --- > tools/build/Makefile.feature | 6 ++++-- > tools/build/feature/Makefile | 6 +++++- > tools/build/feature/test-libpfm4.c | 9 +++++++++ > 3 files changed, 18 insertions(+), 3 deletions(-) > create mode 100644 tools/build/feature/test-libpfm4.c > > diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature > index 3e0c019ef297..0b651171476f 100644 > --- a/tools/build/Makefile.feature > +++ b/tools/build/Makefile.feature > @@ -73,7 +73,8 @@ FEATURE_TESTS_BASIC := \ > libaio \ > libzstd \ > disassembler-four-args \ > - file-handle > + file-handle \ > + libpfm4 let's treat this the same way as libbpf and do not include it in the basic check, which will fail for omst users jirka
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 3e0c019ef297..0b651171476f 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -73,7 +73,8 @@ FEATURE_TESTS_BASIC := \ libaio \ libzstd \ disassembler-four-args \ - file-handle + file-handle \ + libpfm4 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list # of all feature tests @@ -128,7 +129,8 @@ FEATURE_DISPLAY ?= \ bpf \ libaio \ libzstd \ - disassembler-four-args + disassembler-four-args \ + libpfm4 # Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features. # If in the future we need per-feature checks/flags for features not diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 621f528f7822..a6eded94a36b 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -68,7 +68,8 @@ FILES= \ test-llvm-version.bin \ test-libaio.bin \ test-libzstd.bin \ - test-file-handle.bin + test-file-handle.bin \ + test-libpfm4.bin FILES := $(addprefix $(OUTPUT),$(FILES)) @@ -325,6 +326,9 @@ $(OUTPUT)test-libzstd.bin: $(OUTPUT)test-file-handle.bin: $(BUILD) +$(OUTPUT)test-libpfm4.bin: + $(BUILD) -lpfm + ############################### clean: diff --git a/tools/build/feature/test-libpfm4.c b/tools/build/feature/test-libpfm4.c new file mode 100644 index 000000000000..af49b259459e --- /dev/null +++ b/tools/build/feature/test-libpfm4.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <sys/types.h> +#include <perfmon/pfmlib.h> + +int main(void) +{ + pfm_initialize(); + return 0; +}