linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>,
	Michael Petlan <mpetlan@redhat.com>, Jiri Olsa <jolsa@redhat.com>,
	linux-perf-users@vger.kernel.org, linux-s390@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 5/5] perf trace: Remove audit-libs dependency if syscall tables are present
Date: Tue, 16 Jan 2018 10:46:31 +0100	[thread overview]
Message-ID: <1516095991-16337-6-git-send-email-brueckner@linux.vnet.ibm.com> (raw)
In-Reply-To: <1516095991-16337-1-git-send-email-brueckner@linux.vnet.ibm.com>

Change the Makefile and build process to no longer require audit-libs
interfaces when the architecture provides system call tables.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
---
 tools/perf/Makefile.config          | 10 ++++++++--
 tools/perf/builtin-help.c           |  2 +-
 tools/perf/perf.c                   |  4 ++--
 tools/perf/util/generate-cmdlist.sh |  2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 90ce14f..8ba416c 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -533,8 +533,14 @@ endif
 
 ifndef NO_LIBAUDIT
   ifneq ($(feature-libaudit), 1)
-    msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
-    NO_LIBAUDIT := 1
+    ifeq ($(NO_SYSCALL_TABLE), 1)
+      msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
+      NO_LIBAUDIT := 1
+    else
+      # With syscall table support, auditlibs are no longer required to build
+      # the trace tool.
+      $(call detected,CONFIG_AUDIT)
+    endif
   else
     CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
     EXTLIBS += -laudit
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index a0f7ed2..4aca13f 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)
 #ifdef HAVE_LIBELF_SUPPORT
 		"probe",
 #endif
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
 		"trace",
 #endif
 	NULL };
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 62b1351..1b3fc8e 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -73,7 +73,7 @@ struct cmd_struct {
 	{ "lock",	cmd_lock,	0 },
 	{ "kvm",	cmd_kvm,	0 },
 	{ "test",	cmd_test,	0 },
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
 	{ "trace",	cmd_trace,	0 },
 #endif
 	{ "inject",	cmd_inject,	0 },
@@ -485,7 +485,7 @@ int main(int argc, const char **argv)
 		argv[0] = cmd;
 	}
 	if (strstarts(cmd, "trace")) {
-#ifdef HAVE_LIBAUDIT_SUPPORT
+#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)
 		setup_path();
 		argv[0] = "trace";
 		return cmd_trace(argc, argv);
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 9bbcec4..ff17920 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -38,7 +38,7 @@ do
 done
 echo "#endif /* HAVE_LIBELF_SUPPORT */"
 
-echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
+echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)"
 sed -n -e 's/^perf-\([^ 	]*\)[ 	].* audit*/\1/p' command-list.txt |
 sort |
 while read cmd
-- 
1.8.3.1

      parent reply	other threads:[~2018-01-16  9:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16  9:46 [PATCH 0/5] perf trace: Introduce arch-specific errno code/name mappings Hendrik Brueckner
2018-01-16  9:46 ` [PATCH 1/5] tools include arch: Grab a copy of errno.h for arch's supported by perf Hendrik Brueckner
2018-01-16  9:46 ` [PATCH 2/5] tools include asm-generic: Grab errno.h and errno-base.h Hendrik Brueckner
2018-01-16  9:46 ` [PATCH 3/5] perf util: Introduce architecture specific errno/name mapping Hendrik Brueckner
2018-01-16 13:58   ` Arnaldo Carvalho de Melo
2018-01-17  8:49     ` Hendrik Brueckner
2018-01-18 10:07   ` Jiri Olsa
2018-01-18 10:49     ` Arnaldo Carvalho de Melo
2018-01-18 11:33       ` Hendrik Brueckner
2018-01-18 14:11         ` Arnaldo Carvalho de Melo
2018-01-18 12:19       ` Jiri Olsa
2018-01-16  9:46 ` [PATCH 4/5] perf trace: Obtain errno values by using arch_errno_to_name() Hendrik Brueckner
2018-01-16  9:46 ` Hendrik Brueckner [this message]

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=1516095991-16337-6-git-send-email-brueckner@linux.vnet.ibm.com \
    --to=brueckner@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=tmricht@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).