From: Arnaldo Carvalho de Melo Date: Wed, 5 Dec 2018 16:08:11 +0000 (-0300) Subject: perf trace: We need to consider "nr" if "__syscall_nr" is not there X-Git-Tag: v5.4-rc1~1977^2~1^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42da438c1bc4ad9b904401aff03678ddbf1329b0;p=platform%2Fkernel%2Flinux-rpi.git 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: 026842d148b9 ("tracing/syscalls: Rename "/format" tracepoint field name "nr" to "__syscall_nr:") This makes 'perf trace' work again in RHEL7 kernels. Cc: Taeung Song Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-6h1syw2isegnhb1bjmtr9x9k@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 2a347ed7bdf4..98aff12af9e6 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -258,7 +258,8 @@ static int perf_evsel__init_syscall_tp(struct perf_evsel *evsel) struct syscall_tp *sc = evsel->priv = malloc(sizeof(struct syscall_tp)); if (evsel->priv != NULL) { - if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr")) + if (perf_evsel__init_tp_uint_field(evsel, &sc->id, "__syscall_nr") && + perf_evsel__init_tp_uint_field(evsel, &sc->id, "nr")) goto out_delete; return 0; }