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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 5ca0b7f5
...@@ -1528,6 +1528,13 @@ static int trace__read_syscall_info(struct trace *trace, int id) ...@@ -1528,6 +1528,13 @@ static int trace__read_syscall_info(struct trace *trace, int id)
return syscall__set_arg_fmts(sc); 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) static int trace__validate_ev_qualifier(struct trace *trace)
{ {
int err = 0; int err = 0;
...@@ -1591,6 +1598,7 @@ static int trace__validate_ev_qualifier(struct trace *trace) ...@@ -1591,6 +1598,7 @@ static int trace__validate_ev_qualifier(struct trace *trace)
} }
trace->ev_qualifier_ids.nr = nr_used; trace->ev_qualifier_ids.nr = nr_used;
qsort(trace->ev_qualifier_ids.entries, nr_used, sizeof(int), intcmp);
out: out:
if (printed_invalid_prefix) if (printed_invalid_prefix)
pr_debug("\n"); pr_debug("\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment