Merge branch 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (58 commits) perf_counter: Fix perf_copy_attr() pointer arithmetic perf utils: Use a define for the maximum length of a trace event perf: Add timechart help text and add timechart to "perf help" tracing, x86, cpuidle: Move the end point of a C state in the power tracer perf utils: Be consistent about minimum text size in the svghelper perf timechart: Add "perf timechart record" perf: Add the timechart tool perf: Add a SVG helper library file tracing, perf: Convert the power tracer into an event tracer perf: Add a sample_event type to the event_union perf: Allow perf utilities to have "callback" options without arguments perf: Store trace event name/id pairs in perf.data perf: Add a timestamp to fork events sched_clock: Make it NMI safe perf_counter: Fix up swcounter throttling x86, perf_counter, bts: Optimize BTS overflow handling perf sched: Add --input=file option to builtin-sched.c perf trace: Sample timestamp and cpu when using record flag perf tools: Increase MAX_EVENT_LENGTH perf tools: Fix memory leak in read_ftrace_printk() ...
This commit is contained in:
81
include/trace/events/power.h
Normal file
81
include/trace/events/power.h
Normal file
@ -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>
|
@ -379,6 +379,39 @@ TRACE_EVENT(sched_stat_wait,
|
||||
(unsigned long long)__entry->delay)
|
||||
);
|
||||
|
||||
/*
|
||||
* Tracepoint for accounting runtime (time the task is executing
|
||||
* on a CPU).
|
||||
*/
|
||||
TRACE_EVENT(sched_stat_runtime,
|
||||
|
||||
TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
|
||||
|
||||
TP_ARGS(tsk, runtime, vruntime),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array( char, comm, TASK_COMM_LEN )
|
||||
__field( pid_t, pid )
|
||||
__field( u64, runtime )
|
||||
__field( u64, vruntime )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
|
||||
__entry->pid = tsk->pid;
|
||||
__entry->runtime = runtime;
|
||||
__entry->vruntime = vruntime;
|
||||
)
|
||||
TP_perf_assign(
|
||||
__perf_count(runtime);
|
||||
),
|
||||
|
||||
TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]",
|
||||
__entry->comm, __entry->pid,
|
||||
(unsigned long long)__entry->runtime,
|
||||
(unsigned long long)__entry->vruntime)
|
||||
);
|
||||
|
||||
/*
|
||||
* Tracepoint for accounting sleep time (time the task is not runnable,
|
||||
* including iowait, see below).
|
||||
|
Reference in New Issue
Block a user