summaryrefslogtreecommitdiff
path: root/tools/perf/util/sort.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-03-31 11:33:40 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-02 16:28:15 -0300
commita4e3b956a820162b7c1d616117b4f23b6017f504 (patch)
tree370116b6f6f4f8d3410a14831d394cf4993d04d8 /tools/perf/util/sort.h
parent70162138c91b040da3162fe1f34fe8aaf6506f10 (diff)
downloadlinux-3.10-a4e3b956a820162b7c1d616117b4f23b6017f504.tar.gz
linux-3.10-a4e3b956a820162b7c1d616117b4f23b6017f504.tar.bz2
linux-3.10-a4e3b956a820162b7c1d616117b4f23b6017f504.zip
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/sort.h')
-rw-r--r--tools/perf/util/sort.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 598568696f9..439ec5fa0f5 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -76,7 +76,8 @@ struct sort_entry {
int64_t (*cmp)(struct hist_entry *, struct hist_entry *);
int64_t (*collapse)(struct hist_entry *, struct hist_entry *);
- size_t (*print)(FILE *fp, struct hist_entry *, unsigned int width);
+ int (*snprintf)(struct hist_entry *self, char *bf, size_t size,
+ unsigned int width);
unsigned int *width;
bool elide;
};
@@ -86,7 +87,6 @@ extern struct list_head hist_entry__sort_list;
void setup_sorting(const char * const usagestr[], const struct option *opts);
-extern int repsep_fprintf(FILE *fp, const char *fmt, ...);
extern size_t sort__thread_print(FILE *, struct hist_entry *, unsigned int);
extern size_t sort__comm_print(FILE *, struct hist_entry *, unsigned int);
extern size_t sort__dso_print(FILE *, struct hist_entry *, unsigned int);