]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
perf annotate: Remove disasm__calc_percent function
authorJiri Olsa <jolsa@kernel.org>
Wed, 11 Oct 2017 15:01:44 +0000 (17:01 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 16 Nov 2017 17:46:14 +0000 (14:46 -0300)
Remove disasm__calc_percent() function, because it's no longer needed.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20171011150158.11895-22-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c
tools/perf/util/annotate.h

index 209a25545542853332db9ba6aa4c8c35fc832d05..29cf2a5ef6204bdbf7dbc5fc81ea2577c43eec0c 100644 (file)
@@ -1010,50 +1010,6 @@ annotation_line__next(struct annotation_line *pos, struct list_head *head)
        return NULL;
 }
 
-double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset,
-                           s64 end, const char **path, struct sym_hist_entry *sample)
-{
-       struct source_line *src_line = notes->src->lines;
-       double percent = 0.0;
-
-       sample->nr_samples = sample->period = 0;
-
-       if (src_line) {
-               size_t sizeof_src_line = sizeof(*src_line) +
-                               sizeof(src_line->samples) * (src_line->nr_pcnt - 1);
-
-               while (offset < end) {
-                       src_line = (void *)notes->src->lines +
-                                       (sizeof_src_line * offset);
-
-                       if (*path == NULL)
-                               *path = src_line->path;
-
-                       percent += src_line->samples[evidx].percent;
-                       sample->nr_samples += src_line->samples[evidx].nr;
-                       offset++;
-               }
-       } else {
-               struct sym_hist *h = annotation__histogram(notes, evidx);
-               unsigned int hits = 0;
-               u64 period = 0;
-
-               while (offset < end) {
-                       hits   += h->addr[offset].nr_samples;
-                       period += h->addr[offset].period;
-                       ++offset;
-               }
-
-               if (h->nr_samples) {
-                       sample->period     = period;
-                       sample->nr_samples = hits;
-                       percent = 100.0 * hits / h->nr_samples;
-               }
-       }
-
-       return percent;
-}
-
 static const char *annotate__address_color(struct block_range *br)
 {
        double cov = block_range__coverage(br);
index 927810b19f0da7e2840e0e236deec88d1bda20dd..f98acb2ad721b2b3e6cf1a441177eb556b0bf716 100644 (file)
@@ -107,8 +107,6 @@ struct annotation_line *
 annotation_line__next(struct annotation_line *pos, struct list_head *head);
 int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw);
 size_t disasm__fprintf(struct list_head *head, FILE *fp);
-double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset,
-                           s64 end, const char **path, struct sym_hist_entry *sample);
 int symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel);
 
 struct sym_hist {