The following commit has been merged into the perf/core branch of tip:

Commit-ID:     5ef86146de941f273d669a8e018036f549bf058c
Gitweb:        
https://git.kernel.org/tip/5ef86146de941f273d669a8e018036f549bf058c
Author:        Stephane Eranian <eran...@google.com>
AuthorDate:    Wed, 29 Apr 2020 16:14:41 -07:00
Committer:     Arnaldo Carvalho de Melo <a...@redhat.com>
CommitterDate: Tue, 05 May 2020 16:35:31 -03:00

tools feature: Add support for detecting libpfm4

libpfm4 provides an alternate command line encoding of perf events.

Signed-off-by: Stephane Eranian <eran...@google.com>
Reviewed-by: Ian Rogers <irog...@google.com>
Acked-by: Jiri Olsa <jo...@redhat.com>
Cc: Adrian Hunter <adrian.hun...@intel.com>
Cc: Alexander Shishkin <alexander.shish...@linux.intel.com>
Cc: Alexei Starovoitov <a...@kernel.org>
Cc: Alexey Budankov <alexey.budan...@linux.intel.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: Andrii Nakryiko <andr...@fb.com>
Cc: Daniel Borkmann <dan...@iogearbox.net>
Cc: Florian Fainelli <f.faine...@gmail.com>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Igor Lubashev <iluba...@akamai.com>
Cc: Jin Yao <yao....@linux.intel.com>
Cc: Jiwei Sun <jiwei....@windriver.com>
Cc: John Garry <john.ga...@huawei.com>
Cc: Kan Liang <kan.li...@linux.intel.com>
Cc: Leo Yan <leo....@linaro.org>
Cc: Mark Rutland <mark.rutl...@arm.com>
Cc: Martin KaFai Lau <ka...@fb.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: Yonghong Song <y...@fb.com>
Cc: b...@vger.kernel.org
Cc: net...@vger.kernel.org
Cc: yuzhoujian <yuzhouj...@didichuxing.com>
Link: http://lore.kernel.org/lkml/20200429231443.207201-3-irog...@google.com
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.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 3e0c019..3abd431 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 9201238..84f845b 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -69,7 +69,8 @@ FILES=                                          \
          test-libaio.bin                       \
          test-libzstd.bin                      \
          test-clang-bpf-global-var.bin         \
-         test-file-handle.bin
+         test-file-handle.bin                  \
+         test-libpfm4.bin
 
 FILES := $(addprefix $(OUTPUT),$(FILES))
 
@@ -331,6 +332,9 @@ $(OUTPUT)test-clang-bpf-global-var.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 0000000..af49b25
--- /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;
+}

Reply via email to