diff options
author | Arjan van de Ven <arjan@infradead.org> | 2008-11-23 19:49:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-26 02:29:32 -0500 |
commit | f3f47a6768a29448866da4422b6f6bee485c947f (patch) | |
tree | ba4bf1b79cbd13412871eec50250294d7140fd09 /include/linux/ftrace.h | |
parent | 509dceef6470442d8c7b8a43ec34125205840b3c (diff) |
tracing: add "power-tracer": C/P state tracer to help power optimization
Impact: new "power-tracer" ftrace plugin
This patch adds a C/P-state ftrace plugin that will generate
detailed statistics about the C/P-states that are being used,
so that we can look at detailed decisions that the C/P-state
code is making, rather than the too high level "average"
that we have today.
An example way of using this is:
mount -t debugfs none /sys/kernel/debug
echo cstate > /sys/kernel/debug/tracing/current_tracer
echo 1 > /sys/kernel/debug/tracing/tracing_enabled
sleep 1
echo 0 > /sys/kernel/debug/tracing/tracing_enabled
cat /sys/kernel/debug/tracing/trace | perl scripts/trace/cstate.pl > out.svg
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 7854d87b97b2..0df288666201 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -311,6 +311,35 @@ ftrace_init_module(struct module *mod, | |||
311 | unsigned long *start, unsigned long *end) { } | 311 | unsigned long *start, unsigned long *end) { } |
312 | #endif | 312 | #endif |
313 | 313 | ||
314 | enum { | ||
315 | POWER_NONE = 0, | ||
316 | POWER_CSTATE = 1, | ||
317 | POWER_PSTATE = 2, | ||
318 | }; | ||
319 | |||
320 | struct power_trace { | ||
321 | #ifdef CONFIG_POWER_TRACER | ||
322 | ktime_t stamp; | ||
323 | ktime_t end; | ||
324 | int type; | ||
325 | int state; | ||
326 | #endif | ||
327 | }; | ||
328 | |||
329 | #ifdef CONFIG_POWER_TRACER | ||
330 | extern void trace_power_start(struct power_trace *it, unsigned int type, | ||
331 | unsigned int state); | ||
332 | extern void trace_power_mark(struct power_trace *it, unsigned int type, | ||
333 | unsigned int state); | ||
334 | extern void trace_power_end(struct power_trace *it); | ||
335 | #else | ||
336 | static inline void trace_power_start(struct power_trace *it, unsigned int type, | ||
337 | unsigned int state) { } | ||
338 | static inline void trace_power_mark(struct power_trace *it, unsigned int type, | ||
339 | unsigned int state) { } | ||
340 | static inline void trace_power_end(struct power_trace *it) { } | ||
341 | #endif | ||
342 | |||
314 | 343 | ||
315 | /* | 344 | /* |
316 | * Structure that defines a return function trace. | 345 | * Structure that defines a return function trace. |