lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 21 Nov 2013 12:01:16 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	Jiri Olsa <jolsa@...hat.com>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	David Ahern <dsahern@...il.com>
Subject: [PATCH 18/22] perf tools: Add udis86 disassembler feature check

Adding udis86 disassembler feature check which support
is needed for kvm:kvm_emulate_insn tracepoint.

The diff of 'perf script' output generated by old and new code:
(data was generated by 'perf record -e kvm:kvm_emulate_insn -a')

--- script.kvm.old
+++ script.kvm.new
- qemu-system-x86 15519 [003]  5332.470049: kvm:kvm_emulate_insn: 0:ffffffff8103c596:89 b7 00 80 5f ff (prot64)
+ qemu-system-x86 15519 [003]  5332.470049: kvm:kvm_emulate_insn: 0:ffffffff8103c596: mov %esi, -0xa08000(%rdi)

Signed-off-by: Jiri Olsa <jolsa@...hat.com>
Cc: Corey Ashford <cjashfor@...ux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: David Ahern <dsahern@...il.com>
---
 tools/perf/Makefile.perf                       |  2 +-
 tools/perf/config/Makefile                     |  8 ++++++++
 tools/perf/config/feature-checks/Makefile      |  6 +++++-
 tools/perf/config/feature-checks/test-all.c    |  5 +++++
 tools/perf/config/feature-checks/test-udis86.c | 11 +++++++++++
 5 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 tools/perf/config/feature-checks/test-udis86.c

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index b4f8910..d465540 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -710,7 +710,7 @@ $(LIB_FILE): $(LIB_OBJS)
 # libtraceevent.a
 TE_SOURCES = $(wildcard $(TRACE_EVENT_DIR)*.[ch])
 
-LIBTRACEEVENT_FLAGS=$(QUIET_SUBDIR1) O=$(OUTPUT) CFLAGS="-g -Wall $(EXTRA_CFLAGS)" plugin_dir=$(plugindir_SQ)
+LIBTRACEEVENT_FLAGS=$(QUIET_SUBDIR1) O=$(OUTPUT) CFLAGS="-g -Wall $(EXTRA_CFLAGS) $(LIBTRACEEVENT_CFLAGS)" plugin_dir=$(plugindir_SQ)
 
 $(LIBTRACEEVENT): $(TE_SOURCES) $(OUTPUT)PERF-CFLAGS
 	$(QUIET_SUBDIR0)$(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) libtraceevent.a plugins
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 8c8a205..3f9c6b4 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -418,6 +418,14 @@ else
   msg := $(warning No timerfd support. Disables 'perf kvm stat live');
 endif
 
+$(call feature_check,udis86)
+ifeq ($(feature-udis86), 1)
+  LIBTRACEEVENT_CFLAGS += -DHAVE_UDIS86
+  EXTLIBS += -ludis86
+else
+  msg := $(warning No udis86 support.);
+endif
+
 disable-python = $(eval $(disable-python_code))
 define disable-python_code
   CFLAGS += -DNO_LIBPYTHON
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile
index 87e7900..b0df0f2 100644
--- a/tools/perf/config/feature-checks/Makefile
+++ b/tools/perf/config/feature-checks/Makefile
@@ -27,7 +27,8 @@ FILES=					\
 	test-on-exit			\
 	test-stackprotector-all		\
 	test-stackprotector		\
-	test-timerfd
+	test-timerfd			\
+	test-udis86
 
 CC := $(CC) -MD
 
@@ -144,6 +145,9 @@ test-backtrace:
 test-timerfd:
 	$(BUILD)
 
+test-udis86:
+	$(BUILD) -DHAVE_UDIS86 -ludis86
+
 -include *.d
 
 ###############################
diff --git a/tools/perf/config/feature-checks/test-all.c b/tools/perf/config/feature-checks/test-all.c
index 59e7a70..0896ae0 100644
--- a/tools/perf/config/feature-checks/test-all.c
+++ b/tools/perf/config/feature-checks/test-all.c
@@ -85,6 +85,10 @@
 # include "test-timerfd.c"
 #undef main
 
+#define main main_test_udis86
+# include "test-udis86.c"
+#undef main
+
 int main(int argc, char *argv[])
 {
 	main_test_libpython();
@@ -106,6 +110,7 @@ int main(int argc, char *argv[])
 	main_test_backtrace();
 	main_test_libnuma();
 	main_test_timerfd();
+	main_test_udis86();
 
 	return 0;
 }
diff --git a/tools/perf/config/feature-checks/test-udis86.c b/tools/perf/config/feature-checks/test-udis86.c
new file mode 100644
index 0000000..dbc2c26
--- /dev/null
+++ b/tools/perf/config/feature-checks/test-udis86.c
@@ -0,0 +1,11 @@
+
+/*
+ * test for udis86 functions used by plugin_kvm.c
+ */
+
+#include <udis86.h>
+
+int main(void)
+{
+	return puts("hi");
+}
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