All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: perf_counter: request for three more sample data options
Date: Fri, 3 Apr 2009 18:38:01 +0200	[thread overview]
Message-ID: <20090403163756.GH3226@erda.amd.com> (raw)
In-Reply-To: <18901.52735.579687.568717@cargo.ozlabs.ibm.com>

On 03.04.09 19:51:11, Paul Mackerras wrote:
> Peter Zijlstra writes:
> 
> > What I was thinking of was re-using some of the cpu_clock()
> > infrastructure. That provides us with a jiffy based GTOD sample,
> > cpu_clock() then uses TSC and a few filters to compute a current
> > timestamp.
> > 
> > I was thinking about cutting back those filters and thus trusting the
> > TSC more -- which on x86 can do any random odd thing. So provided the
> > TSC is not doing funny the results will be ok-ish.
> > 
> > This does mean however, that its not possible to know when its gone bad.
> 
> I would expect that perfmon would be just reading the TSC and
> recording that.  If you can read the TSC and do some correction then
> we're ahead. :)
> 
> > The question to Paul is, does the powerpc sched_clock() call work in NMI
> > -- or hard irq disable -- context?
> 
> Yes - timekeeping is one area where us powerpc guys can be smug. :)
> We have a per-core, 64-bit timebase register which counts at a
> constant frequency and is synchronized across all cores.  So
> sched_clock works in any context on powerpc - all it does is read the
> timebase and do some simple integer arithmetic on it.

Ftrace is using ring_buffer_time_stamp() that finally uses
sched_clock(). But I am not sure if the time is correct when calling
from an NMI handler.

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com


  reply	other threads:[~2009-04-03 16:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03  1:46 perf_counter: request for three more sample data options Corey Ashford
2009-04-03  7:01 ` Peter Zijlstra
2009-04-03  7:25   ` Corey Ashford
2009-04-03  7:51     ` Peter Zijlstra
2009-04-03  8:51       ` Paul Mackerras
2009-04-03 16:38         ` Robert Richter [this message]
2009-04-03 16:41           ` Ingo Molnar
2009-04-03 16:59             ` Peter Zijlstra
2009-04-03 17:05               ` Ingo Molnar
2009-04-03 16:32       ` 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=20090403163756.GH3226@erda.amd.com \
    --to=robert.richter@amd.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=cjashfor@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.