Skip to content

Commit 42da438

Browse files
committed
perf trace: We need to consider "nr" if "__syscall_nr" is not there
To cope with older kernels that don't have this patch backported: 026842d ("tracing/syscalls: Rename "/format" tracepoint field name "nr" to "__syscall_nr:") This makes 'perf trace' work again in RHEL7 kernels. Cc: Taeung Song <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Wang Nan <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 3fcb10e commit 42da438

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/perf/builtin-trace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ static int perf_evsel__init_syscall_tp(struct perf_evsel *evsel)
258258
struct syscall_tp *sc = evsel->priv = malloc(sizeof(struct syscall_tp));
259259

260260
if (evsel->priv != NULL) {
261-
if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr"))
261+
if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") &&
262+
perf_evsel__init_tp_uint_field(evsel, &sc->id, "nr"))
262263
goto out_delete;
263264
return 0;
264265
}

0 commit comments

Comments
 (0)