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

[Xen-devel] [PATCH] cpufreq: make non-verbose by default



Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2010-03-02.orig/xen/arch/x86/acpi/cpufreq/cpufreq.c 2009-10-16 
14:38:50.000000000 +0200
+++ 2010-03-02/xen/arch/x86/acpi/cpufreq/cpufreq.c      2010-03-18 
11:45:12.000000000 +0100
@@ -540,13 +540,15 @@ acpi_cpufreq_cpu_init(struct cpufreq_pol
 
     switch (perf->control_register.space_id) {
     case ACPI_ADR_SPACE_SYSTEM_IO:
-        printk("xen_pminfo: @acpi_cpufreq_cpu_init,"
-            "SYSTEM IO addr space\n");
+        if (cpufreq_verbose)
+            printk("xen_pminfo: @acpi_cpufreq_cpu_init,"
+                   "SYSTEM IO addr space\n");
         data->cpu_feature = SYSTEM_IO_CAPABLE;
         break;
     case ACPI_ADR_SPACE_FIXED_HARDWARE:
-        printk("xen_pminfo: @acpi_cpufreq_cpu_init," 
-            "HARDWARE addr space\n");
+        if (cpufreq_verbose)
+            printk("xen_pminfo: @acpi_cpufreq_cpu_init,"
+                   "HARDWARE addr space\n");
         if (!check_est_cpu(cpu)) {
             result = -ENODEV;
             goto err_unreg;
--- 2010-03-02.orig/xen/drivers/cpufreq/cpufreq.c       2010-03-18 
10:11:23.000000000 +0100
+++ 2010-03-02/xen/drivers/cpufreq/cpufreq.c    2010-03-18 11:38:39.000000000 
+0100
@@ -59,6 +59,8 @@ static LIST_HEAD(cpufreq_dom_list_head);
 struct cpufreq_governor *cpufreq_opt_governor;
 LIST_HEAD(cpufreq_governor_list);
 
+bool_t __read_mostly cpufreq_verbose;
+
 struct cpufreq_governor *__find_governor(const char *governor)
 {
     struct cpufreq_governor *t;
@@ -195,13 +197,15 @@ int cpufreq_add_cpu(unsigned int cpu)
             xfree(policy);
             return ret;
         }
-        printk(KERN_EMERG"CPU %u initialization completed\n", cpu);
+        if (cpufreq_verbose)
+            printk("CPU %u initialization completed\n", cpu);
     } else {
         firstcpu = first_cpu(cpufreq_dom->map);
         policy = cpufreq_cpu_policy[firstcpu];
 
         cpufreq_cpu_policy[cpu] = policy;
-        printk(KERN_EMERG"adding CPU %u\n", cpu);
+        if (cpufreq_verbose)
+            printk("adding CPU %u\n", cpu);
     }
 
     cpu_set(cpu, policy->cpus);
@@ -315,47 +319,47 @@ int cpufreq_del_cpu(unsigned int cpu)
         xfree(cpufreq_dom);
     }
 
-    printk(KERN_EMERG"deleting CPU %u\n", cpu);
+    if (cpufreq_verbose)
+        printk("deleting CPU %u\n", cpu);
     return 0;
 }
 
 static void print_PCT(struct xen_pct_register *ptr)
 {
-    printk(KERN_INFO "\t_PCT: descriptor=%d, length=%d, space_id=%d, "
-            "bit_width=%d, bit_offset=%d, reserved=%d, address=%"PRId64"\n",
-            ptr->descriptor, ptr->length, ptr->space_id, ptr->bit_width, 
-            ptr->bit_offset, ptr->reserved, ptr->address);
+    printk("\t_PCT: descriptor=%d, length=%d, space_id=%d, "
+           "bit_width=%d, bit_offset=%d, reserved=%d, address=%"PRId64"\n",
+           ptr->descriptor, ptr->length, ptr->space_id, ptr->bit_width,
+           ptr->bit_offset, ptr->reserved, ptr->address);
 }
 
 static void print_PSS(struct xen_processor_px *ptr, int count)
 {
     int i;
-    printk(KERN_INFO "\t_PSS: state_count=%d\n", count);
+    printk("\t_PSS: state_count=%d\n", count);
     for (i=0; i<count; i++){
-        printk(KERN_INFO "\tState%d: %"PRId64"MHz %"PRId64"mW %"PRId64"us "
+        printk("\tState%d: %"PRId64"MHz %"PRId64"mW %"PRId64"us "
                "%"PRId64"us 0x%"PRIx64" 0x%"PRIx64"\n",
-                i,
-                ptr[i].core_frequency,
-                ptr[i].power, 
-                ptr[i].transition_latency,
-                ptr[i].bus_master_latency,
-                ptr[i].control,
-                ptr[i].status
-              );
+               i,
+               ptr[i].core_frequency,
+               ptr[i].power,
+               ptr[i].transition_latency,
+               ptr[i].bus_master_latency,
+               ptr[i].control,
+               ptr[i].status);
     }
 }
 
 static void print_PSD( struct xen_psd_package *ptr)
 {
-    printk(KERN_INFO "\t_PSD: num_entries=%"PRId64" rev=%"PRId64
+    printk("\t_PSD: num_entries=%"PRId64" rev=%"PRId64
            " domain=%"PRId64" coord_type=%"PRId64" num_processors=%"PRId64"\n",
-            ptr->num_entries, ptr->revision, ptr->domain, ptr->coord_type, 
-            ptr->num_processors);
+           ptr->num_entries, ptr->revision, ptr->domain, ptr->coord_type,
+           ptr->num_processors);
 }
 
 static void print_PPC(unsigned int platform_limit)
 {
-    printk(KERN_INFO "\t_PPC: %d\n", platform_limit);
+    printk("\t_PPC: %d\n", platform_limit);
 }
 
 int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance 
