debuggers.hg
changeset 21092:7b63f677f245
cpufreq: make non-verbose by default
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Thu Mar 18 11:03:07 2010 +0000 (2010-03-18) |
parents | 7751288b1386 |
children | c5e1a0b720ba |
files | xen/arch/x86/acpi/cpufreq/cpufreq.c xen/drivers/cpufreq/cpufreq.c xen/drivers/cpufreq/utility.c xen/include/acpi/cpufreq/cpufreq.h |
line diff
1.1 --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c Thu Mar 18 11:02:25 2010 +0000 1.2 +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c Thu Mar 18 11:03:07 2010 +0000 1.3 @@ -540,13 +540,15 @@ acpi_cpufreq_cpu_init(struct cpufreq_pol 1.4 1.5 switch (perf->control_register.space_id) { 1.6 case ACPI_ADR_SPACE_SYSTEM_IO: 1.7 - printk("xen_pminfo: @acpi_cpufreq_cpu_init," 1.8 - "SYSTEM IO addr space\n"); 1.9 + if (cpufreq_verbose) 1.10 + printk("xen_pminfo: @acpi_cpufreq_cpu_init," 1.11 + "SYSTEM IO addr space\n"); 1.12 data->cpu_feature = SYSTEM_IO_CAPABLE; 1.13 break; 1.14 case ACPI_ADR_SPACE_FIXED_HARDWARE: 1.15 - printk("xen_pminfo: @acpi_cpufreq_cpu_init," 1.16 - "HARDWARE addr space\n"); 1.17 + if (cpufreq_verbose) 1.18 + printk("xen_pminfo: @acpi_cpufreq_cpu_init," 1.19 + "HARDWARE addr space\n"); 1.20 if (!check_est_cpu(cpu)) { 1.21 result = -ENODEV; 1.22 goto err_unreg;
2.1 --- a/xen/drivers/cpufreq/cpufreq.c Thu Mar 18 11:02:25 2010 +0000 2.2 +++ b/xen/drivers/cpufreq/cpufreq.c Thu Mar 18 11:03:07 2010 +0000 2.3 @@ -59,6 +59,8 @@ static LIST_HEAD(cpufreq_dom_list_head); 2.4 struct cpufreq_governor *cpufreq_opt_governor; 2.5 LIST_HEAD(cpufreq_governor_list); 2.6 2.7 +bool_t __read_mostly cpufreq_verbose; 2.8 + 2.9 struct cpufreq_governor *__find_governor(const char *governor) 2.10 { 2.11 struct cpufreq_governor *t; 2.12 @@ -205,13 +207,15 @@ int cpufreq_add_cpu(unsigned int cpu) 2.13 cpufreq_cpu_policy[cpu] = NULL; 2.14 return ret; 2.15 } 2.16 - printk(KERN_EMERG"CPU %u initialization completed\n", cpu); 2.17 + if (cpufreq_verbose) 2.18 + printk("CPU %u initialization completed\n", cpu); 2.19 } else { 2.20 firstcpu = first_cpu(cpufreq_dom->map); 2.21 policy = cpufreq_cpu_policy[firstcpu]; 2.22 2.23 cpufreq_cpu_policy[cpu] = policy; 2.24 - printk(KERN_EMERG"adding CPU %u\n", cpu); 2.25 + if (cpufreq_verbose) 2.26 + printk("adding CPU %u\n", cpu); 2.27 } 2.28 2.29 cpu_set(cpu, policy->cpus); 2.30 @@ -325,47 +329,47 @@ int cpufreq_del_cpu(unsigned int cpu) 2.31 xfree(cpufreq_dom); 2.32 } 2.33 2.34 - printk(KERN_EMERG"deleting CPU %u\n", cpu); 2.35 + if (cpufreq_verbose) 2.36 + printk("deleting CPU %u\n", cpu); 2.37 return 0; 2.38 } 2.39 2.40 static void print_PCT(struct xen_pct_register *ptr) 2.41 { 2.42 - printk(KERN_INFO "\t_PCT: descriptor=%d, length=%d, space_id=%d, " 2.43 - "bit_width=%d, bit_offset=%d, reserved=%d, address=%"PRId64"\n", 2.44 - ptr->descriptor, ptr->length, ptr->space_id, ptr->bit_width, 2.45 - ptr->bit_offset, ptr->reserved, ptr->address); 2.46 + printk("\t_PCT: descriptor=%d, length=%d, space_id=%d, " 2.47 + "bit_width=%d, bit_offset=%d, reserved=%d, address=%"PRId64"\n", 2.48 + ptr->descriptor, ptr->length, ptr->space_id, ptr->bit_width, 2.49 + ptr->bit_offset, ptr->reserved, ptr->address); 2.50 } 2.51 2.52 static void print_PSS(struct xen_processor_px *ptr, int count) 2.53 { 2.54 int i; 2.55 - printk(KERN_INFO "\t_PSS: state_count=%d\n", count); 2.56 + printk("\t_PSS: state_count=%d\n", count); 2.57 for (i=0; i<count; i++){ 2.58 - printk(KERN_INFO "\tState%d: %"PRId64"MHz %"PRId64"mW %"PRId64"us " 2.59 + printk("\tState%d: %"PRId64"MHz %"PRId64"mW %"PRId64"us " 2.60 "%"PRId64"us 0x%"PRIx64" 0x%"PRIx64"\n", 2.61 - i, 2.62 - ptr[i].core_frequency, 2.63 - ptr[i].power, 2.64 - ptr[i].transition_latency, 2.65 - ptr[i].bus_master_latency, 2.66 - ptr[i].control, 2.67 - ptr[i].status 2.68 - ); 2.69 + i, 2.70 + ptr[i].core_frequency, 2.71 + ptr[i].power, 2.72 + ptr[i].transition_latency, 2.73 + ptr[i].bus_master_latency, 2.74 + ptr[i].control, 2.75 + ptr[i].status); 2.76 } 2.77 } 2.78 2.79 static void print_PSD( struct xen_psd_package *ptr) 2.80 { 2.81 - printk(KERN_INFO "\t_PSD: num_entries=%"PRId64" rev=%"PRId64 2.82 + printk("\t_PSD: num_entries=%"PRId64" rev=%"PRId64 2.83 " domain=%"PRId64" coord_type=%"PRId64" num_processors=%"PRId64"\n", 2.84 - ptr->num_entries, ptr->revision, ptr->domain, ptr->coord_type, 2.85 - ptr->num_processors); 2.86 + ptr->num_entries, ptr->revision, ptr->domain, ptr->coord_type, 2.87 + ptr->num_processors); 2.88 } 2.89 2.90 static void print_PPC(unsigned int platform_limit) 2.91 { 2.92 - printk(KERN_INFO "\t_PPC: %d\n", platform_limit); 2.93 + printk("\t_PPC: %d\n", platform_limit); 2.94 } 2.95 2.96 int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_info) 2.97 @@ -380,8 +384,9 @@ int set_px_pminfo(uint32_t acpi_id, stru 2.98 ret = -EINVAL; 2.99 goto out; 2.100 } 2.101 - printk(KERN_INFO "Set CPU acpi_id(%d) cpuid(%d) Px State info:\n", 2.102 - acpi_id, cpuid); 2.103 + if ( cpufreq_verbose ) 2.104 + printk("Set CPU acpi_id(%d) cpuid(%d) Px State info:\n", 2.105 + acpi_id, cpuid); 2.106 2.107 pmpt = processor_pminfo[cpuid]; 2.108 if ( !pmpt ) 2.109 @@ -425,8 +430,12 @@ int set_px_pminfo(uint32_t acpi_id, stru 2.110 memcpy ((void *)&pxpt->status_register, 2.111 (void *)&dom0_px_info->status_register, 2.112 sizeof(struct xen_pct_register)); 2.113 - print_PCT(&pxpt->control_register); 2.114 - print_PCT(&pxpt->status_register); 2.115 + 2.116 + if ( cpufreq_verbose ) 2.117 + { 2.118 + print_PCT(&pxpt->control_register); 2.119 + print_PCT(&pxpt->status_register); 2.120 + } 2.121 } 2.122 2.123 if ( dom0_px_info->flags & XEN_PX_PSS ) 2.124 @@ -447,7 +456,9 @@ int set_px_pminfo(uint32_t acpi_id, stru 2.125 copy_from_guest(pxpt->states, dom0_px_info->states, 2.126 dom0_px_info->state_count); 2.127 pxpt->state_count = dom0_px_info->state_count; 2.128 - print_PSS(pxpt->states,pxpt->state_count); 2.129 + 2.130 + if ( cpufreq_verbose ) 2.131 + print_PSS(pxpt->states,pxpt->state_count); 2.132 } 2.133 2.134 if ( dom0_px_info->flags & XEN_PX_PSD ) 2.135 @@ -468,13 +479,17 @@ int set_px_pminfo(uint32_t acpi_id, stru 2.136 memcpy ((void *)&pxpt->domain_info, 2.137 (void *)&dom0_px_info->domain_info, 2.138 sizeof(struct xen_psd_package)); 2.139 - print_PSD(&pxpt->domain_info); 2.140 + 2.141 + if ( cpufreq_verbose ) 2.142 + print_PSD(&pxpt->domain_info); 2.143 } 2.144 2.145 if ( dom0_px_info->flags & XEN_PX_PPC ) 2.146 { 2.147 pxpt->platform_limit = dom0_px_info->platform_limit; 2.148 - print_PPC(pxpt->platform_limit); 2.149 + 2.150 + if ( cpufreq_verbose ) 2.151 + print_PPC(pxpt->platform_limit); 2.152 2.153 if ( pxpt->init == XEN_PX_INIT ) 2.154 { 2.155 @@ -516,6 +531,11 @@ static int __init cpufreq_handle_common_ 2.156 return 1; 2.157 } 2.158 2.159 + if (!strcmp(name, "verbose")) { 2.160 + cpufreq_verbose = !val || !!simple_strtoul(val, NULL, 0); 2.161 + return 1; 2.162 + } 2.163 + 2.164 return 0; 2.165 } 2.166
3.1 --- a/xen/drivers/cpufreq/utility.c Thu Mar 18 11:02:25 2010 +0000 3.2 +++ b/xen/drivers/cpufreq/utility.c Thu Mar 18 11:03:07 2010 +0000 3.3 @@ -229,8 +229,9 @@ int cpufreq_frequency_table_cpuinfo(stru 3.4 } 3.5 if (second_max_freq == 0) 3.6 second_max_freq = max_freq; 3.7 - printk(XENLOG_INFO "max_freq: %u second_max_freq: %u\n", 3.8 - max_freq, second_max_freq); 3.9 + if (cpufreq_verbose) 3.10 + printk("max_freq: %u second_max_freq: %u\n", 3.11 + max_freq, second_max_freq); 3.12 3.13 policy->min = policy->cpuinfo.min_freq = min_freq; 3.14 policy->max = policy->cpuinfo.max_freq = max_freq;
4.1 --- a/xen/include/acpi/cpufreq/cpufreq.h Thu Mar 18 11:02:25 2010 +0000 4.2 +++ b/xen/include/acpi/cpufreq/cpufreq.h Thu Mar 18 11:03:07 2010 +0000 4.3 @@ -22,6 +22,8 @@ 4.4 4.5 DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock); 4.6 4.7 +extern bool_t __read_mostly cpufreq_verbose; 4.8 + 4.9 struct cpufreq_governor; 4.10 4.11 struct acpi_cpufreq_data {