All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Gregg <brendan.d.gregg@gmail.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	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>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andi Kleen <andi@firstfloor.org>, Kan Liang <kan.liang@intel.com>
Subject: Re: [PATCHSET 0/9] perf report: Support folded callchain output (v5)
Date: Thu, 12 Nov 2015 09:50:21 -0800	[thread overview]
Message-ID: <CAE40pddPUS6e6Tnvw2YAhWi=WNJnvrgtLTTN=bMEuHmWnQWmZg@mail.gmail.com> (raw)
In-Reply-To: <1447047946-1691-1-git-send-email-namhyung@kernel.org>

On Sun, Nov 8, 2015 at 9:45 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> Hello,
>
> This is what Brendan requested on the perf-users mailing list [1] to
> support FlameGraphs [2] more efficiently.  This patchset adds a few
> more callchain options to adjust the output for it.
>
>  * changes in v5)
>    - honor field separator from -t option
>    - add support for TUI and GTK
>
>  * changes in v4)
>    - add missing doc update
>      - cleanup/fix callchain value print code
>        - add Acked-by from Brendan and Jiri
>
>  * changes in v3)
>    - put the value before callchains
>      - fix compile error
>
>
> At first, 'folded' output mode was added.  The folded output puts the
> value, a space and all calchain nodes separated by semicolons.  Now it
> only supports --stdio as other UI provides some way of folding and/or
> expanding callchains dynamically.
>
> The value is now can be one of 'percent', 'period', or 'count'.  The
> percent is current default output and the period is the raw number of
> sample periods.  The count is the number of samples for each callchain.
>
> The proposed features of hiding hist lines with '-F none' and showing
> hist info with callchains can be added as later work.
>
> Here's an example:
>
>   $ perf report --no-children --show-nr-samples --stdio -g folded,count
>   ...
>     39.93%     80  swapper  [kernel.vmlinux]  [k] intel_idel
>   57 intel_idle;cpuidle_enter_state;cpuidle_enter;call_cpuidle;cpu_startup_entry;start_secondary
>   23 intel_idle;cpuidle_enter_state;cpuidle_enter;call_cpuidle;cpu_startup_entry;rest_init;...
>

Thanks, I tested it, it works!

It lets me do this:

# ./perf report --no-children -n --stdio -g folded,count -F pid
[...]
      0:swapper
1032 xen_hypercall_sched_op;default_idle;arch_cpu_idle;default_idle_call;cpu_startup_entry;cpu_bringup_and_idle
134 xen_hypercall_sched_op;default_idle;arch_cpu_idle;default_idle_call;cpu_startup_entry;rest_init;start_kernel;x86_64_start_reservations;xen_start_kernel
1 xen_hypercall_xen_version;check_events;__schedule;schedule;schedule_preempt_disabled;cpu_startup_entry;cpu_bringup_and_idle
1 xen_hypercall_xen_version;check_events;cpu_startup_entry;rest_init;start_kernel;x86_64_start_reservations;xen_start_kernel
   1248:bash
43 copy_page_range;copy_process;_do_fork;sys_clone;entry_SYSCALL_64_fastpath;__libc_fork;make_child
6 xen_hypercall_xen_version;check_events;xen_dup_mmap;copy_process;_do_fork;sys_clone;entry_SYSCALL_64_fastpath;__libc_fork;make_child
4 xen_hypercall_xen_version;check_events;copy_page_range;copy_process;_do_fork;sys_clone;entry_SYSCALL_64_fastpath;__libc_fork;make_child
[...]

This is a parsable call chain summary, and which can be flamegraph'd
after a touch of awk. Later on we can add a "-F none" and "-g pid"
etc, but this patch solves the number one issue of avoiding the
expense of needing to re-aggregate the call chain output (output of
perf script), so I'd be pretty happy to use this instead.

Brendan

