lkml.org 
[lkml]   [2020]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH v9 2/4] tools feature: add support for detecting libpfm4
From
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 | 3 ++-
tools/build/feature/Makefile | 6 +++++-
tools/build/feature/test-libpfm4.c | 9 +++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
create mode 100644 tools/build/feature/test-libpfm4.c

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 3e0c019ef297..3abd4316cd4f 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -98,7 +98,8 @@ FEATURE_TESTS_EXTRA := \
llvm \
llvm-version \
clang \
- libbpf
+ libbpf \
+ libpfm4

FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC)

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;
+}
--
2.26.0.110.g2183baf09c-goog
\
 
 \ /
  Last update: 2020-04-16 08:38    [W:0.059 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site