perf evlist: Send the errno in the signal when workload fails
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Jan 2014 18:11:25 +0000 (15:11 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 13 Jan 2014 13:06:21 +0000 (10:06 -0300)
commitf33cbe72e6166b97d6fa2400cb00a885b47999d7
tree838b627d593e8ddc2b26db819bda78ec88d00a9c
parent6af206fd911c825b83dd4efb2534a3a34ce77072
perf evlist: Send the errno in the signal when workload fails

When a tool uses perf_evlist__start_workload and the supplied workload
fails (e.g.: its binary wasn't found), perror was being used to print
the error reason.

This is undesirable, as the caller may be a GUI, when it wants to have
total control of the error reporting process.

So move to using sigaction(SA_SIGINFO) + siginfo_t->sa_value->sival_int
to communicate to the caller the errno and let it print it using the UI
of its choosing.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-epgcv7kjq8ll2udqfken92pz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c
tools/perf/builtin-stat.c
tools/perf/util/evlist.c