mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Deng-Cheng Zhu <dczhu@mips.com>
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC PATCH 2/2] tools/perf: Make group_fd static and move its place in __perf_evsel__open()
Date: Wed, 26 Oct 2011 09:21:54 -0200	[thread overview]
Message-ID: <20111026112154.GC9467@ghostprotocols.net> (raw)
In-Reply-To: <20111026111828.GB9467@ghostprotocols.net>

Em Wed, Oct 26, 2011 at 09:18:28AM -0200, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Oct 26, 2011 at 02:26:03PM +0800, Deng-Cheng Zhu escreveu:
> > With _only_ your patch applied, I tested with the following commands on
> > MIPS 74K (4 counters available in total):

> > perf stat -g -e
> > L1-dcache-load-misses,cycles,LLC-load-misses,iTLB-loads,instructions
> > find / >/dev/null

> > I tried to group up to 5 events in the hope of seeing NOSPC error. But
> > the command didn't fail and output:

> >  Performance counter stats for 'find /':

> >            9300823 L1-dcache-load-misses
> >      <not counted> cycles
> >      <not counted> LLC-load-misses
> >      <not counted> iTLB-loads
> >      <not counted> instructions

> >        8.463207591 seconds time elapsed

> > This is due to the event state check in validate_group() filtering out
> > the grouped events in OFF state. They are in OFF state because we are
> > running the command with the perf tool as opposed to attaching to an
> > existing task:

> > builtin-stat.c:create_perf_stat_counter():

> >         if (target_pid == -1 && target_tid == -1) {
> >                 attr->disabled = 1;
> >                 attr->enable_on_exec = 1;
> >         }
> 
> But they should be in OFF state only till the target program gets
> exec'ed, right?
>  
> > I suppose X86 has this issue too -- collect_events() in validate_group()
> > won't do real work in the bottom half of the function.
> 
> I'm testing that now.

[root@emilia ~]# perf stat -g -e L1-dcache-load-misses,cycles,LLC-load-misses,iTLB-loads,instructions find / >/dev/null

 Performance counter stats for 'find /':

       158,807,949 L1-dcache-load-misses                                       
     <not counted> cycles                  
     <not counted> LLC-load-misses         
     <not counted> iTLB-loads              
     <not counted> instructions            

     100.676645958 seconds time elapsed

[root@emilia ~]# 

Yeah, reading more code...

- Arnaldo

  reply	other threads:[~2011-10-26 11:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 10:56 [RFC PATCH 0/2] tools/perf: fix the event grouping functionality Deng-Cheng Zhu
2011-10-24 10:56 ` [RFC PATCH 1/2] tools/perf: Don't set attr->disabled when doing grouping Deng-Cheng Zhu
2011-10-24 14:19   ` David Ahern
2011-10-25  7:26     ` Peter Zijlstra
2011-10-24 10:57 ` [RFC PATCH 2/2] tools/perf: Make group_fd static and move its place in __perf_evsel__open() Deng-Cheng Zhu
2011-10-24 14:03   ` Arnaldo Carvalho de Melo
2011-10-25 15:23     ` Arnaldo Carvalho de Melo
2011-10-26  6:26       ` Deng-Cheng Zhu
2011-10-26 11:18         ` Arnaldo Carvalho de Melo
2011-10-26 11:21           ` Arnaldo Carvalho de Melo [this message]
2011-10-26 13:14           ` Zhu, DengCheng

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=20111026112154.GC9467@ghostprotocols.net \
    --to=acme@ghostprotocols.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dczhu@mips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

Powered by JetHome