All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [xentrace] add acpi pm tick output
@ 2009-03-19  9:01 Lu, Guanqun
  0 siblings, 0 replies; only message in thread
From: Lu, Guanqun @ 2009-03-19  9:01 UTC (permalink / raw)
  To: xen-devel组

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

This patch adds acpi pm tick output to xentrace.
The reason is that tsc stops and it causes the inaccuracy.
And later we can write some scripts based on this patch.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>

--
Guanqun

[-- Attachment #2: xentrace-with-acpi-pm-tick-logged.patch --]
[-- Type: application/octet-stream, Size: 2563 bytes --]

diff -r 0e1449d6f231 tools/xentrace/formats
--- a/tools/xentrace/formats	Fri Mar 13 10:09:25 2009 +0000
+++ b/tools/xentrace/formats	Thu Mar 19 23:55:21 2009 +0800
@@ -118,5 +118,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 ]
-0x00802002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  cpu_idle_exit   [ C%(1)d -> C0 ]
+0x00802001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  cpu_idle_entry  [ C0 -> C%(1)d, acpi_pm_tick = %(2)d ]
+0x00802002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  cpu_idle_exit   [ C%(1)d -> C0, acpi_pm_tick = %(2)d ]
diff -r 0e1449d6f231 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Mar 13 10:09:25 2009 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Thu Mar 19 23:55:21 2009 +0800
@@ -245,16 +245,16 @@
     case ACPI_STATE_C2:
         if ( cx->type == ACPI_STATE_C1 || local_apic_timer_c2_ok )
         {
-            /* Trace cpu idle entry */
-            TRACE_1D(TRC_PM_IDLE_ENTRY, cx->idx);
             /* Get start time (ticks) */
             t1 = inl(pmtmr_ioport);
+            /* Trace cpu idle entry */
+            TRACE_2D(TRC_PM_IDLE_ENTRY, cx->idx, t1);
             /* Invoke C2 */
             acpi_idle_do_entry(cx);
             /* Get end time (ticks) */
             t2 = inl(pmtmr_ioport);
             /* Trace cpu idle exit */
-            TRACE_1D(TRC_PM_IDLE_EXIT, cx->idx);
+            TRACE_2D(TRC_PM_IDLE_EXIT, cx->idx, t2);
 
             /* Re-enable interrupts */
             local_irq_enable();
@@ -293,8 +293,6 @@
             ACPI_FLUSH_CPU_CACHE();
         }
 
-        /* Trace cpu idle entry */
-        TRACE_1D(TRC_PM_IDLE_ENTRY, cx->idx);
         /*
          * Before invoking C3, be aware that TSC/APIC timer may be 
          * stopped by H/W. Without carefully handling of TSC/APIC stop issues,
@@ -305,6 +303,8 @@
 
         /* Get start time (ticks) */
         t1 = inl(pmtmr_ioport);
+        /* Trace cpu idle entry */
+        TRACE_2D(TRC_PM_IDLE_ENTRY, cx->idx, t1);
         /* Invoke C3 */
         acpi_idle_do_entry(cx);
         /* Get end time (ticks) */
@@ -313,7 +313,7 @@
         /* recovering TSC */
         cstate_restore_tsc();
         /* Trace cpu idle exit */
-        TRACE_1D(TRC_PM_IDLE_EXIT, cx->idx);
+        TRACE_2D(TRC_PM_IDLE_EXIT, cx->idx, t2);
 
         if ( power->flags.bm_check && power->flags.bm_control )
         {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-19  9:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19  9:01 [PATCH] [xentrace] add acpi pm tick output Lu, Guanqun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.