mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: acme@kernel.org
Cc: jolsa@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 1/4] perf, tools: Add probing for xed
Date: Tue,  3 Jan 2017 01:00:26 -0800	[thread overview]
Message-ID: <20170103090029.17621-2-andi@firstfloor.org> (raw)
In-Reply-To: <20170103090029.17621-1-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

Add autoprobing for the xed disassembler library.

Can be downloaded from https://github.com/intelxed/xed

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/build/Makefile.feature   | 6 ++++--
 tools/build/feature/Makefile   | 8 ++++++--
 tools/build/feature/test-all.c | 5 +++++
 tools/build/feature/test-xed.c | 9 +++++++++
 tools/perf/Makefile.config     | 5 +++++
 5 files changed, 29 insertions(+), 4 deletions(-)
 create mode 100644 tools/build/feature/test-xed.c

diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index e3fb5ecbdcb6..25183fa39963 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -63,7 +63,8 @@ FEATURE_TESTS_BASIC :=                  \
         lzma                            \
         get_cpuid                       \
         bpf                             \
-        sdt
+	sdt				\
+	xed
 
 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
 # of all feature tests
@@ -105,7 +106,8 @@ FEATURE_DISPLAY ?=              \
          zlib                   \
          lzma                   \
          get_cpuid              \
-         bpf
+	 bpf			\
+	 xed
 
 # 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 b564a2eea039..a1275965c67d 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -48,7 +48,8 @@ FILES=                                          \
          test-get_cpuid.bin                     \
          test-sdt.bin                           \
          test-cxx.bin                           \
-         test-jvmti.bin
+         test-jvmti.bin				\
+         test-xed.bin
 
 FILES := $(addprefix $(OUTPUT),$(FILES))
 
@@ -68,7 +69,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F))
 ###############################
 
 $(OUTPUT)test-all.bin:
-	$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
+	$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lxed
 
 $(OUTPUT)test-hello.bin:
 	$(BUILD)
@@ -123,6 +124,9 @@ $(OUTPUT)test-numa_num_possible_cpus.bin:
 $(OUTPUT)test-libunwind.bin:
 	$(BUILD) -lelf
 
+$(OUTPUT)test-xed.bin:
+	$(BUILD) -lxed
+
 $(OUTPUT)test-libunwind-debug-frame.bin:
 	$(BUILD) -lelf
 $(OUTPUT)test-libunwind-x86.bin:
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index 699e43627397..4a6dd1d1ff49 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -149,6 +149,10 @@
 # include "test-sdt.c"
 #undef main
 
+#define main main_test_xed
+#  include "test-xed.c"
+#endif
+
 int main(int argc, char *argv[])
 {
 	main_test_libpython();
@@ -183,6 +187,7 @@ int main(int argc, char *argv[])
 	main_test_bpf();
 	main_test_libcrypto();
 	main_test_sdt();
+	main_test_xed();
 
 	return 0;
 }
diff --git a/tools/build/feature/test-xed.c b/tools/build/feature/test-xed.c
new file mode 100644
index 000000000000..ef9aebf1559d
--- /dev/null
+++ b/tools/build/feature/test-xed.c
@@ -0,0 +1,9 @@
+#include <xed/xed-interface.h>
+#include <xed/xed-decode.h>
+#include <xed/xed-decoded-inst-api.h>
+
+int main(void)
+{
+	xed_tables_init();
+	return 0;
+}
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 76c84f0eec52..41cc34ce81f8 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -682,6 +682,11 @@ ifndef NO_ZLIB
   endif
 endif
 
+ifeq ($(feature-xed), 1)
+  EXTLIBS += -lxed
+  $(call detected,CONFIG_XED)
+endif
+
 ifndef NO_LZMA
   ifeq ($(feature-lzma), 1)
     CFLAGS += -DHAVE_LZMA_SUPPORT
-- 
2.9.3

  reply	other threads:[~2017-01-03  9:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03  9:00 New attempt at adding an disassembler to perf Andi Kleen
2017-01-03  9:00 ` Andi Kleen [this message]
2017-01-03 14:58   ` [PATCH 1/4] perf, tools: Add probing for xed Jiri Olsa
2017-01-03 15:10     ` Arnaldo Carvalho de Melo
2017-01-03 15:11     ` Andi Kleen
2017-01-03 18:39       ` Arnaldo Carvalho de Melo
2017-01-03 19:48         ` Jiri Olsa
2017-01-08 14:19   ` Jiri Olsa
2017-01-08 14:20   ` Jiri Olsa
2017-01-10  0:56     ` Andi Kleen
2017-01-03  9:00 ` [PATCH 2/4] perf, tools: Add disassembler for x86 using the XED library Andi Kleen
2017-01-08 14:20   ` Jiri Olsa
2017-01-03  9:00 ` [PATCH 3/4] perf, tools, script: Add support for printing assembler Andi Kleen
2017-01-03  9:00 ` [PATCH 4/4] perf, tools, script: Add brstackasm output for branch stacks Andi Kleen
2017-01-08 14:19   ` Jiri Olsa
2017-01-09 19:14     ` Andi Kleen
2017-01-08 14:20   ` Jiri Olsa
2017-01-08 14:21 ` New attempt at adding an disassembler to perf Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170103090029.17621-2-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome