perf evsel: Introduce set_filter method

Replaces existing filter string with the one provided.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-jst49z83li0yx3g18o54u51a@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo
2015-07-03 17:05:50 -03:00
parent f47805a2af
commit 12467ae4e3
3 changed files with 15 additions and 2 deletions

View File

@@ -1177,8 +1177,7 @@ int parse_filter(const struct option *opt, const char *str,
return -1;
}
last->filter = strdup(str);
if (last->filter == NULL) {
if (perf_evsel__set_filter(last, str) < 0) {
fprintf(stderr, "not enough memory to hold filter string\n");
return -1;
}