aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-08-04 09:05:07 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-08 14:55:47 -0400
commit48a1e4f2381387a097ea9f7897c5c32e9aaa708d (patch)
tree78764483b0593868b5cd24d7fb02c52a60202505 /tools/perf/util/annotate.c
parent0440af74dcd0f32b134b1c4d47dc25f0bb539ded (diff)
perf annotate: Rename hist to sym_hist in annotation__calc_percent
We will need to bring in 'struct hists' variable in this scope, so it's better we do this rename first. Signed-off-by: Jiri 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-7-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 8bd278a71004..728603636adc 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1753,7 +1753,7 @@ out_close_stdout:
1753 goto out_free_command; 1753 goto out_free_command;
1754} 1754}
1755 1755
1756static void calc_percent(struct sym_hist *hist, 1756static void calc_percent(struct sym_hist *sym_hist,
1757 struct annotation_data *data, 1757 struct annotation_data *data,
1758 s64 offset, s64 end) 1758 s64 offset, s64 end)
1759{ 1759{
@@ -1761,15 +1761,15 @@ static void calc_percent(struct sym_hist *hist,
1761 u64 period = 0; 1761 u64 period = 0;
1762 1762
1763 while (offset < end) { 1763 while (offset < end) {
1764 hits += hist->addr[offset].nr_samples; 1764 hits += sym_hist->addr[offset].nr_samples;
1765 period += hist->addr[offset].period; 1765 period += sym_hist->addr[offset].period;
1766 ++offset; 1766 ++offset;
1767 } 1767 }
1768 1768
1769 if (hist->nr_samples) { 1769 if (sym_hist->nr_samples) {
1770 data->he.period = period; 1770 data->he.period = period;
1771 data->he.nr_samples = hits; 1771 data->he.nr_samples = hits;
1772 data->percent = 100.0 * hits / hist->nr_samples; 1772 data->percent = 100.0 * hits / sym_hist->nr_samples;
1773 } 1773 }
1774} 1774}
1775 1775
@@ -1790,12 +1790,12 @@ static void annotation__calc_percent(struct annotation *notes,
1790 1790
1791 for (i = 0; i < al->data_nr; i++) { 1791 for (i = 0; i < al->data_nr; i++) {
1792 struct annotation_data *data; 1792 struct annotation_data *data;
1793 struct sym_hist *hist; 1793 struct sym_hist *sym_hist;
1794 1794
1795 hist = annotation__histogram(notes, evsel->idx + i); 1795 sym_hist = annotation__histogram(notes, evsel->idx + i);
1796 data = &al->data[i]; 1796 data = &al->data[i];
1797 1797
1798 calc_percent(hist, data, al->offset, end); 1798 calc_percent(sym_hist, data, al->offset, end);
1799 } 1799 }
1800 } 1800 }
1801} 1801}