diff options
author | Leo Yan <[email protected]> | 2019-06-06 10:38:59 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-06-10 15:49:43 -0300 |
commit | 012749caf9419f22636891259b664c6dd383e897 (patch) | |
tree | 830e351beb4e1a395fc1791d618883c1d9876808 /tools/perf/scripts/python/compaction-times.py | |
parent | dea87bfb7b280e8b14519eb6b5e8bafbbf4c66f2 (diff) |
perf trace: Exit when failing to build eBPF program
On my Juno board with ARM64 CPUs, perf trace command reports the eBPF
program building failure but the command will not exit and continue to
run. If we define an eBPF event in config file, the event will be
parsed with below flow:
perf_config()
`> trace__config()
`> parse_events_option()
`> parse_events__scanner()
`-> parse_events_parse()
`> parse_events_load_bpf()
`> llvm__compile_bpf()
Though the low level functions return back error values when detect eBPF
building failure, but parse_events_option() returns 1 for this case and
trace__config() passes 1 to perf_config(); perf_config() doesn't treat
the returned value 1 as failure and it continues to parse other
configurations. Thus the perf command continues to run even without
enabling eBPF event successfully.
This patch changes error handling in trace__config(), when it detects
failure it will return -1 rather than directly pass error value (1);
finally, perf_config() will directly bail out and perf will exit for
this case.
Committer notes:
Simplified the patch to just check directly the return of
parse_events_option() and it it is non-zero, change err from its initial
zero value to -1.
Signed-off-by: Leo Yan <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Martin KaFai Lau <[email protected]>
Cc: Mathieu Poirier <[email protected]>
Cc: Mike Leach <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Song Liu <[email protected]>
Cc: Suzuki Poulouse <[email protected]>
Cc: Yonghong Song <[email protected]>
Fixes: ac96287cae08 ("perf trace: Allow specifying a set of events to add in perfconfig")
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions