public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andi Kleen <andi@firstfloor.org>, Wang Nan <wangnan0@huawei.com>
Subject: Re: [PATCH 5/6] perf tools: Add dynamic sort key for tracepoint events
Date: Tue, 15 Dec 2015 21:37:36 +0900	[thread overview]
Message-ID: <20151215123736.GA25160@danjae.kornet> (raw)
In-Reply-To: <20151215122229.GA20514@krava.brq.redhat.com>

On Tue, Dec 15, 2015 at 01:22:29PM +0100, Jiri Olsa wrote:
> On Tue, Dec 15, 2015 at 09:07:03PM +0900, Namhyung Kim wrote:
> > On Tue, Dec 15, 2015 at 09:53:09AM +0100, Jiri Olsa wrote:
> > > On Tue, Dec 15, 2015 at 12:46:12AM +0900, Namhyung Kim wrote:
> > > 
> > > SNIP
> > > 
> > > > 
> > > >   $ perf report -s comm,sched:sched_switch.next_pid,sched:sched_switch.next_comm --stdio
> > > >   ...
> > > >   # Overhead  Command            next_pid         next_comm
> > > >   # ........  ...............  ..........  ................
> > > >   #
> > > >       20.86%  swapper               17773   transmission-gt
> > > >        9.64%  transmission-gt           0         swapper/0
> > > >        9.16%  transmission-gt           0         swapper/2
> > > >        5.25%  swapper                 109      kworker/0:1H
> > > >        5.21%  kworker/0:1H              0         swapper/0
> > > >        2.14%  netctl-auto               0         swapper/2
> > > >        1.98%  netctl-auto               0         swapper/0
> > > >        1.98%  swapper                6524            Xephyr
> > > >        1.98%  swapper               27478       netctl-auto
> > > >        1.78%  transmission-gt           0         swapper/3
> > > >        1.53%  Xephyr                    0         swapper/0
> > > >        1.29%  netctl-auto               0         swapper/1
> > > >        1.29%  swapper               27476       netctl-auto
> > > >        1.21%  netctl-auto               0         swapper/3
> > > >        1.17%  swapper                 233    irq/33-iwlwifi
> > > > 
> > > > Note that pid 0 exists for each cpu so have comm of 'swapper/N'.
> > > 
> > > could we also add by default all tracepoint fields in case none
> > > is specified and the event to display is tracepoint?
> > 
> > Seems like a good suggestion.  We can check if there's only one
> > tracepoint event, then use dynamic sort keys for all fields.  But I
> > think we should skip common fields in that case.
> > 
> > > 
> > > also an extra field that would hold/show the 'print fmt' display ? 
> > 
> > Do you want a single extra field per event or per field?
> 
> hm, so the 'print fmt' defines the intended output from the tracepoint,
> like for sched_switch:
> 
>   print fmt: "prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d next_prio=%d", REC->prev_comm, REC->prev_pid, REC->prev_prio, REC->prev_state & (2048-1) ? __print_flags(REC->prev_state & (2048-1), "|", { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, { 16, "Z" }, { 32, "X" }, { 64, "x" }, { 128, "K" }, { 256, "W" }, { 512, "P" }, { 1024, "N" }) : "R", REC->prev_state & 2048 ? "+" : "", REC->next_comm, REC->next_pid, REC->next_prio
> 
> gets you (perf script can already do that):
> 
>   perf:21226 [120] S ==> swapper/0:0 [120]
> 
> 
> so maybe have a option or ahve a special field like 'fmt'
> that would carry/display this translation
> 
>   perf report -s comm,fmt
> 
> could be combined with other fields if needed..

OK.  I'll try to implement the 'fmt' sort key and use it for
tracepoint events by default.

Thanks,
Namhyung

  reply	other threads:[~2015-12-15 12:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 15:46 [RFC/PATCHSET 0/6] perf tools: Support dynamic sort keys for tracepoints (v1) Namhyung Kim
2015-12-14 15:46 ` [PATCH 1/6] perf hist: Pass struct sample to __hists__add_entry() Namhyung Kim
2015-12-14 15:46 ` [PATCH 2/6] perf hist: Save raw_data/size for tracepoint events Namhyung Kim
2015-12-14 15:46 ` [PATCH 3/6] tools lib traceevent: Factor out and export print_event_field() Namhyung Kim
2015-12-14 15:46 ` [PATCH 4/6] perf tools: Pass evlist to setup_sorting() Namhyung Kim
2015-12-14 15:46 ` [PATCH 5/6] perf tools: Add dynamic sort key for tracepoint events Namhyung Kim
2015-12-15  8:53   ` Jiri Olsa
2015-12-15 12:07     ` Namhyung Kim
2015-12-15 12:22       ` Jiri Olsa
2015-12-15 12:37         ` Namhyung Kim [this message]
2015-12-14 15:46 ` [PATCH 6/6] perf tools: Try to show pretty printed output for dynamic sort keys Namhyung Kim
2015-12-15  9:03   ` Jiri Olsa
2015-12-15 10:36     ` Arnaldo Carvalho de Melo
2015-12-15 12:13       ` Namhyung Kim
2015-12-15 12:24         ` Jiri Olsa
2015-12-15 12:42           ` Namhyung Kim
2015-12-15 12:52             ` Jiri Olsa
2015-12-14 17:47 ` [RFC/PATCHSET 0/6] perf tools: Support dynamic sort keys for tracepoints (v1) Arnaldo Carvalho de Melo
2015-12-14 22:32   ` David Ahern
2015-12-15  1:41     ` 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=20151215123736.GA25160@danjae.kornet \
    --to=namhyung@kernel.org \
    --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=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox