forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracing, perf: Convert the power tracer into an event tracer
This patch converts the existing power tracer into an event tracer, so that power events (C states and frequency changes) can be tracked via "perf". This also removes the perl script that was used to demo the tracer; its functionality is being replaced entirely with timechart. Signed-off-by: Arjan van de Ven <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Frederic Weisbecker <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
- Loading branch information
Showing
10 changed files
with
113 additions
and
388 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM power | ||
|
||
#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _TRACE_POWER_H | ||
|
||
#include <linux/ktime.h> | ||
#include <linux/tracepoint.h> | ||
|
||
#ifndef _TRACE_POWER_ENUM_ | ||
#define _TRACE_POWER_ENUM_ | ||
enum { | ||
POWER_NONE = 0, | ||
POWER_CSTATE = 1, | ||
POWER_PSTATE = 2, | ||
}; | ||
#endif | ||
|
||
|
||
|
||
TRACE_EVENT(power_start, | ||
|
||
TP_PROTO(unsigned int type, unsigned int state), | ||
|
||
TP_ARGS(type, state), | ||
|
||
TP_STRUCT__entry( | ||
__field( u64, type ) | ||
__field( u64, state ) | ||
), | ||
|
||
TP_fast_assign( | ||
__entry->type = type; | ||
__entry->state = state; | ||
), | ||
|
||
TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) | ||
); | ||
|
||
TRACE_EVENT(power_end, | ||
|
||
TP_PROTO(int dummy), | ||
|
||
TP_ARGS(dummy), | ||
|
||
TP_STRUCT__entry( | ||
__field( u64, dummy ) | ||
), | ||
|
||
TP_fast_assign( | ||
__entry->dummy = 0xffff; | ||
), | ||
|
||
TP_printk("dummy=%lu", (unsigned long)__entry->dummy) | ||
|
||
); | ||
|
||
|
||
TRACE_EVENT(power_frequency, | ||
|
||
TP_PROTO(unsigned int type, unsigned int state), | ||
|
||
TP_ARGS(type, state), | ||
|
||
TP_STRUCT__entry( | ||
__field( u64, type ) | ||
__field( u64, state ) | ||
), | ||
|
||
TP_fast_assign( | ||
__entry->type = type; | ||
__entry->state = state; | ||
), | ||
|
||
TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long) __entry->state) | ||
); | ||
|
||
#endif /* _TRACE_POWER_H */ | ||
|
||
/* This part must be outside protection */ | ||
#include <trace/define_trace.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Power trace points | ||
* | ||
* Copyright (C) 2009 Arjan van de Ven <[email protected]> | ||
*/ | ||
|
||
#include <linux/string.h> | ||
#include <linux/types.h> | ||
#include <linux/workqueue.h> | ||
#include <linux/sched.h> | ||
#include <linux/module.h> | ||
#include <linux/slab.h> | ||
|
||
#define CREATE_TRACE_POINTS | ||
#include <trace/events/power.h> | ||
|
||
EXPORT_TRACEPOINT_SYMBOL_GPL(power_start); | ||
EXPORT_TRACEPOINT_SYMBOL_GPL(power_end); | ||
EXPORT_TRACEPOINT_SYMBOL_GPL(power_frequency); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.