@@ -2060,7 +2060,8 @@ static int add_callchain_ip(struct thread *thread,
2060
2060
bool branch ,
2061
2061
struct branch_flags * flags ,
2062
2062
struct iterations * iter ,
2063
- u64 branch_from )
2063
+ u64 branch_from ,
2064
+ bool symbols )
2064
2065
{
2065
2066
struct map_symbol ms = {};
2066
2067
struct addr_location al ;
@@ -2099,7 +2100,8 @@ static int add_callchain_ip(struct thread *thread,
2099
2100
}
2100
2101
goto out ;
2101
2102
}
2102
- thread__find_symbol (thread , * cpumode , ip , & al );
2103
+ if (symbols )
2104
+ thread__find_symbol (thread , * cpumode , ip , & al );
2103
2105
}
2104
2106
2105
2107
if (al .sym != NULL ) {
@@ -2228,7 +2230,8 @@ static int lbr_callchain_add_kernel_ip(struct thread *thread,
2228
2230
struct symbol * * parent ,
2229
2231
struct addr_location * root_al ,
2230
2232
u64 branch_from ,
2231
- bool callee , int end )
2233
+ bool callee , int end ,
2234
+ bool symbols )
2232
2235
{
2233
2236
struct ip_callchain * chain = sample -> callchain ;
2234
2237
u8 cpumode = PERF_RECORD_MISC_USER ;
@@ -2238,7 +2241,8 @@ static int lbr_callchain_add_kernel_ip(struct thread *thread,
2238
2241
for (i = 0 ; i < end + 1 ; i ++ ) {
2239
2242
err = add_callchain_ip (thread , cursor , parent ,
2240
2243
root_al , & cpumode , chain -> ips [i ],
2241
- false, NULL , NULL , branch_from );
2244
+ false, NULL , NULL , branch_from ,
2245
+ symbols );
2242
2246
if (err )
2243
2247
return err ;
2244
2248
}
@@ -2248,7 +2252,8 @@ static int lbr_callchain_add_kernel_ip(struct thread *thread,
2248
2252
for (i = end ; i >= 0 ; i -- ) {
2249
2253
err = add_callchain_ip (thread , cursor , parent ,
2250
2254
root_al , & cpumode , chain -> ips [i ],
2251
- false, NULL , NULL , branch_from );
2255
+ false, NULL , NULL , branch_from ,
2256
+ symbols );
2252
2257
if (err )
2253
2258
return err ;
2254
2259
}
@@ -2291,7 +2296,8 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
2291
2296
struct symbol * * parent ,
2292
2297
struct addr_location * root_al ,
2293
2298
u64 * branch_from ,
2294
- bool callee )
2299
+ bool callee ,
2300
+ bool symbols )
2295
2301
{
2296
2302
struct branch_stack * lbr_stack = sample -> branch_stack ;
2297
2303
struct branch_entry * entries = perf_sample__branch_entries (sample );
@@ -2324,7 +2330,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
2324
2330
err = add_callchain_ip (thread , cursor , parent ,
2325
2331
root_al , & cpumode , ip ,
2326
2332
true, flags , NULL ,
2327
- * branch_from );
2333
+ * branch_from , symbols );
2328
2334
if (err )
2329
2335
return err ;
2330
2336
@@ -2349,7 +2355,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
2349
2355
err = add_callchain_ip (thread , cursor , parent ,
2350
2356
root_al , & cpumode , ip ,
2351
2357
true, flags , NULL ,
2352
- * branch_from );
2358
+ * branch_from , symbols );
2353
2359
if (err )
2354
2360
return err ;
2355
2361
save_lbr_cursor_node (thread , cursor , i );
@@ -2364,7 +2370,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
2364
2370
err = add_callchain_ip (thread , cursor , parent ,
2365
2371
root_al , & cpumode , ip ,
2366
2372
true, flags , NULL ,
2367
- * branch_from );
2373
+ * branch_from , symbols );
2368
2374
if (err )
2369
2375
return err ;
2370
2376
save_lbr_cursor_node (thread , cursor , i );
@@ -2378,7 +2384,7 @@ static int lbr_callchain_add_lbr_ip(struct thread *thread,
2378
2384
err = add_callchain_ip (thread , cursor , parent ,
2379
2385
root_al , & cpumode , ip ,
2380
2386
true, flags , NULL ,
2381
- * branch_from );
2387
+ * branch_from , symbols );
2382
2388
if (err )
2383
2389
return err ;
2384
2390
}
@@ -2545,7 +2551,8 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
2545
2551
struct symbol * * parent ,
2546
2552
struct addr_location * root_al ,
2547
2553
int max_stack ,
2548
- unsigned int max_lbr )
2554
+ unsigned int max_lbr ,
2555
+ bool symbols )
2549
2556
{
2550
2557
bool callee = (callchain_param .order == ORDER_CALLEE );
2551
2558
struct ip_callchain * chain = sample -> callchain ;
@@ -2587,12 +2594,12 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
2587
2594
/* Add kernel ip */
2588
2595
err = lbr_callchain_add_kernel_ip (thread , cursor , sample ,
2589
2596
parent , root_al , branch_from ,
2590
- true, i );
2597
+ true, i , symbols );
2591
2598
if (err )
2592
2599
goto error ;
2593
2600
2594
2601
err = lbr_callchain_add_lbr_ip (thread , cursor , sample , parent ,
2595
- root_al , & branch_from , true);
2602
+ root_al , & branch_from , true, symbols );
2596
2603
if (err )
2597
2604
goto error ;
2598
2605
@@ -2609,14 +2616,14 @@ static int resolve_lbr_callchain_sample(struct thread *thread,
2609
2616
goto error ;
2610
2617
}
2611
2618
err = lbr_callchain_add_lbr_ip (thread , cursor , sample , parent ,
2612
- root_al , & branch_from , false);
2619
+ root_al , & branch_from , false, symbols );
2613
2620
if (err )
2614
2621
goto error ;
2615
2622
2616
2623
/* Add kernel ip */
2617
2624
err = lbr_callchain_add_kernel_ip (thread , cursor , sample ,
2618
2625
parent , root_al , branch_from ,
2619
- false, i );
2626
+ false, i , symbols );
2620
2627
if (err )
2621
2628
goto error ;
2622
2629
}
@@ -2630,7 +2637,7 @@ static int find_prev_cpumode(struct ip_callchain *chain, struct thread *thread,
2630
2637
struct callchain_cursor * cursor ,
2631
2638
struct symbol * * parent ,
2632
2639
struct addr_location * root_al ,
2633
- u8 * cpumode , int ent )
2640
+ u8 * cpumode , int ent , bool symbols )
2634
2641
{
2635
2642
int err = 0 ;
2636
2643
@@ -2640,7 +2647,7 @@ static int find_prev_cpumode(struct ip_callchain *chain, struct thread *thread,
2640
2647
if (ip >= PERF_CONTEXT_MAX ) {
2641
2648
err = add_callchain_ip (thread , cursor , parent ,
2642
2649
root_al , cpumode , ip ,
2643
- false, NULL , NULL , 0 );
2650
+ false, NULL , NULL , 0 , symbols );
2644
2651
break ;
2645
2652
}
2646
2653
}
@@ -2662,7 +2669,8 @@ static int thread__resolve_callchain_sample(struct thread *thread,
2662
2669
struct perf_sample * sample ,
2663
2670
struct symbol * * parent ,
2664
2671
struct addr_location * root_al ,
2665
- int max_stack )
2672
+ int max_stack ,
2673
+ bool symbols )
2666
2674
{
2667
2675
struct branch_stack * branch = sample -> branch_stack ;
2668
2676
struct branch_entry * entries = perf_sample__branch_entries (sample );
@@ -2682,7 +2690,8 @@ static int thread__resolve_callchain_sample(struct thread *thread,
2682
2690
2683
2691
err = resolve_lbr_callchain_sample (thread , cursor , sample , parent ,
2684
2692
root_al , max_stack ,
2685
- !env ? 0 : env -> max_branches );
2693
+ !env ? 0 : env -> max_branches ,
2694
+ symbols );
2686
2695
if (err )
2687
2696
return (err < 0 ) ? err : 0 ;
2688
2697
}
@@ -2747,13 +2756,14 @@ static int thread__resolve_callchain_sample(struct thread *thread,
2747
2756
root_al ,
2748
2757
NULL , be [i ].to ,
2749
2758
true, & be [i ].flags ,
2750
- NULL , be [i ].from );
2759
+ NULL , be [i ].from , symbols );
2751
2760
2752
- if (!err )
2761
+ if (!err ) {
2753
2762
err = add_callchain_ip (thread , cursor , parent , root_al ,
2754
2763
NULL , be [i ].from ,
2755
2764
true, & be [i ].flags ,
2756
- & iter [i ], 0 );
2765
+ & iter [i ], 0 , symbols );
2766
+ }
2757
2767
if (err == - EINVAL )
2758
2768
break ;
2759
2769
if (err )
@@ -2769,7 +2779,7 @@ static int thread__resolve_callchain_sample(struct thread *thread,
2769
2779
check_calls :
2770
2780
if (chain && callchain_param .order != ORDER_CALLEE ) {
2771
2781
err = find_prev_cpumode (chain , thread , cursor , parent , root_al ,
2772
- & cpumode , chain -> nr - first_call );
2782
+ & cpumode , chain -> nr - first_call , symbols );
2773
2783
if (err )
2774
2784
return (err < 0 ) ? err : 0 ;
2775
2785
}
@@ -2791,7 +2801,7 @@ static int thread__resolve_callchain_sample(struct thread *thread,
2791
2801
++ nr_entries ;
2792
2802
else if (callchain_param .order != ORDER_CALLEE ) {
2793
2803
err = find_prev_cpumode (chain , thread , cursor , parent ,
2794
- root_al , & cpumode , j );
2804
+ root_al , & cpumode , j , symbols );
2795
2805
if (err )
2796
2806
return (err < 0 ) ? err : 0 ;
2797
2807
continue ;
@@ -2818,16 +2828,16 @@ static int thread__resolve_callchain_sample(struct thread *thread,
2818
2828
if (leaf_frame_caller && leaf_frame_caller != ip ) {
2819
2829
2820
2830
err = add_callchain_ip (thread , cursor , parent ,
2821
- root_al , & cpumode , leaf_frame_caller ,
2822
- false, NULL , NULL , 0 );
2831
+ root_al , & cpumode , leaf_frame_caller ,
2832
+ false, NULL , NULL , 0 , symbols );
2823
2833
if (err )
2824
2834
return (err < 0 ) ? err : 0 ;
2825
2835
}
2826
2836
}
2827
2837
2828
2838
err = add_callchain_ip (thread , cursor , parent ,
2829
2839
root_al , & cpumode , ip ,
2830
- false, NULL , NULL , 0 );
2840
+ false, NULL , NULL , 0 , symbols );
2831
2841
2832
2842
if (err )
2833
2843
return (err < 0 ) ? err : 0 ;
@@ -2907,7 +2917,7 @@ static int thread__resolve_callchain_unwind(struct thread *thread,
2907
2917
struct callchain_cursor * cursor ,
2908
2918
struct evsel * evsel ,
2909
2919
struct perf_sample * sample ,
2910
- int max_stack )
2920
+ int max_stack , bool symbols )
2911
2921
{
2912
2922
/* Can we do dwarf post unwind? */
2913
2923
if (!((evsel -> core .attr .sample_type & PERF_SAMPLE_REGS_USER ) &&
@@ -2919,17 +2929,21 @@ static int thread__resolve_callchain_unwind(struct thread *thread,
2919
2929
(!sample -> user_stack .size ))
2920
2930
return 0 ;
2921
2931
2932
+ if (!symbols )
2933
+ pr_debug ("Not resolving symbols with an unwinder isn't currently supported\n" );
2934
+
2922
2935
return unwind__get_entries (unwind_entry , cursor ,
2923
2936
thread , sample , max_stack , false);
2924
2937
}
2925
2938
2926
- int thread__resolve_callchain (struct thread * thread ,
2927
- struct callchain_cursor * cursor ,
2928
- struct evsel * evsel ,
2929
- struct perf_sample * sample ,
2930
- struct symbol * * parent ,
2931
- struct addr_location * root_al ,
2932
- int max_stack )
2939
+ int __thread__resolve_callchain (struct thread * thread ,
2940
+ struct callchain_cursor * cursor ,
2941
+ struct evsel * evsel ,
2942
+ struct perf_sample * sample ,
2943
+ struct symbol * * parent ,
2944
+ struct addr_location * root_al ,
2945
+ int max_stack ,
2946
+ bool symbols )
2933
2947
{
2934
2948
int ret = 0 ;
2935
2949
@@ -2942,22 +2956,22 @@ int thread__resolve_callchain(struct thread *thread,
2942
2956
ret = thread__resolve_callchain_sample (thread , cursor ,
2943
2957
evsel , sample ,
2944
2958
parent , root_al ,
2945
- max_stack );
2959
+ max_stack , symbols );
2946
2960
if (ret )
2947
2961
return ret ;
2948
2962
ret = thread__resolve_callchain_unwind (thread , cursor ,
2949
2963
evsel , sample ,
2950
- max_stack );
2964
+ max_stack , symbols );
2951
2965
} else {
2952
2966
ret = thread__resolve_callchain_unwind (thread , cursor ,
2953
2967
evsel , sample ,
2954
- max_stack );
2968
+ max_stack , symbols );
2955
2969
if (ret )
2956
2970
return ret ;
2957
2971
ret = thread__resolve_callchain_sample (thread , cursor ,
2958
2972
evsel , sample ,
2959
2973
parent , root_al ,
2960
- max_stack );
2974
+ max_stack , symbols );
2961
2975
}
2962
2976
2963
2977
return ret ;
0 commit comments