summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
authorJiri Olsa2016-01-18 10:23:59 +0100
committerArnaldo Carvalho de Melo2016-02-03 15:13:11 +0100
commit01441af5df438a171bce36bc3c7cfb588bc98a7a (patch)
treef30be6d560deee5bec203963aa215673b0ddf877 /tools/perf/util/hist.c
parentMerge tag 'perf-core-for-mingo-3' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
downloadkernel-qcow2-linux-01441af5df438a171bce36bc3c7cfb588bc98a7a.tar.gz
kernel-qcow2-linux-01441af5df438a171bce36bc3c7cfb588bc98a7a.tar.xz
kernel-qcow2-linux-01441af5df438a171bce36bc3c7cfb588bc98a7a.zip
perf hists: Factor output_resort from hists__output_resort
Currently hists__output_resort() depends on hists based on hists_evsel struct, but we need to be able to sort common hists as well. Cutting out the sorting base sorting code into output_resort function, so it can be reused in following patch. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1453109064-1026-2-git-send-email-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.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 098310bc4489..7797d06d4993 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1197,19 +1197,13 @@ static void __hists__insert_output_entry(struct rb_root *entries,
rb_insert_color(&he->rb_node, entries);
}
-void hists__output_resort(struct hists *hists, struct ui_progress *prog)
+static void output_resort(struct hists *hists, struct ui_progress *prog,
+ bool use_callchain)
{
struct rb_root *root;
struct rb_node *next;
struct hist_entry *n;
u64 min_callchain_hits;
- struct perf_evsel *evsel = hists_to_evsel(hists);
- bool use_callchain;
-
- if (evsel && symbol_conf.use_callchain && !symbol_conf.show_ref_callgraph)
- use_callchain = evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN;
- else
- use_callchain = symbol_conf.use_callchain;
min_callchain_hits = hists__total_period(hists) * (callchain_param.min_percent / 100);
@@ -1239,6 +1233,19 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog)
}
}
+void hists__output_resort(struct hists *hists, struct ui_progress *prog)
+{
+ struct perf_evsel *evsel = hists_to_evsel(hists);
+ bool use_callchain;
+
+ if (evsel && symbol_conf.use_callchain && !symbol_conf.show_ref_callgraph)
+ use_callchain = evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN;
+ else
+ use_callchain = symbol_conf.use_callchain;
+
+ output_resort(hists, prog, use_callchain);
+}
+
static void hists__remove_entry_filter(struct hists *hists, struct hist_entry *h,
enum hist_filter filter)
{