diff options
author | Namhyung Kim <namhyung@kernel.org> | 2015-10-22 07:45:46 (GMT) |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-10-22 18:40:11 (GMT) |
commit | 792aeafa8ed08e5e18fb66ab93b470f78e619f75 (patch) | |
tree | 5f0915238c4d7fc2a639aae06a4e070eadcccd91 /tools/perf/util | |
parent | a2c10d39af49b00514f7cc7b750757fcc2174f0c (diff) | |
download | linux-792aeafa8ed08e5e18fb66ab93b470f78e619f75.tar.xz |
perf tools: Defaults to 'caller' callchain order only if --children is enabled
The caller callchain order is useful with --children option since it can
show 'overview' style output, but other commands which don't use
--children feature like 'perf script' or even 'perf report/top' without
--children are better to keep callee order.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Brendan Gregg <brendan.d.gregg@gmail.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445499946-29817-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/callchain.c | 2 | ||||
-rw-r--r-- | tools/perf/util/callchain.h | 1 | ||||
-rw-r--r-- | tools/perf/util/util.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 842be32..735ad48 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -51,10 +51,12 @@ static int parse_callchain_order(const char *value) { if (!strncmp(value, "caller", strlen(value))) { callchain_param.order = ORDER_CALLER; + callchain_param.order_set = true; return 0; } if (!strncmp(value, "callee", strlen(value))) { callchain_param.order = ORDER_CALLEE; + callchain_param.order_set = true; return 0; } return -1; diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index 836d59a..aaf467c 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h @@ -75,6 +75,7 @@ struct callchain_param { double min_percent; sort_chain_func_t sort; enum chain_order order; + bool order_set; enum chain_key key; bool branch_callstack; }; diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index c1bf9ff..cd12c25 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -19,7 +19,7 @@ struct callchain_param callchain_param = { .mode = CHAIN_GRAPH_ABS, .min_percent = 0.5, - .order = ORDER_CALLER, + .order = ORDER_CALLEE, .key = CCKEY_FUNCTION }; |