aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/xentrace/formats2
-rw-r--r--xen/arch/x86/acpi/cpu_idle.c7
-rw-r--r--xen/arch/x86/acpi/cpuidle_menu.c6
3 files changed, 12 insertions, 3 deletions
diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index 5b2a7693d1..db82a09250 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -121,5 +121,5 @@
0x0040f10f CPU%(cpu)d %(tsc)d (+%(reltsc)8d) shadow_emulate_resync_only [ gfn = 0x%(1)16x ]
0x00801001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) cpu_freq_change [ %(1)dMHz -> %(2)dMHz ]
-0x00802001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) cpu_idle_entry [ C0 -> C%(1)d, acpi_pm_tick = %(2)d ]
+0x00802001 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) cpu_idle_entry [ C0 -> C%(1)d, acpi_pm_tick = %(2)d, expected = %(3)dus, predicted = %(4)dus ]
0x00802002 CPU%(cpu)d %(tsc)d (+%(reltsc)8d) cpu_idle_exit [ C%(1)d -> C0, acpi_pm_tick = %(2)d ]
diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 91f839e264..e98ef6a693 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -58,6 +58,7 @@ static void (*lapic_timer_on)(void);
extern u32 pmtmr_ioport;
extern void (*pm_idle) (void);
extern void (*dead_idle) (void);
+extern void menu_get_trace_data(u32 *expected, u32 *pred);
static void (*pm_idle_save) (void) __read_mostly;
unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
@@ -196,6 +197,7 @@ static void acpi_processor_idle(void)
int next_state;
int sleep_ticks = 0;
u32 t1, t2 = 0;
+ u32 exp = 0, pred = 0;
cpufreq_dbs_timer_suspend();
@@ -231,6 +233,7 @@ static void acpi_processor_idle(void)
cx = power->safe_state;
if ( cx->idx > max_cstate )
cx = &power->states[max_cstate];
+ menu_get_trace_data(&exp, &pred);
}
if ( !cx )
{
@@ -259,7 +262,7 @@ static void acpi_processor_idle(void)
/* Get start time (ticks) */
t1 = inl(pmtmr_ioport);
/* Trace cpu idle entry */
- TRACE_2D(TRC_PM_IDLE_ENTRY, cx->idx, t1);
+ TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
/* Invoke C2 */
acpi_idle_do_entry(cx);
/* Get end time (ticks) */
@@ -315,7 +318,7 @@ static void acpi_processor_idle(void)
/* Get start time (ticks) */
t1 = inl(pmtmr_ioport);
/* Trace cpu idle entry */
- TRACE_2D(TRC_PM_IDLE_ENTRY, cx->idx, t1);
+ TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, t1, exp, pred);
/* Invoke C3 */
acpi_idle_do_entry(cx);
/* Get end time (ticks) */
diff --git a/xen/arch/x86/acpi/cpuidle_menu.c b/xen/arch/x86/acpi/cpuidle_menu.c
index 27ed7f5790..4b284219fe 100644
--- a/xen/arch/x86/acpi/cpuidle_menu.c
+++ b/xen/arch/x86/acpi/cpuidle_menu.c
@@ -126,3 +126,9 @@ static struct cpuidle_governor menu_governor =
};
struct cpuidle_governor *cpuidle_current_governor = &menu_governor;
+void menu_get_trace_data(u32 *expected, u32 *pred)
+{
+ struct menu_device *data = &__get_cpu_var(menu_devices);
+ *expected = data->expected_us;
+ *pred = data->predicted_us;
+}