public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 3/3] perf report: Add --show-time-info option
@ 2013-12-02 19:23 Arnaldo Carvalho de Melo
  2013-12-02 19:25 ` David Ahern
  0 siblings, 1 reply; 11+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-12-02 19:23 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Jiri Olsa, David Ahern, Stephane Eranian, Andi Kleen,
	Pekka Enberg, Frederic Weisbecker

Em Mon, Dec 02, 2013 at 11:38:20PM +0900, Namhyung Kim escreveu:
> Hi Arnaldo,
> 
> 2013-12-02 (월), 09:33 -0300, Arnaldo Carvalho de Melo:
> > Em Mon, Dec 02, 2013 at 03:53:19PM +0900, Namhyung Kim escreveu:
> > > From: Namhyung Kim <namhyung.kim@lge.com>
> > > 
> > > The --show-time-info option is for displaying elapsed sampling time
> > 
> > Isn't that too long? Can't we use just --time/-t?
> 
> Hmm.. interesting.  Your previous feedback was to use longer and clearer
> option name. :)

> https://lkml.org/lkml/2013/11/18/198
 
Hey, longer and more descriptive names _when required_, in that case I
thought that even being longer --show-task-events would be better, but
here using --show-time-info the 'info' part looks superfluous, at least
to me, hence my suggestion/question :-)

<SNIP>

> > > +++ b/tools/perf/ui/hist.c
> > > @@ -7,19 +7,24 @@
> > >  #include "../util/evsel.h"
> > >  
> > >  /* hist period print (hpp) functions */
> > > +enum hpp_fmt_type {
> > > +	HPP_FMT__PERCENT,
> > > +	HPP_FMT__RAW,
> > > +	HPP_FMT__TIME,
> > > +};
> > 
> > I wonder if we can't make this a bitmask... Does it make sense to print
> > both percent and time, for instance?
> 
> I'm not sure I understood you correctly, but did you mean printing both
> percent and time in a single column?  This enum and the __hpp_fmt()
> function is for a single column.  I can add a new column for time
> percent if you want.

I have not delved into the code, it was just a first impression, lemme
do that now...
 
- Arnaldo

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [RFC 0/3] perf tools: Show time info (v1)
@ 2013-12-02  6:53 Namhyung Kim
  2013-12-02  6:53 ` [PATCH 3/3] perf report: Add --show-time-info option Namhyung Kim
  0 siblings, 1 reply; 11+ messages in thread
From: Namhyung Kim @ 2013-12-02  6:53 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Jiri Olsa, David Ahern, Stephane Eranian, Andi Kleen,
	Pekka Enberg, Frederic Weisbecker

Hi,

Sometimes users might want to see time information along with the
performance result but the perf cannot provide it currently.

In this patchset, I added such feature using sample->time.  When the
perf processes sample events, it calculate time info and update last
timestamp.  It keeps the last timestamp for each evsel (and for each
cpu if it's a per-cpu session).

It guesses whether a session is per-cpu if it found PERF_SAMPLE_CPU in
a evsel->attr.sample_type since I couldn't find a better way.  However
it'll have a trouble if used with tracepoint events since they require
the cpu info in the sample_type even for the per-thread sessions.

The sample time will usually be proportional to the overhead but
sometimes it show a different result especially in idle state.

With this patch, perf report can show time information in the header
(on --stdio output only for now) and a new column which can be enabled
by --show-time-info option.

  $ perf record -- perf bench sched messaging
  $ perf report --stdio --show-time-info

  # Samples: 10K of event 'cycles'
  # Event count (approx.): 5168954556
  # Total sampling time  : 0.179102 (sec)       <--- here
  #
  # Overhead        Time          Command       Shared Object                        Symbol
  # ........  ..........  ...............  ..................  ............................
  #
       6.59%    0.006093  sched-messaging  [unknown]           [.] 0x0000003153ebc7ed
       4.81%    0.005354  sched-messaging  [kernel.kallsyms]   [k] copy_user_generic_string
       3.89%    0.004098  sched-messaging  [kernel.kallsyms]   [k] avc_has_perm_flags
       3.77%    0.003630  sched-messaging  [kernel.kallsyms]   [k] unix_stream_recvmsg
       3.37%    0.003733  sched-messaging  [kernel.kallsyms]   [k] _raw_spin_lock
       2.97%    0.003489  sched-messaging  [kernel.kallsyms]   [k] _raw_spin_lock_irqsave
       2.73%    0.002615  sched-messaging  [kernel.kallsyms]   [k] __slab_free
       2.56%    0.002392  sched-messaging  [kernel.kallsyms]   [k] page_fault
       2.45%    0.002572  sched-messaging  [kernel.kallsyms]   [k] sock_alloc_send_pskb

I put the series on 'perf/time-sample-v1' branch in my tree:

  git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Any comments are welcome, thanks
Namhyung


Namhyung Kim (3):
  perf tools: Record total sampling time
  perf tools: Record sampling time for each entry
  perf report: Add --show-time-info option

 tools/perf/builtin-annotate.c |  2 +-
 tools/perf/builtin-diff.c     |  2 +-
 tools/perf/builtin-report.c   | 26 +++++++++++++----
 tools/perf/builtin-top.c      |  2 +-
 tools/perf/tests/hists_link.c |  4 +--
 tools/perf/ui/hist.c          | 68 ++++++++++++++++++++++++++++++++++++-------
 tools/perf/util/evsel.h       |  3 ++
 tools/perf/util/hist.c        | 15 ++++++----
 tools/perf/util/hist.h        |  4 ++-
 tools/perf/util/session.c     | 49 +++++++++++++++++++++++++++++++
 tools/perf/util/sort.h        |  1 +
 tools/perf/util/symbol.h      |  3 +-
 12 files changed, 151 insertions(+), 28 deletions(-)

-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-12-04 12:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 19:23 [PATCH 3/3] perf report: Add --show-time-info option Arnaldo Carvalho de Melo
2013-12-02 19:25 ` David Ahern
2013-12-02 19:38   ` Arnaldo Carvalho de Melo
2013-12-02 19:58     ` David Ahern
2013-12-02 20:17       ` Arnaldo Carvalho de Melo
2013-12-02 20:22         ` David Ahern
2013-12-04 10:11         ` Ingo Molnar
2013-12-04 12:57           ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2013-12-02  6:53 [RFC 0/3] perf tools: Show time info (v1) Namhyung Kim
2013-12-02  6:53 ` [PATCH 3/3] perf report: Add --show-time-info option Namhyung Kim
2013-12-02 12:33   ` Arnaldo Carvalho de Melo
2013-12-02 14:38     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox