public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <andi@firstfloor.org>,
	Pekka Enberg <penberg@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 1/3] perf tools: Record total sampling time
Date: Tue, 03 Dec 2013 00:05:49 +0900	[thread overview]
Message-ID: <1385996749.1710.34.camel@leonhard> (raw)
In-Reply-To: <20131202124527.GB22212@gmail.com>

Hi Ingo,

2013-12-02 (월), 13:45 +0100, Ingo Molnar:
> * Namhyung Kim <namhyung@kernel.org> wrote:
> 
> > From: Namhyung Kim <namhyung.kim@lge.com>
> > 
> > It's sometimes useful to see total sampling or elapsed time with
> > normal performance result.  To do that, record first and last sample
> > time for each evsel and to display it in the header (--stdio only for
> > now).
> > 
> >   $ perf record -a sleep 1
> >   $ perf report --stdio
> >   ...
> >   # Samples: 4K of event 'cycles'
> >   # Event count (approx.): 4087481688
> >   # Total sampling time  : 1.001260 (sec)
> 
> Btw., would it make sense to output it using the 'perf stat' print-out 
> machinery?
> 
> If the 'count' of every event sampled is saved in the perf.data, 
> including elapsed time, at the beginning and at the end, then all 
> information is there to output things in perf stat style.

Yeah, it'd be great if we can share same code in the end.

> 
> ( It might even make sense to save two more timestamps: rusage stime
>   and utime - that way the output could be made /usr/bin/time-alike. )

Hmm.. I think I can do it by adding time info according to a cpumode in
a sample.

> 
> Also I think there is some related existing functionality, I think 
> Stephane added a way to essentially do non-sampling 'perf stat' via 
> perf record - but the details escape me, I think it was related to the 
> -n option?

I have no idea about the perf record -n/--no-samples option.  It looks
like something related to task stat?

  commit 649c48a9e7fafcc72bfcc99471d9dea98d789d59
  Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
  Date:   Wed Jun 24 21:12:48 2009 +0200
  
      perf-report: Add modes for inherited stats and no-samples
      
      Now that we can collect per task statistics, add modes that
      make use of that facility.
      
      Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <new-submission>
      Signed-off-by: Ingo Molnar <mingo@elte.hu>


But everytime I tried to use it, perf report always complained about the
file has no samples.. :-/

> 
> So what we want here is in essence a sampling mode that can record and 
> report all the absolute counts as well.

Agreed.

Thanks,
Namhyung



  parent reply	other threads:[~2013-12-02 15:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02  6:53 [RFC 0/3] perf tools: Show time info (v1) Namhyung Kim
2013-12-02  6:53 ` [PATCH 1/3] perf tools: Record total sampling time Namhyung Kim
2013-12-02 12:45   ` Ingo Molnar
2013-12-02 12:57     ` Ingo Molnar
2013-12-02 15:43       ` Namhyung Kim
2013-12-02 16:36         ` Ingo Molnar
2013-12-02 20:24           ` Arnaldo Carvalho de Melo
2013-12-03  5:44             ` Namhyung Kim
2013-12-03 14:30               ` David Ahern
2013-12-04 10:00                 ` Ingo Molnar
2013-12-04 10:02             ` Ingo Molnar
2013-12-03  5:33           ` Namhyung Kim
2013-12-02 15:05     ` Namhyung Kim [this message]
2013-12-02 18:51       ` Arnaldo Carvalho de Melo
2013-12-02  6:53 ` [PATCH 2/3] perf tools: Record sampling time for each entry Namhyung Kim
2013-12-02 12:39   ` Arnaldo Carvalho de Melo
2013-12-02 14:57     ` Namhyung Kim
2013-12-02 18:49       ` Arnaldo Carvalho de Melo
2013-12-03  4:33         ` 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
2013-12-02  9:35 ` [RFC 0/3] perf tools: Show time info (v1) Pekka Enberg
2013-12-03  2:28   ` Namhyung Kim
2013-12-02 17:04 ` Andi Kleen
2013-12-03  2:34   ` 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=1385996749.1710.34.camel@leonhard \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=penberg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox