perf tools: Add map_groups to 'struct addr_location'
A message that is not in the archive (sent off-list or not yet received): [email protected]
The following commit has been merged into the perf/core branch of tip:
Commit-ID: d3a022cbdce6f361b1effbff1eb18546690592c8 Gitweb: https://git.kernel.org/tip/d3a022cbdce6f361b1effbff1eb18546690592c8 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Mon, 04 Nov 2019 09:59:48 -03:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Tue, 12 Nov 2019 08:20:53 -03:00
perf tools: Add map_groups to 'struct addr_location'
Quoted 1 line
From there we can get
al->mg->machine, so replace that field with the
more useful 'struct map_groups' that for now we're obtaining from al->map->groups, and that is one thing getting into the way of maps being fully shareable.
Cc Adrian Hunter <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/callchain.c | 6 ++--- tools/perf/util/db-export.c | 12 ++++----- tools/perf/util/event.c | 6 ++--- tools/perf/util/scripting-engines/trace-event-python.c | 2 +- tools/perf/util/symbol.h | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-)
tools/perf/util/callchain.c +3 -3
@@ -1119,8 +1119,8 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node * goto out; } -if (al->map->groups == &al->machine->kmaps) { -if (machine__is_host (al->machine)) { +if (al->mg == &al->mg->machine->kmaps) { +if (machine__is_host (al->mg->machine)) { al->cpumode =PERF_RECORD_MISC_KERNEL ; al->level ='k' ; }else {
@@ -1128,7 +1128,7 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node * al->level ='g' ; } }else { -if (machine__is_host (al->machine)) { +if (machine__is_host (al->mg->machine)) { al->cpumode =PERF_RECORD_MISC_USER ; al->level ='.' ; }else if (perf_guest) {
tools/perf/util/db-export.c +6 -6
@@ -181,7 +181,7 @@ static int db_ids_from_al(struct db_export *dbe, struct addr_location *al,if (al->map) {struct dso *dso = al->map->dso; - err =db_export__dso (dbe, dso, al->machine); + err =db_export__dso (dbe, dso, al->mg->machine);if (err)return err; *dso_db_id = dso->db_id;
@@ -251,7 +251,7 @@ static struct call_path *call_path_from_sample(struct db_export *dbe,*/ al.sym = node->sym; al.map = node->map; - al.machine = machine; + al.mg = thread->mg; al.addr = node->ip;if (al.map && !al.sym)
@@ -360,13 +360,13 @@ int db_export__sample(struct db_export *dbe, union perf_event *event,if (err)return err; - err =db_export__machine (dbe, al->machine); + err =db_export__machine (dbe, al->mg->machine);if (err)return err; - main_thread =thread__main_thread (al->machine, thread); + main_thread =thread__main_thread (al->mg->machine, thread); - err =db_export__threads (dbe, thread, main_thread, al->machine, &comm); + err =db_export__threads (dbe, thread, main_thread, al->mg->machine, &comm);if (err) goto out_put;
@@ -380,7 +380,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, goto out_put;if (dbe->cpr) { -struct call_path *cp =call_path_from_sample (dbe, al->machine, +struct call_path *cp =call_path_from_sample (dbe, al->mg->machine, thread, sample, evsel);if (cp) {
tools/perf/util/event.c +3 -3
@@ -461,7 +461,7 @@ struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,struct machine *machine = mg->machine;bool load_map = false; - al->machine = machine; + al->mg = mg; al->thread = thread; al->addr = addr; al->cpumode = cpumode;
@@ -474,13 +474,13 @@ struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,if (cpumode ==PERF_RECORD_MISC_KERNEL && perf_host) { al->level ='k' ; - mg = &machine->kmaps; + al->mg = mg = &machine->kmaps; load_map = true; }else if (cpumode ==PERF_RECORD_MISC_USER && perf_host) { al->level ='.' ; }else if (cpumode ==PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) { al->level ='g' ; - mg = &machine->kmaps; + al->mg = mg = &machine->kmaps; load_map = true; }else if (cpumode ==PERF_RECORD_MISC_GUEST_USER && perf_guest) { al->level ='u' ;
tools/perf/util/scripting-engines/trace-event-python.c +1 -1
@@ -1127,7 +1127,7 @@ static void python_export_sample_table(struct db_export *dbe,tuple_set_u64 (t,0 , es->db_id);tuple_set_u64 (t,1 , es->evsel->db_id); -tuple_set_u64 (t,2 , es->al->machine->db_id); +tuple_set_u64 (t,2 , es->al->mg->machine->db_id);tuple_set_u64 (t,3 , es->al->thread->db_id);tuple_set_u64 (t,4 , es->comm_db_id);tuple_set_u64 (t,5 , es->dso_db_id);
tools/perf/util/symbol.h +1 -1
@@ -107,8 +107,8 @@ struct ref_reloc_sym { };struct addr_location { -struct machine *machine;struct thread *thread; +struct map_groups *mg;struct map *map;struct symbol *sym;const char *srcline;