diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2021-06-27 16:18:10 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-07-01 16:14:37 -0300 |
commit | 9bde93a79a897719f829225d0b541b4b11af2c24 (patch) | |
tree | b8088b61a24ddb216715ea727e8380951a814c64 /tools/perf/Documentation | |
parent | 291961fc3c28b4c1acfc3b03559aa14c286a6b0d (diff) | |
download | linux-9bde93a79a897719f829225d0b541b4b11af2c24.tar.bz2 |
perf script: Add dlfilter__filter_event_early()
filter_event_early() can be more than 30% faster than filter_event()
because it is called before internal filtering. In other respects it
is the same as filter_event(), except that it will be passed events
that have yet to be filtered out.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210627131818.810-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Documentation')
-rw-r--r-- | tools/perf/Documentation/perf-dlfilter.txt | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/perf/Documentation/perf-dlfilter.txt b/tools/perf/Documentation/perf-dlfilter.txt index 15d5f4b01c97..aef1c32babd1 100644 --- a/tools/perf/Documentation/perf-dlfilter.txt +++ b/tools/perf/Documentation/perf-dlfilter.txt @@ -36,16 +36,17 @@ const struct perf_dlfilter_fns perf_dlfilter_fns; int start(void **data, void *ctx); int stop(void *data, void *ctx); int filter_event(void *data, const struct perf_dlfilter_sample *sample, void *ctx); +int filter_event_early(void *data, const struct perf_dlfilter_sample *sample, void *ctx); ---- If implemented, 'start' will be called at the beginning, before any -calls to 'filter_event' . Return 0 to indicate success, +calls to 'filter_event' or 'filter_event_early'. Return 0 to indicate success, or return a negative error code. '*data' can be assigned for use by other functions. 'ctx' is needed for calls to perf_dlfilter_fns, but most perf_dlfilter_fns are not valid when called from 'start'. If implemented, 'stop' will be called at the end, after any calls to -'filter_event'. Return 0 to indicate success, or +'filter_event' or 'filter_event_early'. Return 0 to indicate success, or return a negative error code. 'data' is set by 'start'. 'ctx' is needed for calls to perf_dlfilter_fns, but most perf_dlfilter_fns are not valid when called from 'stop'. @@ -55,10 +56,13 @@ Return 0 to keep the sample event, 1 to filter it out, or return a negative error code. 'data' is set by 'start'. 'ctx' is needed for calls to 'perf_dlfilter_fns'. +'filter_event_early' is the same as 'filter_event' except it is called before +internal filtering. + The perf_dlfilter_sample structure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -'filter_event' is passed a perf_dlfilter_sample +'filter_event' and 'filter_event_early' are passed a perf_dlfilter_sample structure, which contains the following fields: [source,c] ---- @@ -105,7 +109,8 @@ The perf_dlfilter_fns structure ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'perf_dlfilter_fns' structure is populated with function pointers when the -file is loaded. The functions can be called by 'filter_event'. +file is loaded. The functions can be called by 'filter_event' or +'filter_event_early'. [source,c] ---- |