perf probe: Check the orphaned -x option
perf probe: Check the orphaned -x option

To avoid probing in unintended binary, the orphaned -x option must be
checked and warned.

Without this patch, following command sets up the probe in the kernel.

  -----
  # perf probe -a strcpy -x ./perf
  Added new event:
    probe:strcpy         (on strcpy)

  You can now use it in all perf tools, such as:

          perf record -e probe:strcpy -aR sleep 1
  -----

But in this case, it seems that the user may want to probe in the perf
binary. With this patch, perf-probe correctly handles the orphaned -x.

  -----
  # perf probe -a strcpy -x ./perf
    Error: -x/-m must follow the probe definitions.
  ...
  -----

Reported-by: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com>
Acked-by: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com>
Cc: David Ahern <b80c1600f604d3b0d768f26f90a76757e76005dd@gmail.com>
Cc: Namhyung Kim <5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org>
Cc: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Link: af84c000a3841730cf8f0c73dabd941a2bfa3539@localhost.localdomain
Signed-off-by: Masami Hiramatsu <60fcdccfd958d359debfe6e6e7417cd7f1aaa9e3@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs