Messages in this thread | | | Date | Tue, 25 Nov 2008 12:25:51 +0100 | From | "Frédéric Weisbecker" <> | Subject | Re: [PATCH] ftrace: Add a C/P state tracer to help power optimization |
| |
That looks good...
2008/11/24 Arjan van de Ven <arjan@infradead.org>: > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index 7854d87..0df2886 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -311,6 +311,35 @@ ftrace_init_module(struct module *mod, > unsigned long *start, unsigned long *end) { } > #endif > > +enum { > + POWER_NONE = 0, > + POWER_CSTATE = 1, > + POWER_PSTATE = 2, > +}; > + > +struct power_trace { > +#ifdef CONFIG_POWER_TRACER > + ktime_t stamp; > + ktime_t end; > + int type; > + int state; > +#endif > +}; > + > +#ifdef CONFIG_POWER_TRACER > +extern void trace_power_start(struct power_trace *it, unsigned int type, > + unsigned int state); > +extern void trace_power_mark(struct power_trace *it, unsigned int type, > + unsigned int state); > +extern void trace_power_end(struct power_trace *it); > +#else > +static inline void trace_power_start(struct power_trace *it, unsigned int type, > + unsigned int state) { } > +static inline void trace_power_mark(struct power_trace *it, unsigned int type, > + unsigned int state) { } > +static inline void trace_power_end(struct power_trace *it) { } > +#endif > +
Sorry I didn't see it on my last mail. But these headers seem to relate more on "power tracing" rather than "ftrace". Perhaps these would find a better place on trace/power.h I guess that could be done on a delta patch as well....
Just for curiosity, do you have an example of trace and/or graph from this tracer?
| |