linux-stable/tools
Arnaldo Carvalho de Melo d21cb73a90 perf trace: Grow the syscall table as needed when using libaudit
The audit-libs API doesn't provide a way to figure out what is the
syscall with the greatest number/id, take that into account when using
that method to go on growing the syscall table as we the syscalls go on
appearing on the radar.

With this the libaudit based method is back working, i.e. when building
with:

  $ make NO_SYSCALL_TABLE=1 O=/tmp/build/perf -C tools/perf install-bin
  <SNIP>
  Auto-detecting system features:
  <SNIP>
  ...                      libaudit: [ on  ]
  ...                        libbfd: [ on  ]
  ...                        libcap: [ on  ]
  <SNIP>
  $ ldd ~/bin/perf | grep audit
	libaudit.so.1 => /lib64/libaudit.so.1 (0x00007faef22df000)
  $

perf trace is back working, which makes it functional in arches other
than x86_64, powerpc, arm64 and s390, that provides these generators:

  $ find tools/perf/arch/ -name "*syscalltbl*"
  tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
  tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
  tools/perf/arch/s390/entry/syscalls/mksyscalltbl
  tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl
  $

Example output forcing the libaudit method on x86_64:

  # perf trace -e file,nanosleep sleep 0.001
           ? (         ): sleep/859090  ... [continued]: execve())                                   = 0
       0.045 ( 0.005 ms): sleep/859090 access(filename: 0x8733e850, mode: R)                         = -1 ENOENT (No such file or directory)
       0.055 ( 0.005 ms): sleep/859090 openat(dfd: CWD, filename: 0x8733ba29, flags: RDONLY|CLOEXEC) = 3
       0.079 ( 0.005 ms): sleep/859090 openat(dfd: CWD, filename: 0x87345d20, flags: RDONLY|CLOEXEC) = 3
       0.085 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483f58, count: 832)                  = 832
       0.090 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483b50, count: 784)                  = 784
       0.094 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483b20, count: 32)                   = 32
       0.098 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483ad0, count: 68)                   = 68
       0.109 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483a50, count: 784)                  = 784
       0.113 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483730, count: 32)                   = 32
       0.117 ( 0.002 ms): sleep/859090 read(fd: 3, buf: 0x7ffd9d483710, count: 68)                   = 68
       0.320 ( 0.008 ms): sleep/859090 openat(dfd: CWD, filename: 0x872c3660, flags: RDONLY|CLOEXEC) = 3
       0.372 ( 1.057 ms): sleep/859090 nanosleep(rqtp: 0x7ffd9d484ac0)                               = 0
  #

There are still some limitations when using the libaudit method, that
will be fixed at some point, i.e., this works with the mksyscalltbl
method but not with libaudit's:

  # perf trace -e file,*sleep sleep 0.001
  event syntax error: '*sleep'
                       \___ parser error
  Run 'perf list' for a list of valid events

   Usage: perf trace [<options>] [<command>]
      or: perf trace [<options>] -- <command> [<options>]
      or: perf trace record [<options>] [<command>]
      or: perf trace record [<options>] -- <command> [<options>]

      -e, --event <event>   event/syscall selector. use 'perf list' to list available events
  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-05-29 16:51:11 -03:00
..
accounting SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
arch tools arch x86: Sync asm/cpufeatures.h with the kernel sources 2020-04-14 09:08:23 -03:00
bootconfig tools/bootconfig: Fix apply_xbc() to return zero on success 2020-05-11 17:00:26 -04:00
bpf tools/runqslower: Ensure own vmlinux.h is picked up first 2020-04-24 17:45:20 -07:00
build perf: cs-etm: Update to build with latest opencsd version. 2020-05-05 16:35:32 -03:00
cgroup iocost: protect iocg->abs_vdebt with iocg->waitq.lock 2020-05-05 09:23:18 -06:00
debugging
edid
firewire
firmware
gpio This is the bulk of GPIO development for the v5.7 kernel cycle. 2020-04-04 10:27:00 -07:00
hv
iio .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-04-24 19:17:30 -07:00
io_uring
kvm/kvm_stat tools/kvm_stat: add command line switch '-c' to log in csv format 2020-03-23 15:44:21 -04:00
laptop change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
leds .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
lib Linux 5.7-rc7 2020-05-28 07:58:12 +02:00
memory-model .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
nfsd
objtool A set of fixes for x86: 2020-05-10 11:59:53 -07:00
pci tools: PCI: Add 'e' to clear IRQ 2020-04-02 17:57:10 +01:00
pcmcia .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
perf perf trace: Grow the syscall table as needed when using libaudit 2020-05-29 16:51:11 -03:00
power pm-graph v5.6 2020-04-20 10:37:02 +02:00
scripts Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-03-25 18:58:11 -07:00
spi SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
testing Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-05-23 17:16:18 -07:00
thermal/tmon - Convert tsens configuration DT binding to yaml (Rajeshwari) 2020-04-07 20:00:16 -07:00
time
usb .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
virtio tools/virtio: make asm/barrier.h self contained 2020-04-17 06:05:29 -04:00
vm tools/vm: fix cross-compile build 2020-04-21 11:11:56 -07:00
wmi
Makefile