mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH/RFC 2/2] perfcounters: add an mmap method to allow userspace to read hardware counters
Date: Tue, 17 Mar 2009 19:27:33 +1100	[thread overview]
Message-ID: <18879.24309.827081.959346@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <1237275515.5189.71.camel@laptop>

Peter Zijlstra writes:

> While I think mmap'ed counters is a great idea, I really dont like this
> patch. It adds a second output format unrelated to the regular output
> format, and it doesn't appear to honor the regular output rules either.
> PERF_RECORD_GROUP thingies won't work for example.
> 
> Nor is there any kind of queuing, one might want to have multiple events
> in the mmap buffer..

I think you have misunderstood.  This is not about sampling counters
*at all*.  This is about simple counting counters.

On powerpc, userspace can read the hardware counters directly.  This
stuff lets a program that is counting hardware events on itself do
that and translate the result into a full 64-bit value.  The
information the program needs in order to do this is (a) which
hardware counter (if any) has been assigned to this particular
perf_counter and (b) what the offset between the hardware counter
value and the full 64-bit perf_counter value is.  That, plus a
seqlock-style lock, is what's in the mmapped page.

> I was planning to do this after cleaning up the normal output bits, as
> our current output stuff is a mess:
>  - its spread out over arch code (seems daft to me, we should all output
>    the same)
>  - its useless for pretty much anything but the two apps we currently
>    have
> 
> In particular, it lacks the tid information for sampled data I hinted to
> in the previous email.

Ingo has talked about reusing some of the tracing infrastructure for
reporting perf_counter events to userspace.  That sounds like an
excellent idea to me, and that is why I didn't bother with putting the
event queue into the mmapped page at this stage.  If it makes sense to
add it, it can be added later.

Paul.

  reply	other threads:[~2009-03-17  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17  5:42 Paul Mackerras
2009-03-17  7:38 ` Peter Zijlstra
2009-03-17  8:27   ` Paul Mackerras [this message]
2009-03-17  8:41     ` Peter Zijlstra
2009-03-17  9:24       ` Paul Mackerras

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=18879.24309.827081.959346@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®