[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86 Cx tracing: export expected/predicted Cx to xentrace



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1246269656 -3600
# Node ID 15cf6f0009d30d5a772d628f5381a01360d87502
# Parent  48710482a4e5628391ddf9b6ea04bda49a36decf
x86 Cx tracing: export expected/predicted Cx to xentrace

Signed-off-by: Lu Guanqun <guanqun.lu@xxxxxxxxx>
---
 tools/xentrace/formats           |    2 +-
 xen/arch/x86/acpi/cpu_idle.c     |    7 +++++--
 xen/arch/x86/acpi/cpuidle_menu.c |    6 ++++++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff -r 48710482a4e5 -r 15cf6f0009d3 tools/xentrace/formats
--- a/tools/xentrace/formats    Mon Jun 29 10:58:56 2009 +0100
+++ b/tools/xentrace/formats    Mon Jun 29 11:00:56 2009 +0100
@@ -121,5 +121,5 @@ 0x0040f10f  CPU%(cpu)d  %(tsc)d (+%(relt
 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 -r 48710482a4e5 -r 15cf6f0009d3 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c      Mon Jun 29 10:58:56 2009 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c      Mon Jun 29 11:00:56 2009 +0100
@@ -58,6 +58,7 @@ extern u32 pmtmr_ioport;
 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 -r 48710482a4e5 -r 15cf6f0009d3 xen/arch/x86/acpi/cpuidle_menu.c
--- a/xen/arch/x86/acpi/cpuidle_menu.c  Mon Jun 29 10:58:56 2009 +0100
+++ b/xen/arch/x86/acpi/cpuidle_menu.c  Mon Jun 29 11:00:56 2009 +0100
@@ -126,3 +126,9 @@ static struct cpuidle_governor menu_gove
 };
 
 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;
+}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.