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>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
2acad19500
commit
b15d0a4c82
@@ -1767,7 +1767,7 @@ static int set_filter(struct perf_evsel *evsel, const void *arg)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (perf_evsel__append_filter(evsel, "&&", str) < 0) {
|
||||
if (perf_evsel__append_filter(evsel, "(%s) && (%s)", str) < 0) {
|
||||
fprintf(stderr,
|
||||
"not enough memory to hold filter string\n");
|
||||
return -1;
|
||||
@@ -1798,7 +1798,7 @@ static int add_exclude_perf_filter(struct perf_evsel *evsel,
|
||||
|
||||
snprintf(new_filter, sizeof(new_filter), "common_pid != %d", getpid());
|
||||
|
||||
if (perf_evsel__append_filter(evsel, "&&", new_filter) < 0) {
|
||||
if (perf_evsel__append_filter(evsel, "(%s) && (%s)", new_filter) < 0) {
|
||||
fprintf(stderr,
|
||||
"not enough memory to hold filter string\n");
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user