ia64/xen-unstable

changeset 17689:b9735935a69e

x86: Make cx key handler print simpler but formatted info.

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed May 21 10:59:00 2008 +0100 (2008-05-21)
parents 5d4eac11e14f
children ef019d230080
files xen/arch/x86/acpi/cpu_idle.c
line diff
     1.1 --- a/xen/arch/x86/acpi/cpu_idle.c	Wed May 21 10:57:08 2008 +0100
     1.2 +++ b/xen/arch/x86/acpi/cpu_idle.c	Wed May 21 10:59:00 2008 +0100
     1.3 @@ -37,13 +37,13 @@
     1.4  #include <xen/types.h>
     1.5  #include <xen/acpi.h>
     1.6  #include <xen/smp.h>
     1.7 +#include <xen/guest_access.h>
     1.8 +#include <xen/keyhandler.h>
     1.9  #include <asm/cache.h>
    1.10  #include <asm/io.h>
    1.11  #include <asm/hpet.h>
    1.12 -#include <xen/guest_access.h>
    1.13 +#include <asm/processor.h>
    1.14  #include <public/platform.h>
    1.15 -#include <asm/processor.h>
    1.16 -#include <xen/keyhandler.h>
    1.17  
    1.18  #define DEBUG_PM_CX
    1.19  
    1.20 @@ -128,45 +128,29 @@ static void print_acpi_power(uint32_t cp
    1.21  {
    1.22      uint32_t i;
    1.23  
    1.24 -    printk("saved cpu%d cx acpi info:\n", cpu);
    1.25 -    printk("\tcurrent state is C%d\n", (power->state)?power->state->type:-1);
    1.26 -    printk("\tbm_check_timestamp = %"PRId64"\n", power->bm_check_timestamp);
    1.27 -    printk("\tdefault_state = %d\n", power->default_state);
    1.28 -    printk("\tbm_activity = 0x%08x\n", power->bm_activity);
    1.29 -    printk("\tcount = %d\n", power->count);
    1.30 +    printk("==cpu%d==\n", cpu);
    1.31 +    printk("active state:\t\tC%d\n", (power->state)?power->state->type:-1);
    1.32 +    printk("max_cstate:\t\tC%d\n", max_cstate);
    1.33 +    printk("bus master activity:\t%08x\n", power->bm_activity);
    1.34 +    printk("states:\n");
    1.35      
    1.36 -    for ( i = 0; i < power->count; i++ )
    1.37 +    for ( i = 1; i < power->count; i++ )
    1.38      {
    1.39 -        printk("\tstates[%d]:\n", i);
    1.40 -        printk("\t\tvalid   = %d\n", power->states[i].valid);
    1.41 -        printk("\t\ttype    = %d\n", power->states[i].type);
    1.42 -        printk("\t\taddress = 0x%x\n", power->states[i].address);
    1.43 -        printk("\t\tspace_id = 0x%x\n", power->states[i].space_id);
    1.44 -        printk("\t\tlatency = %d\n", power->states[i].latency);
    1.45 -        printk("\t\tpower   = %d\n", power->states[i].power);
    1.46 -        printk("\t\tlatency_ticks = %d\n", power->states[i].latency_ticks);
    1.47 -        printk("\t\tusage   = %d\n", power->states[i].usage);
    1.48 -        printk("\t\ttime    = %"PRId64"\n", power->states[i].time);
    1.49 -
    1.50 -        printk("\t\tpromotion policy:\n");
    1.51 -        printk("\t\t\tcount    = %d\n", power->states[i].promotion.count);
    1.52 -        printk("\t\t\tstate    = C%d\n",
    1.53 -               (power->states[i].promotion.state) ? 
    1.54 -               power->states[i].promotion.state->type : -1);
    1.55 -        printk("\t\t\tthreshold.time = %d\n", power->states[i].promotion.threshold.time);
    1.56 -        printk("\t\t\tthreshold.ticks = %d\n", power->states[i].promotion.threshold.ticks);
    1.57 -        printk("\t\t\tthreshold.count = %d\n", power->states[i].promotion.threshold.count);
    1.58 -        printk("\t\t\tthreshold.bm = %d\n", power->states[i].promotion.threshold.bm);
    1.59 -
    1.60 -        printk("\t\tdemotion policy:\n");
    1.61 -        printk("\t\t\tcount    = %d\n", power->states[i].demotion.count);
    1.62 -        printk("\t\t\tstate    = C%d\n",
    1.63 -               (power->states[i].demotion.state) ? 
    1.64 -               power->states[i].demotion.state->type : -1);
    1.65 -        printk("\t\t\tthreshold.time = %d\n", power->states[i].demotion.threshold.time);
    1.66 -        printk("\t\t\tthreshold.ticks = %d\n", power->states[i].demotion.threshold.ticks);
    1.67 -        printk("\t\t\tthreshold.count = %d\n", power->states[i].demotion.threshold.count);
    1.68 -        printk("\t\t\tthreshold.bm = %d\n", power->states[i].demotion.threshold.bm);
    1.69 +        printk((power->states[i].type == power->state->type) ? "   *" : "    ");
    1.70 +        printk("C%d:\t\t", i);
    1.71 +        printk("type[C%d] ", power->states[i].type);
    1.72 +        if ( power->states[i].promotion.state )
    1.73 +            printk("promotion[C%d] ", power->states[i].promotion.state->type);
    1.74 +        else
    1.75 +            printk("promotion[--] ");
    1.76 +        if ( power->states[i].demotion.state )
    1.77 +            printk("demotion[C%d] ", power->states[i].demotion.state->type);
    1.78 +        else
    1.79 +            printk("demotion[--] ");
    1.80 +        printk("latency[%03d]\n ", power->states[i].latency);
    1.81 +        printk("\t\t\t");
    1.82 +        printk("usage[%08d] ", power->states[i].usage);
    1.83 +        printk("duration[%"PRId64"]\n", power->states[i].time);
    1.84      }
    1.85  }
    1.86