diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-15 22:28:25 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-29 23:34:41 +0200 |
commit | 83e69b92b10c2a8b75e1919b7074338f8bdbacaf (patch) | |
tree | d7e7f5a2a25decb034d95347479db11eac18984c /tools/perf/builtin-trace.c | |
parent | perf trace: Look up maps just on the __augmented_syscalls__ BPF object (diff) | |
download | linux-83e69b92b10c2a8b75e1919b7074338f8bdbacaf.tar.xz linux-83e69b92b10c2a8b75e1919b7074338f8bdbacaf.zip |
perf trace: Order -e syscalls table
The ev_qualifier is an array with the syscall ids passed via -e on the
command line, sort it as we'll search it when setting up the
BPF_MAP_TYPE_PROG_ARRAY.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-c8hprylp3ai6e0z9burn2r3s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | tools/perf/builtin-trace.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index bfd739a321d1..9bd5ecd6a8dd 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1528,6 +1528,13 @@ static int trace__read_syscall_info(struct trace *trace, int id) return syscall__set_arg_fmts(sc); } +static int intcmp(const void *a, const void *b) +{ + const int *one = a, *another = b; + + return *one - *another; +} + static int trace__validate_ev_qualifier(struct trace *trace) { int err = 0; @@ -1591,6 +1598,7 @@ matches: } trace->ev_qualifier_ids.nr = nr_used; + qsort(trace->ev_qualifier_ids.entries, nr_used, sizeof(int), intcmp); out: if (printed_invalid_prefix) pr_debug("\n"); |