diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-09-16 08:44:03 -0600 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-09-29 11:16:58 -0300 |
commit | b15d0a4c828eafc82ea68fcf88db6fa93eeb23d7 (patch) | |
tree | 2a2fda820a33ad60dd1f364f46916eadba460284 /tools/perf/builtin-trace.c | |
parent | 2acad19500c28ce0c4dc3f9bf1dcfc82040b6531 (diff) | |
download | blackbird-obmc-linux-b15d0a4c828eafc82ea68fcf88db6fa93eeb23d7.tar.gz blackbird-obmc-linux-b15d0a4c828eafc82ea68fcf88db6fa93eeb23d7.zip |
perf tools: Make perf_evsel__append_filter() generic
By making function perf_evsel__append_filter() take a format rather than
an operator it is possible to reuse the code for other purposes (ex.
Intel PT and CoreSight) than tracepoints.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 1a54ce9d101c..e04ba9d852d4 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2143,6 +2143,7 @@ out_delete_sys_enter: static int trace__set_ev_qualifier_filter(struct trace *trace) { int err = -1; + struct perf_evsel *sys_exit; char *filter = asprintf_expr_inout_ints("id", !trace->not_ev_qualifier, trace->ev_qualifier_ids.nr, trace->ev_qualifier_ids.entries); @@ -2150,8 +2151,12 @@ static int trace__set_ev_qualifier_filter(struct trace *trace) if (filter == NULL) goto out_enomem; - if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter, "&&", filter)) - err = perf_evsel__append_filter(trace->syscalls.events.sys_exit, "&&", filter); + if (!perf_evsel__append_filter(trace->syscalls.events.sys_enter, + "(%s) && (%s)", filter)) { + sys_exit = trace->syscalls.events.sys_exit; + err = perf_evsel__append_filter(sys_exit, + "(%s) && (%s)", filter); + } free(filter); out: |