]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - tools/perf/util/hist.h
Merge tag 'v3.16-rc1' into i2c/for-next
[karo-tx-linux.git] / tools / perf / util / hist.h
index a8418d19808dc29e50cc683ea6da088062af55a4..d2bf03575d5f08ccb22f6c550ac5f18b0fdf5e08 100644 (file)
@@ -96,12 +96,50 @@ struct hists {
        u16                     col_len[HISTC_NR_COLS];
 };
 
+struct hist_entry_iter;
+
+struct hist_iter_ops {
+       int (*prepare_entry)(struct hist_entry_iter *, struct addr_location *);
+       int (*add_single_entry)(struct hist_entry_iter *, struct addr_location *);
+       int (*next_entry)(struct hist_entry_iter *, struct addr_location *);
+       int (*add_next_entry)(struct hist_entry_iter *, struct addr_location *);
+       int (*finish_entry)(struct hist_entry_iter *, struct addr_location *);
+};
+
+struct hist_entry_iter {
+       int total;
+       int curr;
+
+       bool hide_unresolved;
+
+       struct perf_evsel *evsel;
+       struct perf_sample *sample;
+       struct hist_entry *he;
+       struct symbol *parent;
+       void *priv;
+
+       const struct hist_iter_ops *ops;
+       /* user-defined callback function (optional) */
+       int (*add_entry_cb)(struct hist_entry_iter *iter,
+                           struct addr_location *al, bool single, void *arg);
+};
+
+extern const struct hist_iter_ops hist_iter_normal;
+extern const struct hist_iter_ops hist_iter_branch;
+extern const struct hist_iter_ops hist_iter_mem;
+extern const struct hist_iter_ops hist_iter_cumulative;
+
 struct hist_entry *__hists__add_entry(struct hists *hists,
                                      struct addr_location *al,
                                      struct symbol *parent,
                                      struct branch_info *bi,
                                      struct mem_info *mi, u64 period,
-                                     u64 weight, u64 transaction);
+                                     u64 weight, u64 transaction,
+                                     bool sample_self);
+int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
+                        struct perf_evsel *evsel, struct perf_sample *sample,
+                        int max_stack_depth, void *arg);
+
 int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right);
 int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right);
 int hist_entry__transaction_len(void);
@@ -119,6 +157,7 @@ u64 hists__total_period(struct hists *hists);
 void hists__reset_stats(struct hists *hists);
 void hists__inc_stats(struct hists *hists, struct hist_entry *h);
 void hists__inc_nr_events(struct hists *hists, u32 type);
+void hists__inc_nr_samples(struct hists *hists, bool filtered);
 void events_stats__inc(struct events_stats *stats, u32 type);
 size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
 
@@ -166,6 +205,7 @@ struct perf_hpp_fmt {
 
        struct list_head list;
        struct list_head sort_list;
+       bool elide;
 };
 
 extern struct list_head perf_hpp__list;
@@ -192,6 +232,7 @@ enum {
        PERF_HPP__OVERHEAD_US,
        PERF_HPP__OVERHEAD_GUEST_SYS,
        PERF_HPP__OVERHEAD_GUEST_US,
+       PERF_HPP__OVERHEAD_ACC,
        PERF_HPP__SAMPLES,
        PERF_HPP__PERIOD,
 
@@ -200,7 +241,11 @@ enum {
 
 void perf_hpp__init(void);
 void perf_hpp__column_register(struct perf_hpp_fmt *format);
+void perf_hpp__column_unregister(struct perf_hpp_fmt *format);
 void perf_hpp__column_enable(unsigned col);
+void perf_hpp__column_disable(unsigned col);
+void perf_hpp__cancel_cumulate(void);
+
 void perf_hpp__register_sort_field(struct perf_hpp_fmt *format);
 void perf_hpp__setup_output_field(void);
 void perf_hpp__reset_output_field(void);
@@ -208,7 +253,12 @@ void perf_hpp__append_sort_keys(void);
 
 bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format);
 bool perf_hpp__same_sort_entry(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b);
-bool perf_hpp__should_skip(struct perf_hpp_fmt *format);
+
+static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format)
+{
+       return format->elide;
+}
+
 void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists);
 
 typedef u64 (*hpp_field_fn)(struct hist_entry *he);
@@ -218,6 +268,9 @@ typedef int (*hpp_snprint_fn)(struct perf_hpp *hpp, const char *fmt, ...);
 int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he,
               hpp_field_fn get_field, const char *fmt,
               hpp_snprint_fn print_fn, bool fmt_percent);
+int __hpp__fmt_acc(struct perf_hpp *hpp, struct hist_entry *he,
+                  hpp_field_fn get_field, const char *fmt,
+                  hpp_snprint_fn print_fn, bool fmt_percent);
 
 static inline void advance_hpp(struct perf_hpp *hpp, int inc)
 {