if (perf_evsel__is_group_event(evsel))
nr = evsel->nr_members;
- size += sizeof(al->samples[0]) * nr;
+ size += sizeof(al->data[0]) * nr;
al = zalloc(size);
if (al) {
al->offset = args->offset;
al->line = strdup(args->line);
al->line_nr = args->line_nr;
- al->samples_nr = nr;
+ al->data_nr = nr;
}
return al;
const char *color;
struct annotation *notes = symbol__annotation(sym);
- for (i = 0; i < al->samples_nr; i++) {
- struct annotation_data *sample = &al->samples[i];
+ for (i = 0; i < al->data_nr; i++) {
+ struct annotation_data *sample = &al->data[i];
if (sample->percent > max_percent)
max_percent = sample->percent;
}
- if (al->samples_nr > nr_percent)
- nr_percent = al->samples_nr;
+ if (al->data_nr > nr_percent)
+ nr_percent = al->data_nr;
if (max_percent < min_pcnt)
return -1;
}
for (i = 0; i < nr_percent; i++) {
- struct annotation_data *sample = &al->samples[i];
+ struct annotation_data *sample = &al->data[i];
color = get_percent_color(sample->percent);
next = annotation_line__next(al, ¬es->src->source);
end = next ? next->offset : len;
- for (i = 0; i < al->samples_nr; i++) {
+ for (i = 0; i < al->data_nr; i++) {
struct annotation_data *sample;
struct sym_hist *hist;
hist = annotation__histogram(notes, evsel->idx + i);
- sample = &al->samples[i];
+ sample = &al->data[i];
calc_percent(hist, sample, al->offset, end);
}
ret = strcmp(iter->path, al->path);
if (ret == 0) {
- for (i = 0; i < al->samples_nr; i++)
- iter->samples[i].percent_sum += al->samples[i].percent;
+ for (i = 0; i < al->data_nr; i++)
+ iter->data[i].percent_sum += al->data[i].percent;
return;
}
p = &(*p)->rb_right;
}
- for (i = 0; i < al->samples_nr; i++)
- al->samples[i].percent_sum = al->samples[i].percent;
+ for (i = 0; i < al->data_nr; i++)
+ al->data[i].percent_sum = al->data[i].percent;
rb_link_node(&al->rb_node, parent, p);
rb_insert_color(&al->rb_node, root);
{
int i;
- for (i = 0; i < a->samples_nr; i++) {
- if (a->samples[i].percent_sum == b->samples[i].percent_sum)
+ for (i = 0; i < a->data_nr; i++) {
+ if (a->data[i].percent_sum == b->data[i].percent_sum)
continue;
- return a->samples[i].percent_sum > b->samples[i].percent_sum;
+ return a->data[i].percent_sum > b->data[i].percent_sum;
}
return 0;
int i;
al = rb_entry(node, struct annotation_line, rb_node);
- for (i = 0; i < al->samples_nr; i++) {
- percent = al->samples[i].percent_sum;
+ for (i = 0; i < al->data_nr; i++) {
+ percent = al->data[i].percent_sum;
color = get_percent_color(percent);
color_fprintf(stdout, color, " %7.2f", percent);
double percent_max = 0.0;
int i;
- for (i = 0; i < al->samples_nr; i++) {
+ for (i = 0; i < al->data_nr; i++) {
struct annotation_data *sample;
- sample = &al->samples[i];
+ sample = &al->data[i];
if (sample->percent > percent_max)
percent_max = sample->percent;
int i;
for (i = 0; i < notes->nr_events; i++) {
- if (al->samples[i].percent > percent_max)
- percent_max = al->samples[i].percent;
+ if (al->data[i].percent > percent_max)
+ percent_max = al->data[i].percent;
}
return percent_max;
int i;
for (i = 0; i < notes->nr_events; i++) {
- obj__set_percent_color(obj, al->samples[i].percent, current_entry);
+ obj__set_percent_color(obj, al->data[i].percent, current_entry);
if (notes->options->show_total_period) {
- obj__printf(obj, "%11" PRIu64 " ", al->samples[i].he.period);
+ obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period);
} else if (notes->options->show_nr_samples) {
obj__printf(obj, "%6" PRIu64 " ",
- al->samples[i].he.nr_samples);
+ al->data[i].he.nr_samples);
} else {
obj__printf(obj, "%6.2f ",
- al->samples[i].percent);
+ al->data[i].percent);
}
}
} else {