Commit 0440af74 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf annotate: Rename local sample variables to data

Based on previous rename, changing also the local variable names to fit
properly.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20180804130521.11408-6-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c2f938ba
...@@ -1310,10 +1310,10 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start ...@@ -1310,10 +1310,10 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start
struct annotation *notes = symbol__annotation(sym); struct annotation *notes = symbol__annotation(sym);
for (i = 0; i < al->data_nr; i++) { for (i = 0; i < al->data_nr; i++) {
struct annotation_data *sample = &al->data[i]; struct annotation_data *data = &al->data[i];
if (sample->percent > max_percent) if (data->percent > max_percent)
max_percent = sample->percent; max_percent = data->percent;
} }
if (al->data_nr > nr_percent) if (al->data_nr > nr_percent)
...@@ -1351,18 +1351,18 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start ...@@ -1351,18 +1351,18 @@ annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start
} }
for (i = 0; i < nr_percent; i++) { for (i = 0; i < nr_percent; i++) {
struct annotation_data *sample = &al->data[i]; struct annotation_data *data = &al->data[i];
color = get_percent_color(sample->percent); color = get_percent_color(data->percent);
if (symbol_conf.show_total_period) if (symbol_conf.show_total_period)
color_fprintf(stdout, color, " %11" PRIu64, color_fprintf(stdout, color, " %11" PRIu64,
sample->he.period); data->he.period);
else if (symbol_conf.show_nr_samples) else if (symbol_conf.show_nr_samples)
color_fprintf(stdout, color, " %7" PRIu64, color_fprintf(stdout, color, " %7" PRIu64,
sample->he.nr_samples); data->he.nr_samples);
else else
color_fprintf(stdout, color, " %7.2f", sample->percent); color_fprintf(stdout, color, " %7.2f", data->percent);
} }
printf(" : "); printf(" : ");
...@@ -1754,7 +1754,7 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) ...@@ -1754,7 +1754,7 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
} }
static void calc_percent(struct sym_hist *hist, static void calc_percent(struct sym_hist *hist,
struct annotation_data *sample, struct annotation_data *data,
s64 offset, s64 end) s64 offset, s64 end)
{ {
unsigned int hits = 0; unsigned int hits = 0;
...@@ -1767,9 +1767,9 @@ static void calc_percent(struct sym_hist *hist, ...@@ -1767,9 +1767,9 @@ static void calc_percent(struct sym_hist *hist,
} }
if (hist->nr_samples) { if (hist->nr_samples) {
sample->he.period = period; data->he.period = period;
sample->he.nr_samples = hits; data->he.nr_samples = hits;
sample->percent = 100.0 * hits / hist->nr_samples; data->percent = 100.0 * hits / hist->nr_samples;
} }
} }
...@@ -1789,13 +1789,13 @@ static void annotation__calc_percent(struct annotation *notes, ...@@ -1789,13 +1789,13 @@ static void annotation__calc_percent(struct annotation *notes,
end = next ? next->offset : len; end = next ? next->offset : len;
for (i = 0; i < al->data_nr; i++) { for (i = 0; i < al->data_nr; i++) {
struct annotation_data *sample; struct annotation_data *data;
struct sym_hist *hist; struct sym_hist *hist;
hist = annotation__histogram(notes, evsel->idx + i); hist = annotation__histogram(notes, evsel->idx + i);
sample = &al->data[i]; data = &al->data[i];
calc_percent(hist, sample, al->offset, end); calc_percent(hist, data, al->offset, end);
} }
} }
} }
...@@ -2356,12 +2356,12 @@ static void annotation__calc_lines(struct annotation *notes, struct map *map, ...@@ -2356,12 +2356,12 @@ static void annotation__calc_lines(struct annotation *notes, struct map *map,
int i; int i;
for (i = 0; i < al->data_nr; i++) { for (i = 0; i < al->data_nr; i++) {
struct annotation_data *sample; struct annotation_data *data;
sample = &al->data[i]; data = &al->data[i];
if (sample->percent > percent_max) if (data->percent > percent_max)
percent_max = sample->percent; percent_max = data->percent;
} }
if (percent_max <= 0.5) if (percent_max <= 0.5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment