X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=tools%2Fperf%2Futil%2Fsort.h;h=1d857aa2c01f1830713a0daa00baefc655d6eda4;hb=fcd1498405c2c88ac632e7c3c3fce3213d9196db;hp=333e664ff45fddfe9838f113dda25dc0a26c3860;hpb=a4fb581b15949cfd10b64c8af37bc106e95307f3;p=safe%2Fjmp%2Flinux-2.6 diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 333e664..1d857aa 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -44,14 +44,23 @@ extern enum sort_type sort__first_dimension; struct hist_entry { struct rb_node rb_node; u64 count; + /* + * XXX WARNING! + * thread _has_ to come after ms, see + * hist_browser__selected_thread in util/newt.c + */ + struct map_symbol ms; struct thread *thread; - struct map *map; - struct symbol *sym; u64 ip; char level; + u8 filtered; struct symbol *parent; - struct callchain_node callchain; - struct rb_root sorted_chain; + union { + unsigned long position; + struct hist_entry *pair; + struct rb_root sorted_chain; + }; + struct callchain_node callchain[0]; }; enum sort_type { @@ -69,19 +78,21 @@ enum sort_type { struct sort_entry { struct list_head list; - const char *header; + const char *se_header; - 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); - unsigned int *width; + int64_t (*se_cmp)(struct hist_entry *, struct hist_entry *); + int64_t (*se_collapse)(struct hist_entry *, struct hist_entry *); + int (*se_snprintf)(struct hist_entry *self, char *bf, size_t size, + unsigned int width); + unsigned int *se_width; bool elide; }; extern struct sort_entry sort_thread; extern struct list_head hist_entry__sort_list; -extern int repsep_fprintf(FILE *fp, const char *fmt, ...); +void setup_sorting(const char * const usagestr[], const struct option *opts); + 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); @@ -95,5 +106,7 @@ extern int64_t sort__sym_cmp(struct hist_entry *, struct hist_entry *); extern int64_t sort__parent_cmp(struct hist_entry *, struct hist_entry *); extern size_t sort__parent_print(FILE *, struct hist_entry *, unsigned int); extern int sort_dimension__add(const char *); +void sort_entry__setup_elide(struct sort_entry *self, struct strlist *list, + const char *list_name, FILE *fp); #endif /* __PERF_SORT_H */