[PATCH] powerpc/ftrace: add powerpc timebase as a trace clock source

Naveen N. Rao naveen.n.rao at linux.vnet.ibm.com
Fri Apr 24 18:07:49 AEST 2015


On 2015/04/23 09:10AM, Steven Rostedt wrote:
> On Thu, 23 Apr 2015 12:15:04 +0530
> "Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> wrote:
> 
> > diff --git a/arch/powerpc/include/asm/trace_clock.h b/arch/powerpc/include/asm/trace_clock.h
> > new file mode 100644
> > index 0000000..0b0d094
> > --- /dev/null
> > +++ b/arch/powerpc/include/asm/trace_clock.h
> > @@ -0,0 +1,27 @@
> > +/*
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License, version 2, as
> > + * published by the Free Software Foundation.
> > + *
> > + * Copyright (C) 2015 Naveen N. Rao, IBM Corporation
> > + */
> > +
> > +#ifndef _ASM_PPC_TRACE_CLOCK_H
> > +#define _ASM_PPC_TRACE_CLOCK_H
> > +
> > +#include <linux/compiler.h>
> > +#include <linux/types.h>
> > +
> > +#ifdef CONFIG_TRACE_CLOCK
> 
> You don't need this #if statement. What else is using this besides
> kernel/trace/trace.c, which selects TRACE_CLOCK if it is compiled.
> 
> If you were trying to match x86, where it has:
> 
> #ifdef CONFIG_X86_TSC
> 
> where you have CONFIG_TRACE_CLOCK. We needed the #ifdef because you
> can compile the x86 kernel without TSC support, and we did not want to
> export a tsc tracing clock if one did not exist.
> 
> And the only place that I see that even includes this header in ppc, is
> also only compiled if CONFIG_TRACE_CLOCK is selected.

Ah yes, agreed. I have removed it and seeing as CONFIG_TRACE_CLOCK is 
really for the generic clocks, I have moved the dependency on 
arch/powerpc/kernel/trace_clock.o to CONFIG_TRACING since that is what 
gates kernel/trace/trace.o

> 
> I'm fine with the change, just nuke the unnecessary #ifdef.

Thanks for the review!
- Naveen
 



More information about the Linuxppc-dev mailing list