All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: Re: [PATCH 17/19] perf tools: Build syscall table .c header from kernel's syscall_64.tbl
Date: Thu, 7 Apr 2016 18:50:08 -0300	[thread overview]
Message-ID: <20160407215008.GI5945@kernel.org> (raw)
In-Reply-To: <5706D389.50404@gmail.com>

Em Thu, Apr 07, 2016 at 03:39:21PM -0600, David Ahern escreveu:
> On 4/7/16 2:58 PM, Arnaldo Carvalho de Melo wrote:
> >We used libaudit to map ids to syscall names and vice-versa, but that
> >imposes a delay in supporting new syscalls, having to wait for libaudit
> >to get those new syscalls on its tables.
 
> and for the distribution to get the new libaudit.

yeap
 
> >To remove that delay, for x86_64 initially, grab a copy of
> >arch/x86/entry/syscalls/syscall_64.tbl and use it to generate those
> >tables.
> 
> Now that's a benefit for perf in the kernel tree. What happens for out of
> tree perf builds? Are the requisite files included in the tarball?
> (apparently no, since the manifest file is not updated or perhaps I missed
> it)

Well, we're removing references to files outside tools/, so what was
done in this case was to copy the files:

[acme@jouet linux]$ ls -la tools/perf/arch/x86/entry/syscalls/
total 28
drwxrwxr-x. 2 acme acme  4096 Apr  7 16:59 .
drwxrwxr-x. 3 acme acme  4096 Apr  7 16:59 ..
-rw-rw-r--. 1 acme acme 12972 Apr  7 16:59 syscall_64.tbl
-rwxrwxr-x. 1 acme acme   596 Apr  7 16:59 syscalltbl.sh
[acme@jouet linux]$ 

Then we have logic for when the kernel one gets out of sync, to be
warned about, see:

tools/perf/arch/x86/Makefile

E.g.:

[acme@jouet linux]$ git diff
diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
index 2e5b565adacc..e8af21d804f8 100644
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@ -333,6 +333,7 @@
 324    common  membarrier              sys_membarrier
 325    common  mlock2                  sys_mlock2
 326    common  copy_file_range         sys_copy_file_range
+327    common  leftpad                 sys_leftpad
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
[acme@jouet linux]$
[acme@jouet linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf ; m
make: Entering directory '/home/acme/git/linux/tools/perf'

[acme@jouet linux]$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .

  BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
...                         dwarf: [ on  ]
<SNIP>

  GEN      /tmp/build/perf/common-cmds.h
Warning: x86_64's syscall_64.tbl differs from kernel
  CC       /tmp/build/perf/fixdep.o
  LD       /tmp/build/perf/fixdep-in.o

---------------------------------------

Looking at it now it needs some more polish, i.e. it should have a GEN ...
line, but that can be done on top of this patchkit :-)

For completeness:

[acme@jouet linux]$ diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
--- tools/perf/arch/x86/entry/syscalls/syscall_64.tbl	2016-04-07 16:59:44.938061779 -0300
+++ arch/x86/entry/syscalls/syscall_64.tbl	2016-04-07 18:43:51.543992781 -0300
@@ -333,6 +333,7 @@
 324	common	membarrier		sys_membarrier
 325	common	mlock2			sys_mlock2
 326	common	copy_file_range		sys_copy_file_range
+327	common	leftpad			sys_leftpad
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
[acme@jouet linux]$

And 'make -C tools/perf build-test' does the tarball creation and out-of-tree
build as its first step, to make sure it continues working, so all that is
needed is there :-)

[acme@jouet linux]$ make -C tools/perf build-test
make: Entering directory '/home/acme/git/linux/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
- /home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP: cd . && make FEATURE_DUMP_COPY=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP  feature-dump
cd . && make FEATURE_DUMP_COPY=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP feature-dump
              make_minimal_O: cd . && make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 FEATURES_DUMP=/home/acme/git/linux/tools/perf/BUILD_TEST_FEATURE_DUMP -j4 O=/tmp/tmp.6KCw8TRjm7 DESTDIR=/tmp/tmp.6yw98RESmd
<SNIP>

Best regards,

- Arnaldo

  reply	other threads:[~2016-04-07 21:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 20:58 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 01/19] perf config: Fix build with older toolchain Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 02/19] perf probe: Check if dwarf_getlocations() is available Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 03/19] perf script perl: Do error checking on new backtrace routine Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 04/19] perf tools: Remove superfluous ARCH Makefile includes Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 05/19] perf list: Document event specifications better Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 06/19] perf trace: Beautify sched_setscheduler 'policy' argument Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 07/19] perf trace: Beautify wait4/waitid 'options' argument Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 08/19] perf trace: Infrastructure to show COMM strings for syscalls returning PIDs Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 09/19] perf trace: Beautify set_tid_address, getpid, getppid return values Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 10/19] perf trace: Beautify pid_t arguments Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 11/19] perf tools: Introduce trim function Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 12/19] perf tools: Add dedicated unwind addr_space member into thread struct Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 13/19] perf script: Process event update events Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 14/19] perf trace: Beautify mode_t arguments Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 15/19] perf trace: Move syscall table id <-> name routines to separate class Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 16/19] perf tools: Allow generating per-arch syscall table arrays Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 17/19] perf tools: Build syscall table .c header from kernel's syscall_64.tbl Arnaldo Carvalho de Melo
2016-04-07 21:39   ` David Ahern
2016-04-07 21:50     ` Arnaldo Carvalho de Melo [this message]
2016-04-07 21:49   ` David Ahern
2016-04-07 21:52     ` Arnaldo Carvalho de Melo
2016-04-08  3:27   ` Wangnan (F)
2016-04-07 20:58 ` [PATCH 18/19] perf symbols: Record text offset in dso to calculate objdump address Arnaldo Carvalho de Melo
2016-04-07 20:58 ` [PATCH 19/19] perf symbols: Adjust symbol for shared objects Arnaldo Carvalho de Melo
2016-04-08 13:15 ` [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-04-13  6:58   ` Ingo Molnar

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=20160407215008.GI5945@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.