perf thread: Rename perf_event__preprocess_sample_addr to thread__resolve

Since none of the perf_event fields are used anymore, just the
perf_sample ones, and since this resolves to (map, symbol) from data
structures within struct thread, rename it to thread__resolve and make
the argument ordering similar to the one in machine__resolve().

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2b33hs9bp550tezzlhl4kejh@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent bb3eb566
...@@ -537,7 +537,7 @@ static void print_sample_brstacksym(union perf_event *event __maybe_unused, ...@@ -537,7 +537,7 @@ static void print_sample_brstacksym(union perf_event *event __maybe_unused,
} }
static void print_sample_addr(union perf_event *event, static void print_sample_addr(union perf_event *event __maybe_unused,
struct perf_sample *sample, struct perf_sample *sample,
struct thread *thread, struct thread *thread,
struct perf_event_attr *attr) struct perf_event_attr *attr)
...@@ -549,7 +549,7 @@ static void print_sample_addr(union perf_event *event, ...@@ -549,7 +549,7 @@ static void print_sample_addr(union perf_event *event,
if (!sample_addr_correlates_sym(attr)) if (!sample_addr_correlates_sym(attr))
return; return;
perf_event__preprocess_sample_addr(event, sample, thread, &al); thread__resolve(thread, &al, sample);
if (PRINT_FIELD(SYM)) { if (PRINT_FIELD(SYM)) {
printf(" "); printf(" ");
......
...@@ -333,7 +333,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, ...@@ -333,7 +333,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event,
sample_addr_correlates_sym(&evsel->attr)) { sample_addr_correlates_sym(&evsel->attr)) {
struct addr_location addr_al; struct addr_location addr_al;
perf_event__preprocess_sample_addr(event, sample, thread, &addr_al); thread__resolve(thread, &addr_al, sample);
err = db_ids_from_al(dbe, &addr_al, &es.addr_dso_db_id, err = db_ids_from_al(dbe, &addr_al, &es.addr_dso_db_id,
&es.addr_sym_db_id, &es.addr_offset); &es.addr_sym_db_id, &es.addr_offset);
if (err) if (err)
......
...@@ -1392,10 +1392,8 @@ bool sample_addr_correlates_sym(struct perf_event_attr *attr) ...@@ -1392,10 +1392,8 @@ bool sample_addr_correlates_sym(struct perf_event_attr *attr)
return false; return false;
} }
void perf_event__preprocess_sample_addr(union perf_event *event __maybe_unused, void thread__resolve(struct thread *thread, struct addr_location *al,
struct perf_sample *sample, struct perf_sample *sample)
struct thread *thread,
struct addr_location *al)
{ {
thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, sample->addr, al); thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, sample->addr, al);
if (!al->map) if (!al->map)
......
...@@ -607,10 +607,8 @@ struct thread; ...@@ -607,10 +607,8 @@ struct thread;
bool is_bts_event(struct perf_event_attr *attr); bool is_bts_event(struct perf_event_attr *attr);
bool sample_addr_correlates_sym(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, void thread__resolve(struct thread *thread, struct addr_location *al,
struct perf_sample *sample, struct perf_sample *sample);
struct thread *thread,
struct addr_location *al);
const char *perf_event__name(unsigned int id); const char *perf_event__name(unsigned int id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment