Masami Hiramatsu 467ec08567 perf probe: Fix --del option to delete events only with uprobe events
Current perf probe --del doesn't work if only CONFIG_UPROBE_EVENTS=y
because it aborts when it fails to open kprobe_events file before
checking uprobe_events file.

This fixes --del option to delete dynamic events if it can open either
kprobe_events or uprobe_events. Only if it failed to open both of them,
it shows an error message and aborts.

Without this patch, if we run perf probe -d on the kernel configured
with CONFIG_KPROBE_EVENTS=n and CONFIG_UPROBE_EVENTS=y,

  # perf probe -d \*
  kprobe_events file does not exist - please rebuild kernel with CONFIG_KPROBE_EVENTS.
    Error: Failed to delete events.

With this patch,

  # perf probe -d \*
  Removed event: probe_perf:alloc_event

Changes in v2:
 - Use strerror_r instead of strerror.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20140813161250.26440.24028.stgit@kbuild-fedora.novalocal
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-08-13 15:54:11 -03:00
..
2013-12-27 15:17:00 -03:00
2014-05-01 21:22:39 +02:00
2014-05-01 21:22:39 +02:00
2011-02-16 13:30:48 +01:00
2012-02-13 23:17:40 -02:00
2014-07-23 17:36:36 -03:00
2014-07-16 17:57:37 -03:00
2014-07-23 11:25:40 -03:00
2014-06-09 13:34:49 +02:00
2014-07-16 17:57:33 -03:00
2014-05-21 11:48:33 +02:00
2014-05-01 21:22:39 +02:00
2014-05-01 21:22:39 +02:00
2014-05-01 21:22:39 +02:00
2014-06-09 13:34:49 +02:00
2013-08-07 17:35:26 -03:00
2014-05-01 21:22:39 +02:00
2014-07-10 00:22:54 +02:00
2014-07-10 00:22:54 +02:00
2014-07-23 17:36:36 -03:00
2014-07-23 17:36:36 -03:00
2014-07-23 11:27:50 -03:00
2014-07-23 11:27:50 -03:00
2014-05-01 21:22:39 +02:00
2014-07-23 11:48:11 -03:00
2014-07-23 11:48:11 -03:00
2014-05-01 21:22:39 +02:00
2014-05-01 21:22:39 +02:00