From: Taeung Song <treeze.taeung@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Adrian Hunter <adrian.hunter@intel.com>,
Andi Kleen <ak@linux.intel.com>, David Ahern <dsahern@gmail.com>,
Jin Yao <yao.jin@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>,
Kim Phillips <kim.phillips@arm.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Milian Wolff <milian.wolff@kdab.com>,
Namhyung Kim <namhyung@kernel.org>,
Wang Nan <wangnan0@huawei.com>
Subject: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the new source code TUI view
Date: Wed, 28 Jun 2017 12:18:08 +0900 [thread overview]
Message-ID: <1498619888-1305-1-git-send-email-treeze.taeung@gmail.com> (raw)
Hi,
The --source-only option and new source code TUI view can show
the result of performance analysis based on full source code per symbol(function).
(Namhyung Kim told me this idea and it was also requested by others some time ago..)
If someone wants to see the cause, he/she will need to dig into the asm.
But before that, looking at the source level can give a hint or clue
for the problem.
For example, if target symbol is 'hex2u64' of util/util.c,
the output is like below.
$ perf annotate --source-only --stdio -s hex2u64
Percent | Source code of util.c for cycles:ppp (42 samples)
-----------------------------------------------------------------
0.00 : 354 * While we find nice hex chars, build a long_val.
0.00 : 355 * Return number of chars processed.
0.00 : 356 */
0.00 : 357 int hex2u64(const char *ptr, u64 *long_val)
2.38 : 358 {
2.38 : 359 const char *p = ptr;
0.00 : 360 *long_val = 0;
0.00 : 361
30.95 : 362 while (*p) {
23.81 : 363 const int hex_val = hex(*p);
0.00 : 364
14.29 : 365 if (hex_val < 0)
0.00 : 366 break;
0.00 : 367
26.19 : 368 *long_val = (*long_val << 4) | hex_val;
0.00 : 369 p++;
0.00 : 370 }
0.00 : 371
0.00 : 372 return p - ptr;
0.00 : 373 }
And I added many perf developers into Cc: because I want to listen to your opinions
about this new feature, if you don't mind.
If you give some feedback, I'd appreciate it! :)
Thanks,
Taeung
Taeung Song (4):
perf annotate: Add --source-only option
perf annotate: Add new source code view to the annotate TUI browser
perf annotate: Fold or unfold partial disassembly lines on source code
view
perf annotate: Support a 'o' key showing addresses on the new source
code view
tools/perf/builtin-annotate.c | 2 +
tools/perf/ui/browser.h | 1 +
tools/perf/ui/browsers/annotate.c | 307 +++++++++++++++++++++++++++++++++++++-
tools/perf/util/annotate.c | 303 ++++++++++++++++++++++++++++++++++++-
tools/perf/util/annotate.h | 30 ++++
tools/perf/util/symbol.c | 1 +
tools/perf/util/symbol.h | 1 +
7 files changed, 633 insertions(+), 12 deletions(-)
--
2.7.4
next reply other threads:[~2017-06-28 3:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 3:18 Taeung Song [this message]
2017-06-28 3:26 ` Taeung Song
2017-06-28 9:53 ` Milian Wolff
2017-06-28 16:27 ` Taeung Song
2017-06-28 16:32 ` Milian Wolff
2017-06-29 7:11 ` Namhyung Kim
2017-06-30 7:14 ` Taeung Song
2017-06-30 16:21 ` Taeung Song
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=1498619888-1305-1-git-send-email-treeze.taeung@gmail.com \
--to=treeze.taeung@gmail.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=kim.phillips@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=milian.wolff@kdab.com \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
--cc=yao.jin@linux.intel.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
all inboxes | Powered by JetHome®