diff options
author | 2021-06-27 16:18:17 +0300 | |
---|---|---|
committer | 2021-07-01 16:14:38 -0300 | |
commit | 6495e762522d4cf73d0b339830091799881eb025 (patch) | |
tree | 5a9e6d602bafd6359194a84ed27adc46c6ae6f6c /tools/perf/util/dlfilter.c | |
parent | perf dlfilter: Add srcline() to perf_dlfilter_fns (diff) | |
download | linux-6495e762522d4cf73d0b339830091799881eb025.tar.gz linux-6495e762522d4cf73d0b339830091799881eb025.tar.bz2 linux-6495e762522d4cf73d0b339830091799881eb025.zip |
perf dlfilter: Add attr() to perf_dlfilter_fns
Add a function, for use by dlfilters, to return the perf_event_attr
structure.
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-10-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dlfilter.c')
-rw-r--r-- | tools/perf/util/dlfilter.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/dlfilter.c b/tools/perf/util/dlfilter.c index f4ce1a80bddc..e50d524906d6 100644 --- a/tools/perf/util/dlfilter.c +++ b/tools/perf/util/dlfilter.c @@ -235,6 +235,16 @@ static const char *dlfilter__srcline(void *ctx, __u32 *line_no) return srcfile; } +static struct perf_event_attr *dlfilter__attr(void *ctx) +{ + struct dlfilter *d = (struct dlfilter *)ctx; + + if (!d->ctx_valid) + return NULL; + + return &d->evsel->core.attr; +} + static const struct perf_dlfilter_fns perf_dlfilter_fns = { .resolve_ip = dlfilter__resolve_ip, .resolve_addr = dlfilter__resolve_addr, @@ -242,6 +252,7 @@ static const struct perf_dlfilter_fns perf_dlfilter_fns = { .resolve_address = dlfilter__resolve_address, .insn = dlfilter__insn, .srcline = dlfilter__srcline, + .attr = dlfilter__attr, }; static char *find_dlfilter(const char *file) |