@@ -95,6 +95,7 @@ struct perf_c2c {
95
95
bool use_stdio ;
96
96
bool stats_only ;
97
97
bool symbol_full ;
98
+ bool stitch_lbr ;
98
99
99
100
/* HITM shared clines stats */
100
101
struct c2c_stats hitm_stats ;
@@ -273,6 +274,9 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
273
274
return -1 ;
274
275
}
275
276
277
+ if (c2c .stitch_lbr )
278
+ al .thread -> lbr_stitch_enable = true;
279
+
276
280
ret = sample__resolve_callchain (sample , & callchain_cursor , NULL ,
277
281
evsel , & al , sysctl_perf_event_max_stack );
278
282
if (ret )
@@ -2601,6 +2605,12 @@ static int setup_callchain(struct evlist *evlist)
2601
2605
}
2602
2606
}
2603
2607
2608
+ if (c2c .stitch_lbr && (mode != CALLCHAIN_LBR )) {
2609
+ ui__warning ("Can't find LBR callchain. Switch off --stitch-lbr.\n"
2610
+ "Please apply --call-graph lbr when recording.\n" );
2611
+ c2c .stitch_lbr = false;
2612
+ }
2613
+
2604
2614
callchain_param .record_mode = mode ;
2605
2615
callchain_param .min_percent = 0 ;
2606
2616
return 0 ;
@@ -2752,6 +2762,8 @@ static int perf_c2c__report(int argc, const char **argv)
2752
2762
OPT_STRING ('c' , "coalesce" , & coalesce , "coalesce fields" ,
2753
2763
"coalesce fields: pid,tid,iaddr,dso" ),
2754
2764
OPT_BOOLEAN ('f' , "force" , & symbol_conf .force , "don't complain, do it" ),
2765
+ OPT_BOOLEAN (0 , "stitch-lbr" , & c2c .stitch_lbr ,
2766
+ "Enable LBR callgraph stitching approach" ),
2755
2767
OPT_PARENT (c2c_options ),
2756
2768
OPT_END ()
2757
2769
};
0 commit comments