public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	fweisbec@gmail.com
Subject: Re: [PATCH] basic perf support for sparc
Date: Fri, 4 Sep 2009 08:44:18 +0200	[thread overview]
Message-ID: <20090904064418.GB29829@elte.hu> (raw)
In-Reply-To: <20090904063419.GO18599@kernel.dk>


* Jens Axboe <jens.axboe@oracle.com> wrote:

> On Fri, Sep 04 2009, Jens Axboe wrote:
> > On Thu, Sep 03 2009, David Miller wrote:
> > > From: Ingo Molnar <mingo@elte.hu>
> > > Date: Fri, 4 Sep 2009 07:02:56 +0200
> > > 
> > > > 
> > > > * David Miller <davem@davemloft.net> wrote:
> > > > 
> > > >> Does this build for you without adding an
> > > >> arch/sparc/include/asm/perf_counter.h that looks
> > > >> something like the following?
> > > >> 
> > > >> #ifndef _ASM_SPARC_PERF_COUNTER_H
> > > >> #define _ASM_SPARC_PERF_COUNTER_H
> > > >> 
> > > >> #define PERF_COUNTER_INDEX_OFFSET	0
> > > >> 
> > > >> #endif
> > > >> 
> > > >> Or is this somehow now required in the -tip trees?
> > > > 
> > > > This used to be required but i recently fixed this (and that fix is 
> > > > upstream as well) via:
> > > > 
> > > >   f738eb1: perf_counter: Fix the PARISC build
> > > > 
> > > > there's now a default define of 0 so you dont have to define it and 
> > > > can leave out this chunk.
> > > > 
> > > > ( That index is only interesting if the architecture has a way to 
> > > >   allow unprivileged user-space to access counter registers 
> > > >   directly. In that case the index reflects the offset from the 
> > > >   (constantly changing) dynamix index which we put into the mmap 
> > > >   header. With Sparc not having a hw-PMU implementation this index 
> > > >   is entirely uninteresting at this stage. )
> > > 
> > > But you still do need at least an empty perf_counter.h file
> > > right?  Jens must have left the file out of his submission
> > > by accident, and that's what I'm trying to get to the bottom
> > > of here :-)
> > > 
> > > I assume there was a similar change to deal with references to
> > > set_perf_counter_pending() too or is at least a NOP definition
> > > still needed?
> > 
> > It wasn't required when I built and used it (and sent the 
> > patch), I used the posted patch as-is. It's been a few weeks 
> > since I last updated and ran that box, let me double check after 
> > morning coffee and send you a fresh patch (if needed) :-)
> 
> It seems I had a left-over arch/sparc/include/asm/perf_counter.h 
> from earlier experiments that was never checked in, so that is why 
> it worked for me. include/linux/sched.h does:
> 
> #ifdef CONFIG_PERF_COUNTERS
> # include <asm/perf_counter.h>
> #endif
> 
> so that's no way around an empty stub file. Updated patch below, 
> this is what I have been using.

That stub is not wasted: it will be filled in with real arch hw-PMU 
details, once that's implemented too.

hw-PMU support has its advantages: it can provide NMI sampling that 
allows 'perf report' to pierce irqs-off critical sections, and it 
also gives access to non-time based metrics such as instructions, 
cache-misses, etc. - depending on what the CPU can do.

That way you can tell at a glance what a workload does:

 aldebaran:~> perf stat ./hackbench 10
 Time: 0.109

 Performance counter stats for './hackbench 10':

    1191.574039  task-clock-msecs         #      7.768 CPUs 
          50363  context-switches         #      0.042 M/sec
           4249  CPU-migrations           #      0.004 M/sec
          17710  page-faults              #      0.015 M/sec
     3600730931  cycles                   #   3021.827 M/sec
     1573681316  instructions             #      0.437 IPC  
       15394883  cache-references         #     12.920 M/sec
        5005241  cache-misses             #      4.201 M/sec

    0.153389368  seconds time elapsed

without hw-PMU support it looks like this:

 venus:~> perf stat ./hackbench 1
 Time: 7.600

 Performance counter stats for './hackbench 1':

   28218.316944  task-clock-ticks     #       3.590 CPU utilization factor
          62700  context-switches     #       0.002 M/sec
          11112  CPU-migrations       #       0.000 M/sec
           1919  page-faults          #       0.000 M/sec
  <not counted>  cycles              
  <not counted>  instructions        
  <not counted>  cache-references    
  <not counted>  cache-misses        

 Wall-clock time elapsed:  7860.000004 msecs

The soft stats and time measurements work just fine - the hardware 
metrics are not counted.

	Ingo

  reply	other threads:[~2009-09-04  6:44 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-29 11:25 [PATCH] basic perf support for sparc Jens Axboe
2009-07-29 19:28 ` Jens Axboe
2009-08-01  1:14   ` Anton Blanchard
2009-08-01  8:20     ` Jens Axboe
2009-08-01 18:22       ` Arnaldo Carvalho de Melo
2009-08-02 18:41         ` Ingo Molnar
2009-08-02 19:44           ` Kyle McMartin
2009-08-02 19:50             ` Ingo Molnar
2009-08-02 20:11               ` Kyle McMartin
2009-08-02 20:33                 ` Ingo Molnar
2009-08-02 20:47                 ` Arnaldo Carvalho de Melo
2009-08-03  1:54                   ` Arnaldo Carvalho de Melo
2009-08-04  3:33                     ` Kyle McMartin
2009-08-04  9:25                     ` Ingo Molnar
2009-08-04  9:29                       ` Peter Zijlstra
2009-08-04 13:02                         ` David Miller
2009-08-04 10:32                       ` Frederic Riss
2009-08-04 10:38                         ` Peter Zijlstra
2009-08-04 11:23                           ` Frederic Riss
2009-08-04 11:28                       ` Ingo Molnar
2009-08-05 12:10             ` Peter Zijlstra
2009-08-05 12:21               ` Jens Axboe
2009-08-05 12:33                 ` Ingo Molnar
2009-08-05 12:16       ` [tip:perfcounters/urgent] perf: Auto-detect libbfd tip-bot for Peter Zijlstra
2009-08-05 14:29         ` Peter Zijlstra
2009-08-05 18:58           ` Peter Zijlstra
2009-08-02 20:17 ` [PATCH] basic perf support for sparc David Miller
2009-08-02 20:25   ` Ingo Molnar
2009-08-06  7:02   ` Jens Axboe
2009-08-12 18:06     ` David Miller
2009-08-12 18:13       ` Jens Axboe
2009-08-17  1:31     ` David Miller
2009-08-17  6:48       ` Jens Axboe
2009-08-17  7:57         ` Ingo Molnar
2009-09-04  4:37         ` David Miller
2009-09-04  5:02           ` Ingo Molnar
2009-09-04  5:09             ` David Miller
2009-09-04  5:20               ` Jens Axboe
2009-09-04  6:34                 ` Jens Axboe
2009-09-04  6:44                   ` Ingo Molnar [this message]
2009-09-04  9:57                   ` David Miller

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=20090904064418.GB29829@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=davem@davemloft.net \
    --cc=fweisbec@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.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