Re: [PATCH V6 17/17] perf tools: choose to dump callchain from LBR and FP

From: Jiri Olsa
Date: Fri Oct 24 2014 - 09:36:20 EST


On Sun, Oct 19, 2014 at 05:55:12PM -0400, Kan Liang wrote:

SNIP

> - return 0;
> - }
> - continue;
> + mix_chain_nr = i + 2 + lbr_nr;
> + if (mix_chain_nr > PERF_MAX_STACK_DEPTH) {
> + pr_warning("corrupted callchain. skipping...\n");
> + return 0;
> }
>
> - al.filtered = 0;
> - thread__find_addr_location(thread, machine, cpumode,
> - MAP__FUNCTION, ip, &al);
> - if (al.sym != NULL) {
> - if (sort__has_parent && !*parent &&
> - symbol__match_regex(al.sym, &parent_regex))
> - *parent = al.sym;
> - else if (have_ignore_callees && root_al &&
> - symbol__match_regex(al.sym, &ignore_callees_regex)) {
> - /* Treat this symbol as the root,
> - forgetting its callees. */
> - *root_al = al;
> - callchain_cursor_reset(&callchain_cursor);
> + for (j = 0; j < mix_chain_nr; j++) {
> + struct addr_location al;
> +
> + if (callchain_param.order == ORDER_CALLEE) {
> + if (j < i + 2)
> + ip = chain->ips[j];
> + else
> + ip = lbr_stack->entries[j - i - 2].from;
> + } else {
> + if (j < lbr_nr)
> + ip = lbr_stack->entries[lbr_nr - j - 1].from;
> + else
> + ip = chain->ips[i + 1 - (j - lbr_nr)];
> }
> + err = __machine__resolve_callchain_sample(machine,
> + thread, ip, &cpumode, parent, root_al, &al);
> + /* Discard all when the callchain is corrupted */
> + if (err > 0)
> + return 0;
> + else if (err)
> + return err;

so you print FP callchains followed by LBR stack data, right?

but AFAICS from kernel changes the FP callchains and LBR callchains
data are unrelated.. 2 datasources of the same information

do we rather want to print them separately? or using an option
as Andi did in his lbr-as-callgraph patchset:
http://marc.info/?l=linux-kernel&m=141177467802602&w=2

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/