On Mon, Jan 13, 2014 at 05:04:17PM -0800, Andi Kleen wrote:
> From: Andi Kleen <a...@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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to