perf evlist: Make perf_evlist__set_filter use perf_evsel__set_filter
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 3 Jul 2015 20:42:03 +0000 (17:42 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 6 Jul 2015 13:46:36 +0000 (10:46 -0300)
commit94ad89bc8a61b79c416c180c51b3e61ac16f6124
tree873b6c26dbb010800c2f04e806126ab5588b50ec
parent12467ae4e37aab5e263cc9ab6b6909ae0588844c
perf evlist: Make perf_evlist__set_filter use perf_evsel__set_filter

Instead of calling perf_evsel__apply_filter straight away, so that
we can, in the next patches, expand the filter with more conditions
before actually calling the ioctl to pass the end result filter to
the kernel.

Now we need to call perf_evlist__apply_filters() after the filter
is completely setup, i.e. do the ioctl calls.

The perf_evlist__apply_filters() method was already in place, because
that is the model for the other tools that receives filters in the
command line: go on setting then in the evsel->filter and only at
the end, after parsing the whole command line, apply them.

We get, as a bonus, a more expressive message that states which
event, if any, failed to have the filter applied to, with an
error message stating what happened.

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-f429pgz75ryz7tpe6v74etre@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c
tools/perf/util/evlist.c