*dom0_px_info)
@@ -370,8 +374,9 @@ int set_px_pminfo(uint32_t acpi_id, stru
         ret = -EINVAL;
         goto out;
     }
-    printk(KERN_INFO "Set CPU acpi_id(%d) cpuid(%d) Px State info:\n",
-            acpi_id, cpuid);
+    if ( cpufreq_verbose )
+        printk("Set CPU acpi_id(%d) cpuid(%d) Px State info:\n",
+               acpi_id, cpuid);
 
     pmpt = processor_pminfo[cpuid];
     if ( !pmpt )
@@ -415,8 +420,12 @@ int set_px_pminfo(uint32_t acpi_id, stru
         memcpy ((void *)&pxpt->status_register,
                 (void *)&dom0_px_info->status_register,
                 sizeof(struct xen_pct_register));
-        print_PCT(&pxpt->control_register);
-        print_PCT(&pxpt->status_register);
+
+        if ( cpufreq_verbose )
+        {
+            print_PCT(&pxpt->control_register);
+            print_PCT(&pxpt->status_register);
+        }
     }
 
     if ( dom0_px_info->flags & XEN_PX_PSS ) 
@@ -437,7 +446,9 @@ int set_px_pminfo(uint32_t acpi_id, stru
         copy_from_guest(pxpt->states, dom0_px_info->states, 
                                       dom0_px_info->state_count);
         pxpt->state_count = dom0_px_info->state_count;
-        print_PSS(pxpt->states,pxpt->state_count);
+
+        if ( cpufreq_verbose )
+            print_PSS(pxpt->states,pxpt->state_count);
     }
 
     if ( dom0_px_info->flags & XEN_PX_PSD )
@@ -458,13 +469,17 @@ int set_px_pminfo(uint32_t acpi_id, stru
         memcpy ((void *)&pxpt->domain_info,
                 (void *)&dom0_px_info->domain_info,
                 sizeof(struct xen_psd_package));
-        print_PSD(&pxpt->domain_info);
+
+        if ( cpufreq_verbose )
+            print_PSD(&pxpt->domain_info);
     }
 
     if ( dom0_px_info->flags & XEN_PX_PPC )
     {
         pxpt->platform_limit = dom0_px_info->platform_limit;
-        print_PPC(pxpt->platform_limit);
+
+        if ( cpufreq_verbose )
+            print_PPC(pxpt->platform_limit);
 
         if ( pxpt->init == XEN_PX_INIT )
         {
@@ -506,6 +521,11 @@ static int __init cpufreq_handle_common_
         return 1;
     }
 
+    if (!strcmp(name, "verbose")) {
+        cpufreq_verbose = !val || !!simple_strtoul(val, NULL, 0);
+        return 1;
+    }
+
     return 0;
 }
 
--- 2010-03-02.orig/xen/drivers/cpufreq/utility.c       2010-02-08 
17:39:12.000000000 +0100
+++ 2010-03-02/xen/drivers/cpufreq/utility.c    2010-03-18 11:38:23.000000000 
+0100
@@ -229,8 +229,9 @@ int cpufreq_frequency_table_cpuinfo(stru
     }
     if (second_max_freq == 0)
         second_max_freq = max_freq;
-    printk(XENLOG_INFO "max_freq: %u    second_max_freq: %u\n",
-           max_freq, second_max_freq);
+    if (cpufreq_verbose)
+        printk("max_freq: %u    second_max_freq: %u\n",
+               max_freq, second_max_freq);
 
     policy->min = policy->cpuinfo.min_freq = min_freq;
     policy->max = policy->cpuinfo.max_freq = max_freq;
--- 2010-03-02.orig/xen/include/acpi/cpufreq/cpufreq.h  2010-03-18 
10:11:23.000000000 +0100
+++ 2010-03-02/xen/include/acpi/cpufreq/cpufreq.h       2010-03-18 
11:38:57.000000000 +0100
@@ -22,6 +22,8 @@
 
 DECLARE_PER_CPU(spinlock_t, cpufreq_statistic_lock);
 
+extern bool_t __read_mostly cpufreq_verbose;
+
 struct cpufreq_governor;
 
 struct acpi_cpufreq_data {


Attachment: cpufreq-verbosity.patch
Description: Text document

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

 


Rackspace

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