summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2018-01-19 03:56:17 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-01-23 07:51:38 -0500
commitb3fa38963a6a95bef888350ff3125182462c523c (patch)
tree6a7c3c7972b1ed4d8f9a4b4b527542f84c35a37f
parent092bd3cd7169085b09e4a5307de95e461d0581d7 (diff)
perf trace: Remove audit-libs dependency if syscall tables are present
Change the Makefile and build process to no longer require audit-libs interfaces when the architecture provides system call tables. Committer notes: Its not enough to hook into the NO_LIBAUDIT makefile block, we need to define a CONFIG_TRACE that gets selected by both architectures generating the syscall tables from the kernel headers and from detecting the availability of libaudit. With that in place we will not link against libaudit even if the necessary files are available for that, in fact we will not even try to detect its availability, speeding up a bit the feature detection phase. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: linux-s390@vger.kernel.org LPU-Reference: 1516352177-11106-6-git-send-email-brueckner@linux.vnet.ibm.com Link: https://lkml.kernel.org/n/tip-j68lub6ipm8apvy52vd3l4cm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Build4
-rw-r--r--tools/perf/Makefile.config20
-rw-r--r--tools/perf/builtin-help.c2
-rw-r--r--tools/perf/perf.c4
-rw-r--r--tools/perf/util/Build2
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh2
6 files changed, 19 insertions, 15 deletions
diff --git a/tools/perf/Build b/tools/perf/Build
index b48ca40fccf9..e5232d567611 100644
--- a/tools/perf/Build
+++ b/tools/perf/Build
@@ -25,7 +25,7 @@ perf-y += builtin-data.o
25perf-y += builtin-version.o 25perf-y += builtin-version.o
26perf-y += builtin-c2c.o 26perf-y += builtin-c2c.o
27 27
28perf-$(CONFIG_AUDIT) += builtin-trace.o 28perf-$(CONFIG_TRACE) += builtin-trace.o
29perf-$(CONFIG_LIBELF) += builtin-probe.o 29perf-$(CONFIG_LIBELF) += builtin-probe.o
30 30
31perf-y += bench/ 31perf-y += bench/
@@ -50,6 +50,6 @@ libperf-y += util/
50libperf-y += arch/ 50libperf-y += arch/
51libperf-y += ui/ 51libperf-y += ui/
52libperf-y += scripts/ 52libperf-y += scripts/
53libperf-$(CONFIG_AUDIT) += trace/beauty/ 53libperf-$(CONFIG_TRACE) += trace/beauty/
54 54
55gtk-y += ui/gtk/ 55gtk-y += ui/gtk/
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 92265b32dddd..a042ccca4e93 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -531,14 +531,18 @@ ifndef NO_LIBUNWIND
531 EXTLIBS += $(EXTLIBS_LIBUNWIND) 531 EXTLIBS += $(EXTLIBS_LIBUNWIND)
532endif 532endif
533 533
534ifndef NO_LIBAUDIT 534ifeq ($(NO_SYSCALL_TABLE),0)
535 ifneq ($(feature-libaudit), 1) 535 $(call detected,CONFIG_TRACE)
536 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev); 536else
537 NO_LIBAUDIT := 1 537 ifndef NO_LIBAUDIT
538 else 538 ifneq ($(feature-libaudit), 1)
539 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT 539 msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
540 EXTLIBS += -laudit 540 NO_LIBAUDIT := 1
541 $(call detected,CONFIG_AUDIT) 541 else
542 CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
543 EXTLIBS += -laudit
544 $(call detected,CONFIG_TRACE)
545 endif
542 endif 546 endif
543endif 547endif
544 548
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index a0f7ed2b869b..4aca13f23b9d 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -439,7 +439,7 @@ int cmd_help(int argc, const char **argv)
439#ifdef HAVE_LIBELF_SUPPORT 439#ifdef HAVE_LIBELF_SUPPORT
440 "probe", 440 "probe",
441#endif 441#endif
442#ifdef HAVE_LIBAUDIT_SUPPORT 442#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
443 "trace", 443 "trace",
444#endif 444#endif
445 NULL }; 445 NULL };
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 62b13518bc6e..1b3fc8ec0fa2 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -73,7 +73,7 @@ static struct cmd_struct commands[] = {
73 { "lock", cmd_lock, 0 }, 73 { "lock", cmd_lock, 0 },
74 { "kvm", cmd_kvm, 0 }, 74 { "kvm", cmd_kvm, 0 },
75 { "test", cmd_test, 0 }, 75 { "test", cmd_test, 0 },
76#ifdef HAVE_LIBAUDIT_SUPPORT 76#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
77 { "trace", cmd_trace, 0 }, 77 { "trace", cmd_trace, 0 },
78#endif 78#endif
79 { "inject", cmd_inject, 0 }, 79 { "inject", cmd_inject, 0 },
@@ -485,7 +485,7 @@ int main(int argc, const char **argv)
485 argv[0] = cmd; 485 argv[0] = cmd;
486 } 486 }
487 if (strstarts(cmd, "trace")) { 487 if (strstarts(cmd, "trace")) {
488#ifdef HAVE_LIBAUDIT_SUPPORT 488#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
489 setup_path(); 489 setup_path();
490 argv[0] = "trace"; 490 argv[0] = "trace";
491 return cmd_trace(argc, argv); 491 return cmd_trace(argc, argv);
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 7c6a8b461e24..4eef0c243306 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -44,7 +44,7 @@ libperf-y += machine.o
44libperf-y += map.o 44libperf-y += map.o
45libperf-y += pstack.o 45libperf-y += pstack.o
46libperf-y += session.o 46libperf-y += session.o
47libperf-$(CONFIG_AUDIT) += syscalltbl.o 47libperf-$(CONFIG_TRACE) += syscalltbl.o
48libperf-y += ordered-events.o 48libperf-y += ordered-events.o
49libperf-y += namespaces.o 49libperf-y += namespaces.o
50libperf-y += comm.o 50libperf-y += comm.o
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 9bbcec4e3365..ff17920a5ebc 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -38,7 +38,7 @@ do
38done 38done
39echo "#endif /* HAVE_LIBELF_SUPPORT */" 39echo "#endif /* HAVE_LIBELF_SUPPORT */"
40 40
41echo "#ifdef HAVE_LIBAUDIT_SUPPORT" 41echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)"
42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | 42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
43sort | 43sort |
44while read cmd 44while read cmd