Skip to content

Commit

Permalink
perf thread: Rename perf_event__preprocess_sample_addr to thread__res…
Browse files Browse the repository at this point in the history
…olve

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 <[email protected]>
Cc: Hemant Kumar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Naveen N. Rao <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Mar 23, 2016
1 parent bb3eb56 commit c2740a8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tools/perf/builtin-script.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 thread *thread,
struct perf_event_attr *attr)
Expand All @@ -549,7 +549,7 @@ static void print_sample_addr(union perf_event *event,
if (!sample_addr_correlates_sym(attr))
return;

perf_event__preprocess_sample_addr(event, sample, thread, &al);
thread__resolve(thread, &al, sample);

if (PRINT_FIELD(SYM)) {
printf(" ");
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/db-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event,
sample_addr_correlates_sym(&evsel->attr)) {
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,
&es.addr_sym_db_id, &es.addr_offset);
if (err)
Expand Down
6 changes: 2 additions & 4 deletions tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,10 +1392,8 @@ bool sample_addr_correlates_sym(struct perf_event_attr *attr)
return false;
}

void perf_event__preprocess_sample_addr(union perf_event *event __maybe_unused,
struct perf_sample *sample,
struct thread *thread,
struct addr_location *al)
void thread__resolve(struct thread *thread, struct addr_location *al,
struct perf_sample *sample)
{
thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, sample->addr, al);
if (!al->map)
Expand Down
6 changes: 2 additions & 4 deletions tools/perf/util/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,8 @@ 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 thread *thread,
struct addr_location *al);
void thread__resolve(struct thread *thread, struct addr_location *al,
struct perf_sample *sample);

const char *perf_event__name(unsigned int id);

Expand Down

0 comments on commit c2740a8

Please sign in to comment.