linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
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: Re: [PATCH v2 5/5] perf trace: Remove audit-libs dependency if syscall tables are present
Date: Fri, 19 Jan 2018 11:04:26 -0300	[thread overview]
Message-ID: <20180119140426.GB23453@kernel.org> (raw)
In-Reply-To: <1516352177-11106-6-git-send-email-brueckner@linux.vnet.ibm.com>

Em Fri, Jan 19, 2018 at 09:56:17AM +0100, Hendrik Brueckner escreveu:
> 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>

So, I need this extra patch to really stop linking against
audit-libs-devel (aka libaudit), which I merged with this 5/5 patch and
have now in my tree, thanks for your work! Now we can get on with this
and, for instance, get rid of those strcmp() and big switch statements,
which I think that could be just an array plus a helper to see if it is
in its bounds, etc, i.e. use an strarray, look at
tools/perf/trace/beauty/beauty.h:

struct strarray {
        int         offset;
        int         nr_entries;
        const char **entries;
};

#define DEFINE_STRARRAY(array) struct strarray strarray__##array = { \
        .nr_entries = ARRAY_SIZE(array), \
        .entries = array, \
}

#define DEFINE_STRARRAY_OFFSET(array, off) struct strarray strarray__##array = { \
        .offset     = off, \
        .nr_entries = ARRAY_SIZE(array), \
        .entries = array, \
}

size_t strarray__scnprintf(struct strarray *sa, char *bf, size_t size, const char *intfmt, int val); 

tools/perf/trace/beauty/ has lots of uses for it.

[acme@seventh perf]$ rpm -q audit-libs-devel
audit-libs-devel-2.8.2-1.fc27.x86_64
[acme@seventh perf]$ ldd ~/bin/perf | grep audit
[acme@seventh perf]$ 

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
 perf-y += builtin-version.o
 perf-y += builtin-c2c.o
 
-perf-$(CONFIG_AUDIT) += builtin-trace.o
+perf-$(CONFIG_TRACE) += builtin-trace.o
 perf-$(CONFIG_LIBELF) += builtin-probe.o
 
 perf-y += bench/
@@ -50,6 +50,6 @@ libperf-y += util/
 libperf-y += arch/
 libperf-y += ui/
 libperf-y += scripts/
-libperf-$(CONFIG_AUDIT) += trace/beauty/
+libperf-$(CONFIG_TRACE) += trace/beauty/
 
 gtk-y += ui/gtk/
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 896dee62078c..a042ccca4e93 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -531,20 +531,18 @@ ifndef NO_LIBUNWIND
   EXTLIBS += $(EXTLIBS_LIBUNWIND)
 endif
 
-ifndef NO_LIBAUDIT
-  ifneq ($(feature-libaudit), 1)
-    ifeq ($(NO_SYSCALL_TABLE), 1)
+ifeq ($(NO_SYSCALL_TABLE),0)
+  $(call detected,CONFIG_TRACE)
+else
+  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
     else
-      # With syscall table support, auditlibs are no longer required to build
-      # the trace tool.
-      $(call detected,CONFIG_AUDIT)
+      CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
+      EXTLIBS += -laudit
+      $(call detected,CONFIG_TRACE)
     endif
-  else
-    CFLAGS += -DHAVE_LIBAUDIT_SUPPORT
-    EXTLIBS += -laudit
-    $(call detected,CONFIG_AUDIT)
   endif
 endif
 
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
 libperf-y += map.o
 libperf-y += pstack.o
 libperf-y += session.o
-libperf-$(CONFIG_AUDIT) += syscalltbl.o
+libperf-$(CONFIG_TRACE) += syscalltbl.o
 libperf-y += ordered-events.o
 libperf-y += namespaces.o
 libperf-y += comm.o

  reply	other threads:[~2018-01-19 14:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19  8:56 [PATCH v2 0/5] perf trace: Introduce arch-specific errno code/name mappings Hendrik Brueckner
2018-01-19  8:56 ` [PATCH v2 1/5] tools include arch: Grab a copy of errno.h for arch's supported by perf Hendrik Brueckner
2018-01-19  8:56 ` [PATCH v2 2/5] tools include asm-generic: Grab errno.h and errno-base.h Hendrik Brueckner
2018-01-19  8:56 ` [PATCH v2 3/5] perf util: Introduce architecture specific errno/name mapping Hendrik Brueckner
2018-01-19  8:56 ` [PATCH v2 4/5] perf trace: Obtain errno values by using arch_syscalls__strerrno() Hendrik Brueckner
2018-01-19  8:56 ` [PATCH v2 5/5] perf trace: Remove audit-libs dependency if syscall tables are present Hendrik Brueckner
2018-01-19 14:04   ` Arnaldo Carvalho de Melo [this message]
2018-01-21 12:27     ` Arnaldo Carvalho de Melo
2018-01-25  8:00 ` [PATCH v2 0/5] perf trace: Introduce arch-specific errno code/name mappings Ravi Bangoria
2018-01-25  9:28   ` Arnaldo Carvalho de Melo

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=20180119140426.GB23453@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=brueckner@linux.vnet.ibm.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).