Navigation Menu

Skip to content

Commit

Permalink
cpuidle: Add last_residency trace event for residency profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
thalamus authored and franciscofranco committed Nov 4, 2012
1 parent ab33883 commit f3b369c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/cpuidle/cpuidle.c
Expand Up @@ -104,6 +104,7 @@ static void cpuidle_idle_call(void)

trace_power_end(dev->cpu);
trace_cpu_idle(PWR_EVENT_EXIT, dev->cpu);
trace_cpu_residency(dev->last_residency);

if (dev->last_state)
target_state = dev->last_state;
Expand Down
24 changes: 24 additions & 0 deletions include/trace/events/power.h
Expand Up @@ -34,6 +34,30 @@ DEFINE_EVENT(cpu, cpu_idle,
TP_ARGS(state, cpu_id)
);

DECLARE_EVENT_CLASS(residency,

TP_PROTO(unsigned long residency),

TP_ARGS(residency),

TP_STRUCT__entry(
__field( u32, residency )
),

TP_fast_assign(
__entry->residency = residency;
),

TP_printk("\t%lu", (unsigned long)__entry->residency)
);

DEFINE_EVENT(residency, cpu_residency,

TP_PROTO(unsigned long residency),

TP_ARGS(residency)
);

/* 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
Expand Down

0 comments on commit f3b369c

Please sign in to comment.