diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-02-04 15:18:06 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-02-06 10:00:39 -0300 |
commit | e4c38fd4a0f594d8ce0313db028af98b36edc8b3 (patch) | |
tree | 095a204dbc1689ae71277d5e9895fa28f13815e6 /tools/perf/util/hist.c | |
parent | 5f40fa97669bb3d97a43cd5c8f69f520d8dcb106 (diff) | |
download | lwn-e4c38fd4a0f594d8ce0313db028af98b36edc8b3.tar.gz lwn-e4c38fd4a0f594d8ce0313db028af98b36edc8b3.zip |
perf hists: Add argument to hists__resort_cb_t callback
Add argument to hists__resort_cb_t so that we can pass data from upper
layers to the callback function. It will be used in the following
patches.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190204141808.23031-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r-- | tools/perf/util/hist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 7f9df74ab893..64ad603a0592 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1721,7 +1721,8 @@ static void __hists__insert_output_entry(struct rb_root_cached *entries, } static void output_resort(struct hists *hists, struct ui_progress *prog, - bool use_callchain, hists__resort_cb_t cb) + bool use_callchain, hists__resort_cb_t cb, + void *cb_arg) { struct rb_root_cached *root; struct rb_node *next; @@ -1760,7 +1761,7 @@ static void output_resort(struct hists *hists, struct ui_progress *prog, n = rb_entry(next, struct hist_entry, rb_node_in); next = rb_next(&n->rb_node_in); - if (cb && cb(n)) + if (cb && cb(n, cb_arg)) continue; __hists__insert_output_entry(&hists->entries, n, min_callchain_hits, use_callchain); @@ -1785,18 +1786,18 @@ void perf_evsel__output_resort(struct perf_evsel *evsel, struct ui_progress *pro use_callchain |= symbol_conf.show_branchflag_count; - output_resort(evsel__hists(evsel), prog, use_callchain, NULL); + output_resort(evsel__hists(evsel), prog, use_callchain, NULL, NULL); } void hists__output_resort(struct hists *hists, struct ui_progress *prog) { - output_resort(hists, prog, symbol_conf.use_callchain, NULL); + output_resort(hists, prog, symbol_conf.use_callchain, NULL, NULL); } void hists__output_resort_cb(struct hists *hists, struct ui_progress *prog, hists__resort_cb_t cb) { - output_resort(hists, prog, symbol_conf.use_callchain, cb); + output_resort(hists, prog, symbol_conf.use_callchain, cb, NULL); } static bool can_goto_child(struct hist_entry *he, enum hierarchy_move_dir hmd) |