2009-09-17 22:11:28 +08:00
|
|
|
#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>
|
2013-06-21 10:12:28 +08:00
|
|
|
#include <linux/pm_qos.h>
|
2009-09-17 22:11:28 +08:00
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
2011-01-04 00:50:44 +08:00
|
|
|
DECLARE_EVENT_CLASS(cpu,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(state, cpu_id),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( u32, state )
|
|
|
|
__field( u32, cpu_id )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->state = state;
|
|
|
|
__entry->cpu_id = cpu_id;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
|
|
|
|
(unsigned long)__entry->cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(cpu, cpu_idle,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(state, cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
|
|
|
|
#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
|
|
|
|
#define _PWR_EVENT_AVOID_DOUBLE_DEFINING
|
|
|
|
|
|
|
|
#define PWR_EVENT_EXIT -1
|
2009-09-17 22:11:28 +08:00
|
|
|
#endif
|
|
|
|
|
2011-01-04 00:50:44 +08:00
|
|
|
DEFINE_EVENT(cpu, cpu_frequency,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned int frequency, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(frequency, cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(machine_suspend,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned int state),
|
|
|
|
|
|
|
|
TP_ARGS(state),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( u32, state )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->state = state;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("state=%lu", (unsigned long)__entry->state)
|
|
|
|
);
|
|
|
|
|
2012-04-30 04:53:02 +08:00
|
|
|
DECLARE_EVENT_CLASS(wakeup_source,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state),
|
|
|
|
|
|
|
|
TP_ARGS(name, state),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string( name, name )
|
|
|
|
__field( u64, state )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(name, name);
|
|
|
|
__entry->state = state;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s state=0x%lx", __get_str(name),
|
|
|
|
(unsigned long)__entry->state)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(wakeup_source, wakeup_source_activate,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state),
|
|
|
|
|
|
|
|
TP_ARGS(name, state)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state),
|
|
|
|
|
|
|
|
TP_ARGS(name, state)
|
|
|
|
);
|
|
|
|
|
2010-09-07 15:21:32 +08:00
|
|
|
/*
|
|
|
|
* The clock events are used for clock enable/disable and for
|
|
|
|
* clock rate change
|
|
|
|
*/
|
|
|
|
DECLARE_EVENT_CLASS(clock,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(name, state, cpu_id),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string( name, name )
|
|
|
|
__field( u64, state )
|
|
|
|
__field( u64, cpu_id )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(name, name);
|
|
|
|
__entry->state = state;
|
|
|
|
__entry->cpu_id = cpu_id;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
|
|
|
|
(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(clock, clock_enable,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(name, state, cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(clock, clock_disable,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(name, state, cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(clock, clock_set_rate,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(name, state, cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The power domain events are used for power domains transitions
|
|
|
|
*/
|
|
|
|
DECLARE_EVENT_CLASS(power_domain,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(name, state, cpu_id),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string( name, name )
|
|
|
|
__field( u64, state )
|
|
|
|
__field( u64, cpu_id )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(name, name);
|
|
|
|
__entry->state = state;
|
|
|
|
__entry->cpu_id = cpu_id;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
|
|
|
|
(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(power_domain, power_domain_target,
|
|
|
|
|
|
|
|
TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
|
|
|
|
|
|
|
|
TP_ARGS(name, state, cpu_id)
|
|
|
|
);
|
2013-06-21 10:12:28 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The pm qos events are used for pm qos update
|
|
|
|
*/
|
|
|
|
DECLARE_EVENT_CLASS(pm_qos_update,
|
|
|
|
|
|
|
|
TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
|
|
|
|
|
|
|
|
TP_ARGS(action, prev_value, curr_value),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field( enum pm_qos_req_action, action )
|
|
|
|
__field( int, prev_value )
|
|
|
|
__field( int, curr_value )
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->action = action;
|
|
|
|
__entry->prev_value = prev_value;
|
|
|
|
__entry->curr_value = curr_value;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("action=%s prev_value=%d curr_value=%d",
|
|
|
|
__print_symbolic(__entry->action,
|
|
|
|
{ PM_QOS_ADD_REQ, "ADD_REQ" },
|
|
|
|
{ PM_QOS_UPDATE_REQ, "UPDATE_REQ" },
|
|
|
|
{ PM_QOS_REMOVE_REQ, "REMOVE_REQ" }),
|
|
|
|
__entry->prev_value, __entry->curr_value)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(pm_qos_update, pm_qos_update_target,
|
|
|
|
|
|
|
|
TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
|
|
|
|
|
|
|
|
TP_ARGS(action, prev_value, curr_value)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags,
|
|
|
|
|
|
|
|
TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
|
|
|
|
|
|
|
|
TP_ARGS(action, prev_value, curr_value),
|
|
|
|
|
|
|
|
TP_printk("action=%s prev_value=0x%x curr_value=0x%x",
|
|
|
|
__print_symbolic(__entry->action,
|
|
|
|
{ PM_QOS_ADD_REQ, "ADD_REQ" },
|
|
|
|
{ PM_QOS_UPDATE_REQ, "UPDATE_REQ" },
|
|
|
|
{ PM_QOS_REMOVE_REQ, "REMOVE_REQ" }),
|
|
|
|
__entry->prev_value, __entry->curr_value)
|
|
|
|
);
|
2009-09-17 22:11:28 +08:00
|
|
|
#endif /* _TRACE_POWER_H */
|
|
|
|
|
|
|
|
/* This part must be outside protection */
|
|
|
|
#include <trace/define_trace.h>
|