Messages in this thread | | | Date | Wed, 15 Jan 2014 16:00:57 +0100 | From | Jiri Olsa <> | Subject | Re: [PATCH 2/6] perf, tools: Support handling complete branch stacks as histograms v3 |
| |
On Mon, Jan 13, 2014 at 05:04:17PM -0800, Andi Kleen wrote: > From: Andi Kleen <ak@linux.intel.com>
SNIP
> > int machine__init(struct machine *machine, const char *root_dir, pid_t pid) > { > @@ -1248,9 +1249,98 @@ struct branch_info *machine__resolve_bstack(struct machine *machine, > return bi; > } > > +static int add_callchain_ip(struct machine *machine, > + struct thread *thread, > + struct symbol **parent, > + struct addr_location *root_al, > + int cpumode, > + u64 ip) > +{ > + struct addr_location al; > + > + al.filtered = false; > + al.sym = NULL; > + if (cpumode == -1) { > + int i; > + > + for (i = 0; i < (int)NCPUMODES && !al.sym; i++) { > + /* > + * We cannot use the header.misc hint to determine whether a > + * branch stack address is user, kernel, guest, hypervisor. > + * Branches may straddle the kernel/user/hypervisor boundaries. > + * Thus, we have to try consecutively until we find a match > + * or else, the symbol is unknown > + */ > + thread__find_addr_location(thread, machine, cpumodes[i], > + MAP__FUNCTION, > + ip, &al); > + }
above code is already in ip__resolve_ams, maybe we could add put this into separate function like 'thread__find_addr_location_cpumodes'
jirka
| |