perf augmented_raw_syscalls: Change helper to consider just the augmented_filename...
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 4 Jun 2019 18:57:28 +0000 (15:57 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 5 Jun 2019 12:48:54 +0000 (09:48 -0300)
commitdeaf4da48a67f73eb7d5d1802c14eaf58d33f2da
treea75bbd029f49155732dcb89471c5ca80d56290b4
parent0c95a7ff76fb1c5bb614e6ee438fce06d1b957c8
perf augmented_raw_syscalls: Change helper to consider just the augmented_filename part

So that we can use it for multiple args, baby steps not to step into the
verifier toes.

In the process make sure we handle -EFAULT from bpf_prog_read_str(), as
this really is needed now that we'll handle more than one augmented
argument, i.e. if there is failure, then we have the argument that fails
have:

  (size = 0, err = -EFAULT, value = [] )

followed by the next, lets say that worked for a second pathname:

  (size = 4, err = 0, value = "/tmp" )

So we can skip the first while telling the user about the problem and
then process the second.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Brendan Gregg <brendan.d.gregg@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-deyvqi39um6gp6hux6jovos8@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/examples/bpf/augmented_raw_syscalls.c