]> asedeno.scripts.mit.edu Git - linux.git/commit
perf trace: Honour --max-events in processing syscalls:sys_enter_*
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 18 Oct 2019 14:48:57 +0000 (11:48 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 18 Oct 2019 15:19:02 +0000 (12:19 -0300)
commitdb25bf98a3861225bc0b2138cf665097141c72ee
treec3b2503b0e2976ad17f03c9ad25b579a96002e0c
parentd066da978f89ef035c823367a97650f0c4cfa464
perf trace: Honour --max-events in processing syscalls:sys_enter_*

We were doing this only at the sys_exit syscall tracepoint, as for
strace-like we count the pair of sys_enter and sys_exit as one event,
but when asking specifically for a the syscalls:sys_enter_NAME
tracepoint we need to count each of those as an event.

I.e. things like:

  # perf trace --max-events=4 -e syscalls:sys_enter_lseek
     0.000 pool/2242 syscalls:sys_enter_lseek(fd: 14<anon_inode:[timerfd]>, offset: 0, whence: CUR)
     0.034 pool/2242 syscalls:sys_enter_lseek(fd: 15<anon_inode:[timerfd]>, offset: 0, whence: CUR)
     0.051 pool/2242 syscalls:sys_enter_lseek(fd: 16<anon_inode:[timerfd]>, offset: 0, whence: CUR)
  2307.900 sshd/30800 syscalls:sys_enter_lseek(fd: 3</usr/lib64/libsystemd.so.0.25.0>, offset: 9032, whence: SET)
  #

Were going on forever, since we only had sys_enter events.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-0ob1dky1a9ijlfrfhxyl40wr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c