Re: [tip:timers/core] ftrace: Provide trace clocks monotonic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message -----
> From: "Steven Rostedt" <rostedt@xxxxxxxxxxx>
> To: "tip-bot for Thomas Gleixner" <tipbot@xxxxxxxxx>
> Cc: linux-tip-commits@xxxxxxxxxxxxxxx, "john stultz" <john.stultz@xxxxxxxxxx>, hpa@xxxxxxxxx, mingo@xxxxxxxxxx,
> "mathieu desnoyers" <mathieu.desnoyers@xxxxxxxxxxxx>, peterz@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx
> Sent: Wednesday, July 23, 2014 7:41:46 PM
> Subject: Re: [tip:timers/core] ftrace: Provide trace clocks monotonic
> 
> On Wed, 23 Jul 2014 15:48:03 -0700
> tip-bot for Thomas Gleixner <tipbot@xxxxxxxxx> wrote:
> 
> > Commit-ID:  1b3e5c0936046e7e023149ddc8946d21c2ea20eb
> > Gitweb:
> > http://git.kernel.org/tip/1b3e5c0936046e7e023149ddc8946d21c2ea20eb
> > Author:     Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > AuthorDate: Wed, 16 Jul 2014 21:05:25 +0000
> > Committer:  John Stultz <john.stultz@xxxxxxxxxx>
> > CommitDate: Wed, 23 Jul 2014 15:01:55 -0700
> > 
> > ftrace: Provide trace clocks monotonic
> > 
> > Expose the new NMI safe accessor to clock monotonic to the tracer.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> > Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
> > ---
> >  kernel/trace/trace.c | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index f243444..84e2b45 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -806,11 +806,12 @@ static struct {
> >  	const char *name;
> >  	int in_ns;		/* is this clock in nanoseconds? */
> >  } trace_clocks[] = {
> > -	{ trace_clock_local,	"local",	1 },
> > -	{ trace_clock_global,	"global",	1 },
> > -	{ trace_clock_counter,	"counter",	0 },
> > -	{ trace_clock_jiffies,	"uptime",	1 },
> > -	{ trace_clock,		"perf",		1 },
> > +	{ trace_clock_local,		"local",	1 },
> > +	{ trace_clock_global,		"global",	1 },
> > +	{ trace_clock_counter,		"counter",	0 },
> > +	{ trace_clock_jiffies,		"uptime",	1 },
> > +	{ trace_clock,			"perf",		1 },
> > +	{ ktime_get_mono_fast_ns,	"mono",		1 },
> 
> Thomas,
> 
> Can we please call this something else. "mono" is rather ambiguous as
> all the clocks are monotonic. In fact, the only real monotonic one is
> "global" as it synchronizes to keep true order. Oh, "counter" is
> another one, but it's not actually a clock. If I understand correctly,
> this new "mono" clock may not actually be monotonic between CPUs.
> 
> I rather call it "user", as that's the purpose of this clock. To allow
> userspace to use the same clock as the kernel, isn't it?

How do you envision that a user would know what clock this "monotonic nmi-safe
fast clock" correlates with in userspace if it's called "user" clock ? There are
many kinds of user clocks: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW,
and so on....

Therefore, calling it with the same name as the specific user-visible clock
it can correlate with (CLOCK_MONOTONIC) seems like a sane choice to me.

Thanks,

Mathieu

> 
> -- Steve
> 
> >  	ARCH_TRACE_CLOCKS
> >  };
> >  
> 
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux