From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Abderrahmane Benbachir <abderrahmane.benbachir@polymtl.ca>,
linux-kernel@vger.kernel.org, mingo@redhat.com,
mathieu.desnoyers@efficios.com,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCH v2] ftrace: support very early function tracing
Date: Wed, 8 Nov 2017 11:07:57 -0500 [thread overview]
Message-ID: <20171108110757.5ef58e53@gandalf.local.home> (raw)
In-Reply-To: <20171108081058.GT3165@worktop.lehotels.local>
On Wed, 8 Nov 2017 09:10:58 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> On Tue, Nov 07, 2017 at 09:17:06PM -0500, Steven Rostedt wrote:
> > > +#ifdef CONFIG_X86_TSC
> > > + entry->clock = rdtsc();
> > > +#else
> > > + entry->clock = trace_clock_local();
> > > +#endif
>
> > > +#ifdef CONFIG_X86_TSC
> > > + cpu_khz = native_calibrate_cpu();
> > > +#endif
>
> > > +#ifdef CONFIG_X86_TSC
> > > + ns = cycles_to_ns(entry->clock, cpu_khz);
> > > +#else
> > > + ns = entry->clock;
> > > +#endif
>
> Yeah, no, not going to happen...
Agreed.
What you can do is have an:
arch_early_trace_clock();
and in trace.c have:
u64 __weak arch_early_trace_clock(void)
{
return trace_clock_local();
}
u64 __weak arch_early_trace_clock_to_ns(u64 clock)
{
return clock;
}
and in x86 have:
u64 arch_early_trace_clock(void)
{
return rdtsc();
}
u64 arch_early_trace_clock_to_ns(u64 clock)
{
return cycles_to_ns(clock, cpu_khz);
}
Is that acceptable?
-- Steve
next prev parent reply other threads:[~2017-11-08 16:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 23:44 Abderrahmane Benbachir
2017-11-08 2:17 ` Steven Rostedt
2017-11-08 8:10 ` Peter Zijlstra
2017-11-08 16:07 ` Steven Rostedt [this message]
2017-11-08 19:07 ` Peter Zijlstra
2017-11-08 19:19 ` Steven Rostedt
2017-11-08 19:33 ` Peter Zijlstra
2017-11-08 15:56 ` Abderrahmane Benbachir
2017-11-08 18:44 ` Abderrahmane Benbachir
2017-11-08 19:09 ` 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=20171108110757.5ef58e53@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=abderrahmane.benbachir@polymtl.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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®