Re: [PATCH] ftrace: Add a C/P state tracer to help power optimization

From: Frédéric Weisbecker
Date: Tue Nov 25 2008 - 06:26:04 EST


That looks good...

2008/11/24 Arjan van de Ven <arjan@xxxxxxxxxxxxx>:
> 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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/