@@ -209,7 +209,7 @@ static int __symbol__account_cycles(struct cyc_hist *ch,
209209}
210210
211211static int __symbol__inc_addr_samples (struct map_symbol * ms ,
212- struct annotated_source * src , int evidx , u64 addr ,
212+ struct annotated_source * src , struct evsel * evsel , u64 addr ,
213213 struct perf_sample * sample )
214214{
215215 struct symbol * sym = ms -> sym ;
@@ -228,14 +228,14 @@ static int __symbol__inc_addr_samples(struct map_symbol *ms,
228228 }
229229
230230 offset = addr - sym -> start ;
231- h = annotated_source__histogram (src , evidx );
231+ h = annotated_source__histogram (src , evsel );
232232 if (h == NULL ) {
233233 pr_debug ("%s(%d): ENOMEM! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 ", func: %d\n" ,
234234 __func__ , __LINE__ , sym -> name , sym -> start , addr , sym -> end , sym -> type == STT_FUNC );
235235 return - ENOMEM ;
236236 }
237237
238- hash_key = offset << 16 | evidx ;
238+ hash_key = offset << 16 | evsel -> core . idx ;
239239 if (!hashmap__find (src -> samples , hash_key , & entry )) {
240240 entry = zalloc (sizeof (* entry ));
241241 if (entry == NULL )
@@ -252,7 +252,7 @@ static int __symbol__inc_addr_samples(struct map_symbol *ms,
252252
253253 pr_debug3 ("%#" PRIx64 " %s: period++ [addr: %#" PRIx64 ", %#" PRIx64
254254 ", evidx=%d] => nr_samples: %" PRIu64 ", period: %" PRIu64 "\n" ,
255- sym -> start , sym -> name , addr , addr - sym -> start , evidx ,
255+ sym -> start , sym -> name , addr , addr - sym -> start , evsel -> core . idx ,
256256 entry -> nr_samples , entry -> period );
257257 return 0 ;
258258}
@@ -323,7 +323,7 @@ static int symbol__inc_addr_samples(struct map_symbol *ms,
323323 if (sym == NULL )
324324 return 0 ;
325325 src = symbol__hists (sym , evsel -> evlist -> core .nr_entries );
326- return src ? __symbol__inc_addr_samples (ms , src , evsel -> core . idx , addr , sample ) : 0 ;
326+ return src ? __symbol__inc_addr_samples (ms , src , evsel , addr , sample ) : 0 ;
327327}
328328
329329static int symbol__account_br_cntr (struct annotated_branch * branch ,
@@ -861,15 +861,14 @@ static void calc_percent(struct annotation *notes,
861861 s64 offset , s64 end )
862862{
863863 struct hists * hists = evsel__hists (evsel );
864- int evidx = evsel -> core .idx ;
865- struct sym_hist * sym_hist = annotation__histogram (notes , evidx );
864+ struct sym_hist * sym_hist = annotation__histogram (notes , evsel );
866865 unsigned int hits = 0 ;
867866 u64 period = 0 ;
868867
869868 while (offset < end ) {
870869 struct sym_hist_entry * entry ;
871870
872- entry = annotated_source__hist_entry (notes -> src , evidx , offset );
871+ entry = annotated_source__hist_entry (notes -> src , evsel , offset );
873872 if (entry ) {
874873 hits += entry -> nr_samples ;
875874 period += entry -> period ;
@@ -1140,15 +1139,14 @@ static void print_summary(struct rb_root *root, const char *filename)
11401139
11411140static void symbol__annotate_hits (struct symbol * sym , struct evsel * evsel )
11421141{
1143- int evidx = evsel -> core .idx ;
11441142 struct annotation * notes = symbol__annotation (sym );
1145- struct sym_hist * h = annotation__histogram (notes , evidx );
1143+ struct sym_hist * h = annotation__histogram (notes , evsel );
11461144 u64 len = symbol__size (sym ), offset ;
11471145
11481146 for (offset = 0 ; offset < len ; ++ offset ) {
11491147 struct sym_hist_entry * entry ;
11501148
1151- entry = annotated_source__hist_entry (notes -> src , evidx , offset );
1149+ entry = annotated_source__hist_entry (notes -> src , evsel , offset );
11521150 if (entry && entry -> nr_samples != 0 )
11531151 printf ("%*" PRIx64 ": %" PRIu64 "\n" , BITS_PER_LONG / 2 ,
11541152 sym -> start + offset , entry -> nr_samples );
@@ -1178,7 +1176,7 @@ int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel)
11781176 const char * d_filename ;
11791177 const char * evsel_name = evsel__name (evsel );
11801178 struct annotation * notes = symbol__annotation (sym );
1181- struct sym_hist * h = annotation__histogram (notes , evsel -> core . idx );
1179+ struct sym_hist * h = annotation__histogram (notes , evsel );
11821180 struct annotation_line * pos , * queue = NULL ;
11831181 struct annotation_options * opts = & annotate_opts ;
11841182 u64 start = map__rip_2objdump (map , sym -> start );
@@ -1364,18 +1362,18 @@ int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel)
13641362 return err ;
13651363}
13661364
1367- void symbol__annotate_zero_histogram (struct symbol * sym , int evidx )
1365+ void symbol__annotate_zero_histogram (struct symbol * sym , struct evsel * evsel )
13681366{
13691367 struct annotation * notes = symbol__annotation (sym );
1370- struct sym_hist * h = annotation__histogram (notes , evidx );
1368+ struct sym_hist * h = annotation__histogram (notes , evsel );
13711369
13721370 memset (h , 0 , sizeof (* notes -> src -> histograms ) * notes -> src -> nr_histograms );
13731371}
13741372
1375- void symbol__annotate_decay_histogram (struct symbol * sym , int evidx )
1373+ void symbol__annotate_decay_histogram (struct symbol * sym , struct evsel * evsel )
13761374{
13771375 struct annotation * notes = symbol__annotation (sym );
1378- struct sym_hist * h = annotation__histogram (notes , evidx );
1376+ struct sym_hist * h = annotation__histogram (notes , evsel );
13791377 struct annotation_line * al ;
13801378
13811379 h -> nr_samples = 0 ;
@@ -1385,7 +1383,7 @@ void symbol__annotate_decay_histogram(struct symbol *sym, int evidx)
13851383 if (al -> offset == -1 )
13861384 continue ;
13871385
1388- entry = annotated_source__hist_entry (notes -> src , evidx , al -> offset );
1386+ entry = annotated_source__hist_entry (notes -> src , evsel , al -> offset );
13891387 if (entry == NULL )
13901388 continue ;
13911389
0 commit comments