linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pawel Moll <pawel.moll@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Cochran <richardcochran@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>, Paul Mackerras <paulus@samba.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Christopher Covington <cov@codeaurora.org>,
	Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>
Subject: Re: [PATCH v3 1/3] perf: Use monotonic clock as a source for timestamps
Date: Tue, 04 Nov 2014 15:25:27 +0000	[thread overview]
Message-ID: <1415114727.24819.8.camel@arm.com> (raw)
In-Reply-To: <20141104072308.GE10501@worktop.programming.kicks-ass.net>

On Tue, 2014-11-04 at 07:23 +0000, Peter Zijlstra wrote:
> On Tue, Nov 04, 2014 at 12:28:36AM +0000, Pawel Moll wrote:
> 
> > +int sysctl_perf_sample_time_clk_id = CLOCK_MONOTONIC;
> 
> const ?

Sure (unless we have to change it as mentioned below)

> >  /*
> >   * perf samples are done in some very critical code paths (NMIs).
> >   * If they take too much CPU time, the system can lock up and not
> > @@ -324,7 +326,7 @@ extern __weak const char *perf_pmu_name(void)
> >  
> >  static inline u64 perf_clock(void)
> >  {
> > -	return local_clock();
> > +	return ktime_get_mono_fast_ns();
> >  }
> 
> Do we maybe want to make it boot-time switchable back to local_clock for
> people with bad systems and or backwards compat issues?

Very good idea, should have came up with it myself :-)

Does __setup("perf_use_local_clock") sound reasonable? Then we have to
decide whether to hide the sysctl "perf_sample_time_clk_id" (my
preferred option, will see how difficult it is) or just provide an
invalid clock_id (eg. -1) in it.

Cheers!

Pawel


  reply	other threads:[~2014-11-04 15:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  0:28 [PATCH v3 0/3] perf: User/kernel time correlation and event generation Pawel Moll
2014-11-04  0:28 ` [PATCH v3 1/3] perf: Use monotonic clock as a source for timestamps Pawel Moll
2014-11-04  7:23   ` Peter Zijlstra
2014-11-04 15:25     ` Pawel Moll [this message]
2014-11-04 15:30       ` Peter Zijlstra
2014-11-04  0:28 ` [PATCH v3 2/3] perf: Userspace event Pawel Moll
2014-11-04  6:33   ` Namhyung Kim
2014-11-04 16:42     ` Pawel Moll
2014-11-04 18:40       ` Peter Zijlstra
2014-11-05  6:36         ` Namhyung Kim
2014-11-04  0:28 ` [PATCH v3 3/3] perf: Sample additional clock value Pawel Moll
2014-11-04  0:58 ` [PATCH v3 0/3] perf: User/kernel time correlation and event generation Andy Lutomirski
2014-11-04  1:11   ` John Stultz
2014-11-04  1:25     ` Andy Lutomirski
2014-11-04 15:07       ` Pawel Moll
2014-11-04  8:01     ` Arnd Bergmann
2014-11-04  8:27       ` Richard Cochran
2014-11-04 10:49         ` Thomas Gleixner
2014-11-04 16:11           ` Arnd Bergmann
2014-11-04 16:04       ` John Stultz
2014-11-04  8:24     ` Richard Cochran
2014-11-04  9:24 ` Masami Hiramatsu
2014-11-04 15:51   ` Pawel Moll
2014-11-05  8:06     ` Masami Hiramatsu

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=1415114727.24819.8.camel@arm.com \
    --to=pawel.moll@arm.com \
    --cc=acme@kernel.org \
    --cc=cov@codeaurora.org \
    --cc=dsahern@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tomeu@tomeuvizoso.net \
    /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;
as well as URLs for NNTP newsgroup(s).