aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-12-18 15:10:15 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-19 09:34:27 -0500
commitf626adffe17632aa7b0e2a7732b49e2c32d477d8 (patch)
tree2e30d79aafa66a5a2d4883d8a96e2da02cfc4849
parent618afb294e288db086fce59de4419644215265e5 (diff)
perf annotate: Adopt methods from hists
Those are just wrappers to annotation methods, so move them to annotate.c Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-336h7z0bi2k51cbfi6mkpo5k@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/annotate.c10
-rw-r--r--tools/perf/util/annotate.h5
-rw-r--r--tools/perf/util/hist.c11
-rw-r--r--tools/perf/util/hist.h3
4 files changed, 15 insertions, 14 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 2812e7b78d0f..91e25269bb27 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -508,6 +508,11 @@ int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx)
508 return symbol__inc_addr_samples(ams->sym, ams->map, evidx, ams->al_addr); 508 return symbol__inc_addr_samples(ams->sym, ams->map, evidx, ams->al_addr);
509} 509}
510 510
511int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 ip)
512{
513 return symbol__inc_addr_samples(he->ms.sym, he->ms.map, evidx, ip);
514}
515
511static void disasm_line__init_ins(struct disasm_line *dl) 516static void disasm_line__init_ins(struct disasm_line *dl)
512{ 517{
513 dl->ins = ins__find(dl->name); 518 dl->ins = ins__find(dl->name);
@@ -1393,3 +1398,8 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
1393 1398
1394 return 0; 1399 return 0;
1395} 1400}
1401
1402int hist_entry__annotate(struct hist_entry *he, size_t privsize)
1403{
1404 return symbol__annotate(he->ms.sym, he->ms.map, privsize);
1405}
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 8de10b1ef027..43727a9b93cd 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -137,10 +137,15 @@ int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
137 137
138int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx); 138int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx);
139 139
140int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 addr);
141
140int symbol__alloc_hist(struct symbol *sym); 142int symbol__alloc_hist(struct symbol *sym);
141void symbol__annotate_zero_histograms(struct symbol *sym); 143void symbol__annotate_zero_histograms(struct symbol *sym);
142 144
143int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize); 145int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize);
146
147int hist_entry__annotate(struct hist_entry *he, size_t privsize);
148
144int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym); 149int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym);
145int symbol__annotate_printf(struct symbol *sym, struct map *map, 150int symbol__annotate_printf(struct symbol *sym, struct map *map,
146 struct perf_evsel *evsel, bool full_paths, 151 struct perf_evsel *evsel, bool full_paths,
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 63234e37583c..6cd4823a7a8b 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1,4 +1,3 @@
1#include "annotate.h"
2#include "util.h" 1#include "util.h"
3#include "build-id.h" 2#include "build-id.h"
4#include "hist.h" 3#include "hist.h"
@@ -807,16 +806,6 @@ void hists__filter_by_symbol(struct hists *hists)
807 } 806 }
808} 807}
809 808
810int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 ip)
811{
812 return symbol__inc_addr_samples(he->ms.sym, he->ms.map, evidx, ip);
813}
814
815int hist_entry__annotate(struct hist_entry *he, size_t privsize)
816{
817 return symbol__annotate(he->ms.sym, he->ms.map, privsize);
818}
819
820void events_stats__inc(struct events_stats *stats, u32 type) 809void events_stats__inc(struct events_stats *stats, u32 type)
821{ 810{
822 ++stats->nr_events[0]; 811 ++stats->nr_events[0];
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index b621347a1585..a59743fa3ef7 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -111,9 +111,6 @@ size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
111size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, 111size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows,
112 int max_cols, float min_pcnt, FILE *fp); 112 int max_cols, float min_pcnt, FILE *fp);
113 113
114int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 addr);
115int hist_entry__annotate(struct hist_entry *he, size_t privsize);
116
117void hists__filter_by_dso(struct hists *hists); 114void hists__filter_by_dso(struct hists *hists);
118void hists__filter_by_thread(struct hists *hists); 115void hists__filter_by_thread(struct hists *hists);
119void hists__filter_by_symbol(struct hists *hists); 116void hists__filter_by_symbol(struct hists *hists);