@@ -209,7 +209,7 @@ static int __symbol__account_cycles(struct cyc_hist *ch,
209
209
}
210
210
211
211
static 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 ,
213
213
struct perf_sample * sample )
214
214
{
215
215
struct symbol * sym = ms -> sym ;
@@ -228,14 +228,14 @@ static int __symbol__inc_addr_samples(struct map_symbol *ms,
228
228
}
229
229
230
230
offset = addr - sym -> start ;
231
- h = annotated_source__histogram (src , evidx );
231
+ h = annotated_source__histogram (src , evsel );
232
232
if (h == NULL ) {
233
233
pr_debug ("%s(%d): ENOMEM! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 ", func: %d\n" ,
234
234
__func__ , __LINE__ , sym -> name , sym -> start , addr , sym -> end , sym -> type == STT_FUNC );
235
235
return - ENOMEM ;
236
236
}
237
237
238
- hash_key = offset << 16 | evidx ;
238
+ hash_key = offset << 16 | evsel -> core . idx ;
239
239
if (!hashmap__find (src -> samples , hash_key , & entry )) {
240
240
entry = zalloc (sizeof (* entry ));
241
241
if (entry == NULL )
@@ -252,7 +252,7 @@ static int __symbol__inc_addr_samples(struct map_symbol *ms,
252
252
253
253
pr_debug3 ("%#" PRIx64 " %s: period++ [addr: %#" PRIx64 ", %#" PRIx64
254
254
", 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 ,
256
256
entry -> nr_samples , entry -> period );
257
257
return 0 ;
258
258
}
@@ -323,7 +323,7 @@ static int symbol__inc_addr_samples(struct map_symbol *ms,
323
323
if (sym == NULL )
324
324
return 0 ;
325
325
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 ;
327
327
}
328
328
329
329
static int symbol__account_br_cntr (struct annotated_branch * branch ,
@@ -861,15 +861,14 @@ static void calc_percent(struct annotation *notes,
861
861
s64 offset , s64 end )
862
862
{
863
863
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 );
866
865
unsigned int hits = 0 ;
867
866
u64 period = 0 ;
868
867
869
868
while (offset < end ) {
870
869
struct sym_hist_entry * entry ;
871
870
872
- entry = annotated_source__hist_entry (notes -> src , evidx , offset );
871
+ entry = annotated_source__hist_entry (notes -> src , evsel , offset );
873
872
if (entry ) {
874
873
hits += entry -> nr_samples ;
875
874
period += entry -> period ;
@@ -1140,15 +1139,14 @@ static void print_summary(struct rb_root *root, const char *filename)
1140
1139
1141
1140
static void symbol__annotate_hits (struct symbol * sym , struct evsel * evsel )
1142
1141
{
1143
- int evidx = evsel -> core .idx ;
1144
1142
struct annotation * notes = symbol__annotation (sym );
1145
- struct sym_hist * h = annotation__histogram (notes , evidx );
1143
+ struct sym_hist * h = annotation__histogram (notes , evsel );
1146
1144
u64 len = symbol__size (sym ), offset ;
1147
1145
1148
1146
for (offset = 0 ; offset < len ; ++ offset ) {
1149
1147
struct sym_hist_entry * entry ;
1150
1148
1151
- entry = annotated_source__hist_entry (notes -> src , evidx , offset );
1149
+ entry = annotated_source__hist_entry (notes -> src , evsel , offset );
1152
1150
if (entry && entry -> nr_samples != 0 )
1153
1151
printf ("%*" PRIx64 ": %" PRIu64 "\n" , BITS_PER_LONG / 2 ,
1154
1152
sym -> start + offset , entry -> nr_samples );
@@ -1178,7 +1176,7 @@ int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel)
1178
1176
const char * d_filename ;
1179
1177
const char * evsel_name = evsel__name (evsel );
1180
1178
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 );
1182
1180
struct annotation_line * pos , * queue = NULL ;
1183
1181
struct annotation_options * opts = & annotate_opts ;
1184
1182
u64 start = map__rip_2objdump (map , sym -> start );
@@ -1364,18 +1362,18 @@ int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel)
1364
1362
return err ;
1365
1363
}
1366
1364
1367
- void symbol__annotate_zero_histogram (struct symbol * sym , int evidx )
1365
+ void symbol__annotate_zero_histogram (struct symbol * sym , struct evsel * evsel )
1368
1366
{
1369
1367
struct annotation * notes = symbol__annotation (sym );
1370
- struct sym_hist * h = annotation__histogram (notes , evidx );
1368
+ struct sym_hist * h = annotation__histogram (notes , evsel );
1371
1369
1372
1370
memset (h , 0 , sizeof (* notes -> src -> histograms ) * notes -> src -> nr_histograms );
1373
1371
}
1374
1372
1375
- void symbol__annotate_decay_histogram (struct symbol * sym , int evidx )
1373
+ void symbol__annotate_decay_histogram (struct symbol * sym , struct evsel * evsel )
1376
1374
{
1377
1375
struct annotation * notes = symbol__annotation (sym );
1378
- struct sym_hist * h = annotation__histogram (notes , evidx );
1376
+ struct sym_hist * h = annotation__histogram (notes , evsel );
1379
1377
struct annotation_line * al ;
1380
1378
1381
1379
h -> nr_samples = 0 ;
@@ -1385,7 +1383,7 @@ void symbol__annotate_decay_histogram(struct symbol *sym, int evidx)
1385
1383
if (al -> offset == -1 )
1386
1384
continue ;
1387
1385
1388
- entry = annotated_source__hist_entry (notes -> src , evidx , al -> offset );
1386
+ entry = annotated_source__hist_entry (notes -> src , evsel , al -> offset );
1389
1387
if (entry == NULL )
1390
1388
continue ;
1391
1389
0 commit comments