>
>   $ perf report --no-children --stdio -g percent
>   ...
>     39.93%  swapper  [kernel.vmlinux]  [k] intel_idel
>             |
>             ---intel_idle
>                cpuidle_enter_state
>                cpuidle_enter
>                call_cpuidle
>                cpu_startup_entry
>                |
>                |--28.63%-- start_secondary
>                |
>                 --11.30%-- rest_init
>
>
>   $ perf report --no-children --stdio --show-total-period -g period
>   ...
>     39.93%   13018705  swapper  [kernel.vmlinux]  [k] intel_idel
>             |
>             ---intel_idle
>                cpuidle_enter_state
>                cpuidle_enter
>                call_cpuidle
>                cpu_startup_entry
>                |
>                |--9334403-- start_secondary
>                |
>                 --3684302-- rest_init
>
>
>   $ perf report --no-children --stdio --show-nr-samples -g count
>   ...
>     39.93%     80  swapper  [kernel.vmlinux]  [k] intel_idel
>             |
>             ---intel_idle
>                cpuidle_enter_state
>                cpuidle_enter
>                call_cpuidle
>                cpu_startup_entry
>                |
>                |--57-- start_secondary
>                |
>                 --23-- rest_init
>
>
> You can get it from 'perf/callchain-fold-v5' branch on my tree:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
>
> Any comments are welcome, thanks
> Namhyung
>
>
> [1] http://www.spinics.net/lists/linux-perf-users/msg02498.html
> [2] http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html
>
>
> Namhyung Kim (9):
>   perf report: Support folded callchain mode on --stdio
>   perf callchain: Abstract callchain print function
>   perf callchain: Add count fields to struct callchain_node
>   perf report: Add callchain value option
>   perf hists browser: Factor out hist_browser__show_callchain_list()
>   perf hists browser: Support flat callchains
>   perf hists browser: Support folded callchains
>   perf ui/gtk: Support flat callchains
>   perf ui/gtk: Support folded callchains
>
>  tools/perf/Documentation/perf-report.txt |  14 +-
>  tools/perf/builtin-report.c              |   4 +-
>  tools/perf/ui/browsers/hists.c           | 316 ++++++++++++++++++++++++++++---
>  tools/perf/ui/gtk/hists.c                | 148 ++++++++++++++-
>  tools/perf/ui/stdio/hist.c               |  94 +++++++--
>  tools/perf/util/callchain.c              | 135 ++++++++++++-
>  tools/perf/util/callchain.h              |  28 ++-
>  tools/perf/util/util.c                   |   3 +-
>  8 files changed, 679 insertions(+), 63 deletions(-)
>
> --
> 2.6.2
>

  parent reply	other threads:[~2015-11-12 17:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  5:45 [PATCHSET 0/9] perf report: Support folded callchain output (v5) Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 1/9] perf report: Support folded callchain mode on --stdio Namhyung Kim
2015-11-23 16:13   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH] perf report: [WIP] Support '-F none' option to hide hist lines Namhyung Kim
2015-11-19 14:33   ` Arnaldo Carvalho de Melo
2015-11-20  1:43     ` Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 2/9] perf callchain: Abstract callchain print function Namhyung Kim
2015-11-19 13:41   ` Arnaldo Carvalho de Melo
2015-11-20  1:33     ` Namhyung Kim
2015-11-23 16:13   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 3/9] perf callchain: Add count fields to struct callchain_node Namhyung Kim
2015-11-23 16:14   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 4/9] perf report: Add callchain value option Namhyung Kim
2015-11-19 13:59   ` Arnaldo Carvalho de Melo
2015-11-20  1:39     ` Namhyung Kim
2015-11-20 12:06       ` Arnaldo Carvalho de Melo
2015-11-23 16:14   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 5/9] perf hists browser: Factor out hist_browser__show_callchain_list() Namhyung Kim
2015-11-23 16:14   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 6/9] perf hists browser: Support flat callchains Namhyung Kim
2015-11-23 16:15   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 7/9] perf hists browser: Support folded callchains Namhyung Kim
2015-11-19 14:19   ` Arnaldo Carvalho de Melo
2015-11-20  1:40     ` Namhyung Kim
2015-11-23 16:15   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 8/9] perf ui/gtk: Support flat callchains Namhyung Kim
2015-11-23 16:15   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-09  5:45 ` [PATCH v5 9/9] perf ui/gtk: Support folded callchains Namhyung Kim
2015-11-23 16:16   ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-11-12 17:50 ` Brendan Gregg [this message]
2015-11-16 23:09   ` [PATCHSET 0/9] perf report: Support folded callchain output (v5) Namhyung Kim
2015-11-17  0:09     ` Arnaldo Carvalho de Melo
2015-11-17  0:22       ` Namhyung Kim
2015-11-17  1:32         ` Arnaldo Carvalho de Melo

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='CAE40pddPUS6e6Tnvw2YAhWi=WNJnvrgtLTTN=bMEuHmWnQWmZg@mail.gmail.com' \
    --to=brendan.d.gregg@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /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.