Thread (20 messages) flat view 20 messages, 8 authors, 2014-11-05

Re: [PATCH v3 1/3] perf: Use monotonic clock as a source for timestamps

From: Pawel Moll <hidden>
Date: 2014-11-04 15:25:41
Also in: lkml

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:
quoted
+int sysctl_perf_sample_time_clk_id = CLOCK_MONOTONIC;
const ?
Sure (unless we have to change it as mentioned below)
quoted
 /*
  * 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help