aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-03-31 10:33:40 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-02 15:28:15 -0400
commita4e3b956a820162b7c1d616117b4f23b6017f504 (patch)
tree370116b6f6f4f8d3410a14831d394cf4993d04d8 /tools/perf/util/hist.h
parent70162138c91b040da3162fe1f34fe8aaf6506f10 (diff)
perf hist: Replace ->print() routines by ->snprintf() equivalents
Then hist_entry__fprintf will just us the newly introduced hist_entry__snprintf, add the newline and fprintf it to the supplied FILE descriptor. This allows us to remove the use_browser checking in the color_printf routines, that now got color_snprintf variants too. The newt TUI browser (and other GUIs that may come in the future) don't have to worry about stdio specific stuff in the strings they get from the se->snprintf routines and instead use whatever means to do the equivalent. Also the newt TUI browser don't have to use the fmemopen() hack, instead it can use the se->snprintf routines directly. For now tho use the hist_entry__snprintf routine to reduce the patch size. Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.h')
-rw-r--r--tools/perf/util/hist.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index da6a8c1320fa..ad17f0ad798b 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -18,11 +18,16 @@ struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists,
18 u64 count, bool *hit); 18 u64 count, bool *hit);
19extern int64_t hist_entry__cmp(struct hist_entry *, struct hist_entry *); 19extern int64_t hist_entry__cmp(struct hist_entry *, struct hist_entry *);
20extern int64_t hist_entry__collapse(struct hist_entry *, struct hist_entry *); 20extern int64_t hist_entry__collapse(struct hist_entry *, struct hist_entry *);
21size_t hist_entry__fprintf(struct hist_entry *self, 21int hist_entry__fprintf(struct hist_entry *self,
22 struct perf_session *pair_session, 22 struct perf_session *pair_session,
23 bool show_displacement, 23 bool show_displacement,
24 long displacement, FILE *fp, 24 long displacement, FILE *fp,
25 u64 session_total); 25 u64 session_total);
26int hist_entry__snprintf(struct hist_entry *self,
27 char *bf, size_t size,
28 struct perf_session *pair_session,
29 bool show_displacement, long displacement,
30 bool color, u64 session_total);
26void hist_entry__free(struct hist_entry *); 31void hist_entry__free(struct hist_entry *);
27 32
28u64 perf_session__output_resort(struct rb_root *hists, u64 total_samples); 33u64 perf_session__output_resort(struct rb_root *hists, u64 total_samples);