From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Borislav Petkov <bp@suse.de>,
Brendan Gregg <brendan.d.gregg@gmail.com>,
Chandler Carruth <chandlerc@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Stephane Eranian <eranian@google.com>,
Wang Nan <wangnan0@huawei.com>
Subject: [RFC/PATCH RESEND 3/3] perf tools: Defaults to 'caller' callchain order only if --children is enabled
Date: Thu, 22 Oct 2015 16:45:46 +0900 [thread overview]
Message-ID: <1445499946-29817-1-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1445495330-25416-3-git-send-email-namhyung@kernel.org>
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.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Chandler Carruth <chandlerc@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
fix typo
tools/perf/builtin-report.c | 2 ++
tools/perf/builtin-top.c | 3 +++
tools/perf/util/callchain.c | 2 ++
tools/perf/util/callchain.h | 1 +
tools/perf/util/util.c | 2 +-
5 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 18a8c52d921e..545c51cef7f7 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -812,6 +812,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
if (report.inverted_callchain)
callchain_param.order = ORDER_CALLER;
+ if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
+ callchain_param.order = ORDER_CALLER;
if (itrace_synth_opts.callchain &&
(int)itrace_synth_opts.callchain_sz > report.max_stack)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1de381d3f29f..af849b1d7389 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1304,6 +1304,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
perf_hpp__cancel_cumulate();
}
+ if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
+ callchain_param.order = ORDER_CALLER;
+
symbol_conf.priv_size = sizeof(struct annotation);
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 842be32899ee..735ad48e1858 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 836d59a001bc..aaf467c9ef2b 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 c1bf9ff210b0..cd12c25e4ea4 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
};
--
2.6.0
next prev parent reply other threads:[~2015-10-22 7:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 6:28 [PATCH 1/3] perf tools: Move callchain help messages to callchain.h Namhyung Kim
2015-10-22 6:28 ` [PATCH 2/3] perf top: Support call-graph display options also Namhyung Kim
2015-10-22 8:23 ` Ingo Molnar
2015-10-22 12:20 ` Namhyung Kim
2015-10-22 13:57 ` Taeung Song
2015-10-22 14:34 ` Namhyung Kim
2015-10-22 18:38 ` Arnaldo Carvalho de Melo
2015-10-23 8:31 ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-10-22 6:28 ` [RFC/PATCH 3/3] perf tools: Defaults to 'caller' callchain order only if --children is enabled Namhyung Kim
2015-10-22 7:32 ` Ingo Molnar
2015-10-22 7:38 ` Namhyung Kim
2015-10-22 9:49 ` Brendan Gregg
2015-10-22 14:03 ` Arnaldo Carvalho de Melo
2015-11-02 23:59 ` Brendan Gregg
2015-10-22 12:21 ` Frederic Weisbecker
2015-10-22 7:45 ` Namhyung Kim [this message]
2015-10-22 18:38 ` [RFC/PATCH RESEND " Arnaldo Carvalho de Melo
2015-10-23 8:31 ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-10-22 12:19 ` [RFC/PATCH 3/3] " Frederic Weisbecker
2015-10-22 14:13 ` Arnaldo Carvalho de Melo
2015-10-22 14:22 ` Namhyung Kim
2015-10-22 14:37 ` Arnaldo Carvalho de Melo
2015-10-22 15:51 ` Namhyung Kim
2015-10-22 16:21 ` Arnaldo Carvalho de Melo
2015-10-22 8:02 ` [PATCH 1/3] perf tools: Move callchain help messages to callchain.h Ingo Molnar
2015-10-22 12:13 ` Namhyung Kim
2015-10-22 14:17 ` Arnaldo Carvalho de Melo
2015-10-23 9:59 ` Ingo Molnar
2015-10-23 14:27 ` Arnaldo Carvalho de Melo
2015-10-23 16:40 ` Arnaldo Carvalho de Melo
2015-10-22 18:38 ` Arnaldo Carvalho de Melo
2015-10-23 8:30 ` [tip:perf/core] " tip-bot for Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445499946-29817-1-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=bp@suse.de \
--cc=brendan.d.gregg@gmail.com \
--cc=chandlerc@gmail.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.