@@ -84,6 +84,7 @@ struct report {
84
84
bool header_only ;
85
85
bool nonany_branch_mode ;
86
86
bool group_set ;
87
+ bool stitch_lbr ;
87
88
int max_stack ;
88
89
struct perf_read_values show_threads_values ;
89
90
struct annotation_options annotation_opts ;
@@ -267,6 +268,9 @@ static int process_sample_event(struct perf_tool *tool,
267
268
return -1 ;
268
269
}
269
270
271
+ if (rep -> stitch_lbr )
272
+ al .thread -> lbr_stitch_enable = true;
273
+
270
274
if (symbol_conf .hide_unresolved && al .sym == NULL )
271
275
goto out_put ;
272
276
@@ -408,6 +412,12 @@ static int report__setup_sample_type(struct report *rep)
408
412
callchain_param .record_mode = CALLCHAIN_FP ;
409
413
}
410
414
415
+ if (rep -> stitch_lbr && (callchain_param .record_mode != CALLCHAIN_LBR )) {
416
+ ui__warning ("Can't find LBR callchain. Switch off --stitch-lbr.\n"
417
+ "Please apply --call-graph lbr when recording.\n" );
418
+ rep -> stitch_lbr = false;
419
+ }
420
+
411
421
/* ??? handle more cases than just ANY? */
412
422
if (!(perf_evlist__combined_branch_type (session -> evlist ) &
413
423
PERF_SAMPLE_BRANCH_ANY ))
@@ -1258,6 +1268,8 @@ int cmd_report(int argc, const char **argv)
1258
1268
"Show full source file name path for source lines" ),
1259
1269
OPT_BOOLEAN (0 , "show-ref-call-graph" , & symbol_conf .show_ref_callgraph ,
1260
1270
"Show callgraph from reference event" ),
1271
+ OPT_BOOLEAN (0 , "stitch-lbr" , & report .stitch_lbr ,
1272
+ "Enable LBR callgraph stitching approach" ),
1261
1273
OPT_INTEGER (0 , "socket-filter" , & report .socket_filter ,
1262
1274
"only show processor socket that match with this filter" ),
1263
1275
OPT_BOOLEAN (0 , "raw-trace" , & symbol_conf .raw_trace ,
0 commit comments