From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
David Ahern <dsahern@gmail.com>,
Namhyung Kim <namhyung@kernel.org>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Subject: [PATCH 5/6] perf c2c report: Add --no-source option
Date: Tue, 11 Oct 2016 14:14:11 +0200 [thread overview]
Message-ID: <1476188052-32316-6-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1476188052-32316-1-git-send-email-jolsa@kernel.org>
Add a possibility to disable source line column with
new --no-source option. It source line data could take
lot of time to retrieve, so it could be a performance
burden for big data.
Link: http://lkml.kernel.org/n/tip-8p6s2727fq8nbsm3it5gix3p@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/Documentation/perf-c2c.txt | 3 +++
tools/perf/builtin-c2c.c | 13 ++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
index ba2f4de399c3..33ed4564a8c0 100644
--- a/tools/perf/Documentation/perf-c2c.txt
+++ b/tools/perf/Documentation/perf-c2c.txt
@@ -94,6 +94,9 @@ REPORT OPTIONS
--full-symbols::
Display full length of symbols.
+--no-source::
+ Do not display Source:Line column.
+
C2C RECORD
----------
The perf c2c record command setup options related to HITM cacheline analysis
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 73973da00b31..6656fcbe8d85 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2404,7 +2404,7 @@ static int setup_display(const char *str)
for (__tok = strtok_r(__buf, __sep, &__tmp); __tok; \
__tok = strtok_r(NULL, __sep, &__tmp))
-static int build_cl_output(char *cl_sort)
+static int build_cl_output(char *cl_sort, bool no_source)
{
char *tok, *tmp, *buf = strdup(cl_sort);
bool add_pid = false;
@@ -2426,7 +2426,7 @@ static int build_cl_output(char *cl_sort)
add_iaddr = true;
add_sym = true;
add_dso = true;
- add_src = true;
+ add_src = no_source ? false : true;
} else if (!strcmp(tok, "dso")) {
add_dso = true;
} else if (strcmp(tok, "offset")) {
@@ -2462,14 +2462,14 @@ static int build_cl_output(char *cl_sort)
return 0;
}
-static int setup_coalesce(const char *coalesce)
+static int setup_coalesce(const char *coalesce, bool no_source)
{
const char *c = coalesce ?: coalesce_default;
if (asprintf(&c2c.cl_sort, "offset,%s", c) < 0)
return -ENOMEM;
- if (build_cl_output(c2c.cl_sort))
+ if (build_cl_output(c2c.cl_sort, no_source))
return -1;
if (asprintf(&c2c.cl_resort, "offset,%s",
@@ -2494,6 +2494,7 @@ static int perf_c2c__report(int argc, const char **argv)
char callchain_default_opt[] = CALLCHAIN_DEFAULT_OPT;
const char *display = NULL;
const char *coalesce = NULL;
+ bool no_source = false;
const struct option c2c_options[] = {
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
"file", "vmlinux pathname"),
@@ -2510,6 +2511,8 @@ static int perf_c2c__report(int argc, const char **argv)
"Use the stdio interface"),
OPT_BOOLEAN(0, "full-symbols", &c2c.symbol_full,
"Display full length of symbols"),
+ OPT_BOOLEAN(0, "no-source", &no_source,
+ "Do not display Source Line column"),
OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param,
"print_type,threshold[,print_limit],order,sort_key[,branch],value",
callchain_help, &parse_callchain_opt,
@@ -2545,7 +2548,7 @@ static int perf_c2c__report(int argc, const char **argv)
if (err)
goto out;
- err = setup_coalesce(coalesce);
+ err = setup_coalesce(coalesce, no_source);
if (err) {
pr_debug("Failed to initialize hists\n");
goto out;
--
2.7.4
next prev parent reply other threads:[~2016-10-11 12:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-11 12:14 [PATCH 0/6] perf tools: Header and c2c fixes Jiri Olsa
2016-10-11 12:14 ` [PATCH 1/6] perf report: Move captured info to generic header info Jiri Olsa
2016-10-11 12:14 ` [PATCH 2/6] perf header: Display missing features Jiri Olsa
2016-10-11 12:14 ` [PATCH 3/6] perf header: Display feature name on write failure Jiri Olsa
2016-10-11 12:14 ` [PATCH 4/6] perf header: Set nr_numa_nodes only when we parsed all the data Jiri Olsa
2016-10-11 12:14 ` Jiri Olsa [this message]
2016-10-11 12:14 ` [PATCH 6/6] perf c2c report: Add --show-all option Jiri Olsa
2016-10-11 12:59 ` [PATCH 0/6] tools lib: Add for_each_clear_bit macro Jiri Olsa
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=1476188052-32316-6-git-send-email-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=sukadev@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome