mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sonny Rao <sonnyrao@chromium.org>
Cc: Stephane Eranian <eranian@google.com>,
	Josh Triplett <josh@joshtriplett.org>,
	LKML <linux-kernel@vger.kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Olof Johansson <olof@lixom.net>, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	pawel.moll@arm.com
Subject: Re: [RFC PATCH] drivers: char: Add a dynamic clock for the trace clock
Date: Wed, 11 Dec 2013 20:49:00 -0500	[thread overview]
Message-ID: <20131211204900.76993a7d@gandalf.local.home> (raw)
In-Reply-To: <CAPz6YkU6-ccJ8eJwYUgs_Gjo5rYeSh3ftSgd_MzCXRTyzhPiiQ@mail.gmail.com>

On Wed, 11 Dec 2013 17:17:30 -0800
Sonny Rao <sonnyrao@chromium.org> wrote:

> On Wed, Dec 11, 2013 at 11:30 AM, Stephane Eranian <eranian@google.com> wrote:
> > Sonny,
> >
> > Your patch has a couple of problems for me:
> >  - requires CONFIG_TRACING
> >
> > You should directly invoke getrawmonotonic()
> >  and inline the code from trace_clock_getres().
> >
> > That's how I managed to compile your kernel module on my system.
> 
> You need the changes in kernel/trace/trace.c which is why it's
> dependent on CONFIG_TRACING.
> If we put those functions elsewhere we could remove that dependency,
> but it sounds like people want to just fix the clock that perf uses so
> that it's exportable and not handle this with something like this
> patch, which is better.

I have no issue moving the trace_clock.c code into lib/ and we can add
a CONFIG_TRACE_CLOCK option that can be set by perf and ftrace.

> 
> Also, we should ensure that perf and ftrace are guaranteed to use the
> same clock, I think it just happens to be the same right now.

ftrace has several clocks that it uses:

o local - basically sched_clock()
o global - something like hpet that is monotonic across CPUs but slower
o counter - a simple atomic counter (no time associated to it)
o uptime - jiffy counter
o perf  - trace_clock, which is what perf uses
o x86_tsc - the raw tsc counter.

# cat /sys/kernel/debug/trace_clock
[local] global counter uptime perf x86-tsc

-- Steve

  reply	other threads:[~2013-12-12  1:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07  0:34 Sonny Rao
2013-12-09  7:49 ` Josh Triplett
2013-12-11 19:30   ` Stephane Eranian
2013-12-12  1:17     ` Sonny Rao
2013-12-12  1:49       ` Steven Rostedt [this message]
2013-12-12  2:06         ` Sonny Rao
2013-12-12  2:11           ` Steven Rostedt

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=20131211204900.76993a7d@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=peterz@infradead.org \
    --cc=sonnyrao@chromium.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

all inboxes | Powered by JetHome®