public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Brice Goglin" <Brice.Goglin@inria.fr>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Mike Galbraith" <efault@gmx.de>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	paulus@samba.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf report: Display per-thread event counters
Date: Sat, 8 Aug 2009 14:14:56 +0200	[thread overview]
Message-ID: <20090808121456.GA14671@elte.hu> (raw)
In-Reply-To: <4A7C162C.1030707@inria.fr>


* Brice Goglin <Brice.Goglin@inria.fr> wrote:

> Here's a better patch. I moved everything to utils/values.[ch] so 
> that we may reuse it in perf stat. [...]

Nice patch! I've applied it, you can find it in the latest -tip 
tree:

  http://people.redhat.com/mingo/tip.git/README

please send enhancements/fixes on top of this.

> [...] But I don't see yet where I am suppose to get something like 
> PERF_READ_EVENT in builtin-stat.c so I haven't touched it yet.

Yeah. 'perf stat' is not really getting events but is doing a 
read-out of the counter value(s) and constructs its 'read event' 
that way. So you wont find PERF_READ_EVENT in builtin-stat.c, you'll 
find:

                res = read(fd[cpu][counter], single_count, nv * sizeof(u64));

in read_counter(). The printout is then done in print_counter().

> We get something like this now:
> #  PID   TID  cache-misses  cache-references
>   4658  4659        495581           3238779
>   4658  4662        498246           3236823
>   4658  4663        499531           3243162
> 
> Then it'll be easy to add --pretty=raw to display a single line 
> per thread/event.

ok.

> By the way, -S was also used for --symbol... So I used -T/--thread 
> here.

Hm, indeed - and -s was taken for --sort. Maybe we could rename 
-S/--symbols to -y/--symbols - this too is an i think rarely used 
feature.

I think pure 'statistics' runs like you do will be a pretty popular 
workflow, so intuitive naming/placement of options is important.

> perf report: Add -T/--threads to display per-thread counter values
>     
> We get something like this now:
> #  PID   TID  cache-misses  cache-references
>   4658  4659        495581           3238779
>   4658  4662        498246           3236823
>   4658  4663        499531           3243162

Btw., another thing to do would be to allow the 'dual' recording of 
both the stat values (collected when threads exit) and regular 
samples that perf report deals with.

I.e. dont handle 'perf record -s' as an exclusive thing to regular 
'perf record', but instead have -s/--sample-type option that can 
have such combinations:

  -s stats
  -s samples
  -s call-graph

And any combination thereof, such as:

  -s stats,samples

The default would be '-s samples'. Right now call-graph recording is 
triggered via a separate option (-g/--call-graph) - but maybe it 
could be merged into a more generic -s/--sample option mechanism?

	Ingo

  parent reply	other threads:[~2009-08-08 12:15 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 20:54 [perf] howto switch from pfmon Brice Goglin
2009-06-23 12:12 ` Andi Kleen
2009-06-23 12:23   ` Peter Zijlstra
2009-06-23 13:57   ` Ingo Molnar
2009-06-23 13:14 ` Ingo Molnar
2009-06-23 13:22   ` Peter Zijlstra
2009-06-23 13:38     ` Ingo Molnar
2009-06-23 13:25   ` Ingo Molnar
2009-06-23 13:47   ` Ingo Molnar
2009-06-23 14:00     ` Brice Goglin
2009-06-23 14:36       ` Ingo Molnar
2009-06-23 15:22         ` Brice Goglin
2009-06-29 19:29           ` Ingo Molnar
2009-08-06 16:59             ` Brice Goglin
2009-08-06 17:40               ` Peter Zijlstra
2009-08-06 17:48                 ` Brice Goglin
2009-08-06 17:59                   ` Peter Zijlstra
2009-08-06 18:57                   ` [PATCH] perf tools: Fix reading of perf.data file header Peter Zijlstra
2009-08-06 19:03                     ` Brice Goglin
2009-08-06 19:59                       ` Ingo Molnar
2009-08-06 20:03                         ` Brice Goglin
2009-08-06 23:35                         ` Brice Goglin
2009-08-07  6:13                           ` Brice Goglin
2009-08-07  6:32                           ` Ingo Molnar
2009-08-07  7:38                             ` Brice Goglin
2009-08-07  7:45                               ` Ingo Molnar
2009-08-07  8:18                                 ` Brice Goglin
2009-08-07  8:23                                   ` Ingo Molnar
2009-08-07  8:27                                   ` Ingo Molnar
2009-08-07  8:30                                   ` [tip:perfcounters/core] perf stat: Rename -S/--scale to -c/--scale tip-bot for Brice Goglin
2009-08-07 11:55                             ` [PATCH] perf report: Display per-thread event counters Brice Goglin
2009-08-08 11:54                               ` [tip:perfcounters/core] perf report: Fix and improve the displaying of " tip-bot for Brice Goglin
2009-08-08 12:14                               ` Ingo Molnar [this message]
2009-08-08 16:10                                 ` [PATCH] perf report: Display " Brice Goglin
2009-08-08 16:13                                   ` Ingo Molnar
2009-08-07  6:37                     ` [tip:perfcounters/urgent] perf tools: Fix multi-counter stat bug caused by incorrect reading of perf.data file header tip-bot for Peter Zijlstra
2009-08-07  7:39                     ` tip-bot for Peter Zijlstra
2009-08-06 19:01                 ` [perf] howto switch from pfmon Brice Goglin
2009-06-23 14:21   ` Brice Goglin
2009-06-23 14:51     ` Ingo Molnar
2009-06-23 15:29       ` Jaswinder Singh Rajput

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=20090808121456.GA14671@elte.hu \
    --to=mingo@elte.hu \
    --cc=Brice.Goglin@inria.fr \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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