From: Clark Williams <williams@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Jon Masters" <jcm@redhat.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH 3/3] perf latency builtin command
Date: Tue, 3 Nov 2009 16:00:53 -0600 [thread overview]
Message-ID: <20091103160053.0f0dd357@torg> (raw)
In-Reply-To: <20091103192839.GB21023@elte.hu>
[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]
On Tue, 3 Nov 2009 20:28:39 +0100
Ingo Molnar <mingo@elte.hu> wrote:
>
> Clark, John,
>
> I'm wondering whether we could do something perf event based that makes
> 'perf latency' self-sufficient and eliminates the debugfs interface.
>
> ( We could still merge the first two patches in their current form as
> they are clear improvements in terms of debugfs access within perf -
> so no work is lost and progress is possible. )
Yeah, I figured that the first two patches were improvements. I may
poke around a little more to see if we can factor out some more
duplicate routines.
>
> Basically hwlat_detector is using stop_machine_run() plus a tight rdtsc
> based loop to sample what is happening in the system. Much of
> hwlat_detector.c deals with getting that information (and parameters)
> back and forth between user space and kernel space.
>
> Couldnt we move that functionality a bit closer to perf by creating
> special events in a tight loop that generate a stream of perf events,
> and let the rest of perf events take over the details, and do the
> analysis in the user-space builtin-latency.c code?
>
> Also, do we need stop_machine_run() - couldnt we do the measurement on a
> specific CPU with irqs (and NMIs) disabled [but other CPUs still
> running]?
>
So what would the source of the event's be and how confident would we
be that they're accurate? Jon used stop_machine() so that *nothing*
under the control of Linux is going to happen during the test; no
C-state changes, no interrupts, nada. The intent is that if there's a
gap seen in the TSC values, it's because something happened that's out
of our control.
> This would all still be possible in the .33 timeframe i suspect, as what
> we need is really just a special event (via TRACE_EVENT() perhaps), and
> a way to trigger it via a 'run this many times' parameter. (i.e. event
> injection - we want to have that kind of support in perf events anyway)
>
Hmmm, seems like what you're saying is that we'd poll a free running
perf counter (or some equivalent, still learning about the guts of perf
event system), detect a gap at the low level and just send an event
with that info up to user-space? That would work...
What counter(s) would we use for detecting a gap in time?
> This would simplify and standardize hw-latency detection, without losing
> any utility - and we wouldnt have to go via some special debugfs
> interface to access the hwlat_detect module.
>
> Thoughts?
As long as we feel confident that we can detect temporal gaps with a
performance counter, I'd be ok with it.
Clark
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2009-11-03 22:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-01 21:55 [PATCH 0/3] perf latency command Clark Williams
2009-11-01 21:56 ` [PATCH 1/3] debugfs utility routines for perf Clark Williams
2009-11-08 17:06 ` [tip:perf/core] perf tools: Add " tip-bot for Clark Williams
2009-11-01 21:57 ` [PATCH 2/3] modify perf routines to use new debugfs routines Clark Williams
2009-11-08 17:06 ` [tip:perf/core] perf tools: Modify " tip-bot for Clark Williams
2009-11-01 21:58 ` [PATCH 3/3] perf latency builtin command Clark Williams
2009-11-03 19:28 ` Ingo Molnar
2009-11-03 22:00 ` Clark Williams [this message]
2009-11-04 12:41 ` Ingo Molnar
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=20091103160053.0f0dd357@torg \
--to=williams@redhat.com \
--cc=acme@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=jcm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--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