Skip to contentSkip to conversation

perf trace: We need to consider "nr" if "__syscall_nr" is not there

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Dec 14, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  3e9c3a56674b5e87031c9d462ec2c6156efe442b
Gitweb:     https://git.kernel.org/tip/3e9c3a56674b5e87031c9d462ec2c6156efe442b
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 5 Dec 2018 13:08:11 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 6 Dec 2018 14:12:32 -0300

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.

---
 tools/perf/builtin-trace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/builtin-trace.c +2 -1
index 2a347ed7bdf4..98aff12af9e6 100644
@@ -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;
 	}