Re: [PATCH V3 15/17] perf top: Add option to enable the LBR stitching approach

From: Jiri Olsa
Date: Wed Mar 18 2020 - 08:14:21 EST


On Fri, Mar 13, 2020 at 11:33:17AM -0700, kan.liang@xxxxxxxxxxxxxxx wrote:

SNIP

> #include "util/top.h"
> @@ -766,6 +767,9 @@ static void perf_event__process_sample(struct perf_tool *tool,
> if (machine__resolve(machine, &al, sample) < 0)
> return;
>
> + if (top->stitch_lbr)
> + al.thread->lbr_stitch_enable = true;
> +
> if (!machine->kptr_restrict_warned &&
> symbol_conf.kptr_restrict &&
> al.cpumode == PERF_RECORD_MISC_KERNEL) {
> @@ -1543,6 +1547,8 @@ int cmd_top(int argc, const char **argv)
> "number of thread to run event synthesize"),
> OPT_BOOLEAN(0, "namespaces", &opts->record_namespaces,
> "Record namespaces events"),
> + OPT_BOOLEAN(0, "stitch-lbr", &top.stitch_lbr,
> + "Enable LBR callgraph stitching approach"),
> OPTS_EVSWITCH(&top.evswitch),
> OPT_END()
> };
> @@ -1612,6 +1618,11 @@ int cmd_top(int argc, const char **argv)
> }
> }
>
> + if (top.stitch_lbr && !(callchain_param.record_mode == CALLCHAIN_LBR)) {
> + pr_err("Error: --stitch-lbr must be used with --call-graph lbr\n");
> + goto out_delete_evlist;
> + }

why is this check not added for script/report/c2c..?

jirka