From 9b0d2d875d57d85fdfb35ac27f89951520a8b473 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Tue, 22 Jul 2014 16:17:39 +0300 Subject: perf tools: Expose 'addr' functions so they can be reused Move some functions and functionality related to the use of 'addr' out of builtin-script so they can be reused. The moved functions are: is_bts_event() and sample_addr_correlates_sym() and a new function perf_event__preprocess_sample_addr() is created from bits of print_sample_addr(). perf_event__preprocess_sample_addr() is the equivalent of perf_event__preprocess_sample() but for 'addr' instead of 'ip'. Signed-off-by: Adrian Hunter Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1406035081-14301-31-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/event.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/perf/util/event.h') diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index e5dd40addb30..94d6976180da 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -288,6 +288,16 @@ int perf_event__preprocess_sample(const union perf_event *event, struct addr_location *al, struct perf_sample *sample); +struct thread; + +bool is_bts_event(struct perf_event_attr *attr); +bool sample_addr_correlates_sym(struct perf_event_attr *attr); +void perf_event__preprocess_sample_addr(union perf_event *event, + struct perf_sample *sample, + struct machine *machine, + struct thread *thread, + struct addr_location *al); + const char *perf_event__name(unsigned int id); size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, -- cgit v1.2.3