Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1676340

Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the new source code TUI view

From Taeung Song <treeze.taeung@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the new source code TUI view
Date 2017-06-28 05:30 +0200
Message-ID <tXbPY-1sR-3@gated-at.bofh.it> (permalink)
References <tXbGi-1p2-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Additionally,
the code is available on 'annotate/src-only' branch at

   git://github.com/taeung/linux-perf.git

Thanks,
Taeung

On 06/28/2017 12:18 PM, Taeung Song wrote:
> 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(-)
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH/RFC 0/4] perf annotate: Add --source-only option and the new source code TUI view Taeung Song <treeze.taeung@gmail.com> - 2017-06-28 05:20 +0200
  Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the  new source code TUI view Taeung Song <treeze.taeung@gmail.com> - 2017-06-28 05:30 +0200
  Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the new source code TUI view Milian Wolff <milian.wolff@kdab.com> - 2017-06-28 12:00 +0200
    Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the  new source code TUI view Taeung Song <treeze.taeung@gmail.com> - 2017-06-28 20:00 +0200
      Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the new source code TUI view Milian Wolff <milian.wolff@kdab.com> - 2017-06-28 20:00 +0200
    Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the  new source code TUI view Namhyung Kim <namhyung@kernel.org> - 2017-06-29 09:20 +0200
      Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the  new source code TUI view Taeung Song <treeze.taeung@gmail.com> - 2017-06-30 09:20 +0200
    Re: [PATCH/RFC 0/4] perf annotate: Add --source-only option and the  new source code TUI view Taeung Song <treeze.taeung@gmail.com> - 2017-06-30 18:30 +0200

csiph-web