]> git.baikalelectronics.ru Git - kernel.git/commit
perf trace: Validate syscall list passed via -e argument
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 25 Jun 2015 22:32:33 +0000 (19:32 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 26 Jun 2015 13:47:41 +0000 (10:47 -0300)
commitb95943e53bfaf991818d4519bb61c0f4a12fcb6e
tree1dc119e41b6bf4aa8547d265ccc4b93e528f9b41
parentbc88fba31b76042eccefe0c0032b7ca86bc061d5
perf trace: Validate syscall list passed via -e argument

The 'trace' tool was accepting any names passed and just looking if
syscalls returned via the raw_syscalls:* tracepoints were in that list,
leading to it accepting perf events and then never finding any, as those
are not valid syscall names, confusing users.

Fix it by checking each entry in the list using audit_name_to_syscall,
telling the user which entries are invalid and suggesting where to look
for valid syscall names.

E.g:

  [root@zoo ~]# trace -e open,foo,bar,close,baz
  Error: Invalid syscall bar, baz, foo
  Hint:  try 'perf list syscalls:sys_enter_*'
  Hint:  and: 'man syscalls'
  [root@zoo ~]#

Reported-by: Flavio Leitner <fbl@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-4g1i3m1z6fzsrznn2umi02wa@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c