dynamic debug v2 - convert cpufreq
Subsystems (3)
PATCH 6/7 dynamic debug v2 - convert cpufreq
-convert cpufreq
---
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 7 ++- arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c | 6 ++- arch/x86/kernel/cpu/cpufreq/gx-suspmod.c | 7 ++- arch/x86/kernel/cpu/cpufreq/longhaul.c | 7 ++- arch/x86/kernel/cpu/cpufreq/longrun.c | 6 ++- arch/x86/kernel/cpu/cpufreq/p4-clockmod.c | 7 +++ arch/x86/kernel/cpu/cpufreq/powernow-k7.c | 6 ++- arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 2 - arch/x86/kernel/cpu/cpufreq/powernow-k8.h | 5 ++ arch/x86/kernel/cpu/cpufreq/sc520_freq.c | 6 ++- arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | 6 ++- arch/x86/kernel/cpu/cpufreq/speedstep-ich.c | 8 ++-- arch/x86/kernel/cpu/cpufreq/speedstep-smi.c | 6 ++- drivers/cpufreq/cpufreq.c | 45 +++++++++++----------- drivers/cpufreq/cpufreq_performance.c | 8 ++-- drivers/cpufreq/cpufreq_powersave.c | 7 ++- drivers/cpufreq/cpufreq_userspace.c | 6 ++- drivers/cpufreq/freq_table.c | 7 ++- include/linux/cpufreq.h | 11 ++++- lib/dynamic_printk.c | 5 +- 20 files changed, 116 insertions(+), 52 deletions(-)
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +5 -2
@@ -33,6 +33,7 @@#include <linux/cpufreq.h> #include <linux/compiler.h> #include <linux/dmi.h> +#include <linux/dynamic_debug_cpufreq.h> #include <linux/acpi.h> #include <acpi/processor.h>
@@ -44,7 +45,10 @@#include <asm/delay.h> #include <asm/uaccess.h> -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg); \ + } while (0)MODULE_AUTHOR ("Paul Diefenbaugh, Dominik Brodowski" );MODULE_DESCRIPTION ("ACPI Processor P-States Driver" );
@@ -780,7 +784,6 @@ static int __init acpi_cpufreq_init(void) static void __exit acpi_cpufreq_exit(void) {dprintk ("acpi_cpufreq_exit\n" ); -cpufreq_unregister_driver (&acpi_cpufreq_driver);free_percpu (acpi_perf_data);
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c +5 -1
@@ -14,6 +14,7 @@#include <linux/cpufreq.h> #include <linux/pci.h> #include <linux/delay.h> +#include <linux/dynamic_debug_cpufreq.h> #define NFORCE2_XTAL 25#define NFORCE2_BOOTFSB 0x48
@@ -55,7 +56,10 @@ MODULE_PARM_DESC(fid, "CPU multiplier to use (11.5 = 115)");MODULE_PARM_DESC (min_fsb,"Minimum FSB to use, if not defined: current FSB - 50" ); -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg); \ + } while (0)/** * nforce2_calc_fsb - calculate FSB
arch/x86/kernel/cpu/cpufreq/gx-suspmod.c +5 -2
@@ -79,6 +79,7 @@#include <linux/smp.h> #include <linux/cpufreq.h> #include <linux/pci.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/processor-cyrix.h> #include <asm/errno.h>
@@ -139,8 +140,10 @@ module_param (max_duration, int, 0444);*/ #define POLICY_MIN_DIV 20 - -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg); \ + } while (0)/** * we can detect a core multipiler from dir0_lsb
arch/x86/kernel/cpu/cpufreq/longhaul.c +5 -2
@@ -30,6 +30,7 @@#include <linux/slab.h> #include <linux/string.h> #include <linux/delay.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/msr.h> #include <asm/timex.h>
@@ -78,8 +79,10 @@ static int scale_voltage;static int disable_acpi_c3;static int revid_errata; -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) - +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg); \ + { while (0)/* Clock ratios multiplied by 10 */ static int clock_ratio[32 ];
arch/x86/kernel/cpu/cpufreq/longrun.c +5 -1
@@ -11,12 +11,16 @@#include <linux/init.h> #include <linux/slab.h> #include <linux/cpufreq.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/msr.h> #include <asm/processor.h> #include <asm/timex.h> -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg); \ + } while (0)static struct cpufreq_driver longrun_driver;
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +6 -1
@@ -27,6 +27,7 @@#include <linux/cpufreq.h> #include <linux/slab.h> #include <linux/cpumask.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/processor.h> #include <asm/msr.h>
@@ -35,7 +36,11 @@#include "speedstep-lib.h" #define PFX "p4-clockmod: " -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "p4-clockmod", msg) + +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "p4-clockmod", msg); \ + } while (0)/* * Duty Cycle (3bits), note DC_DISABLE is not specified in
arch/x86/kernel/cpu/cpufreq/powernow-k7.c +5 -1
@@ -20,6 +20,7 @@#include <linux/slab.h> #include <linux/string.h> #include <linux/dmi.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/msr.h> #include <asm/timer.h>
@@ -101,7 +102,10 @@ static unsigned int fsb;static unsigned int latency;static char have_a0; -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k7", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k7", msg); \ + } while (0)static int check_fsb (unsigned int fsbspeed) {
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +1 -1
@@ -33,6 +33,7 @@#include <linux/string.h> #include <linux/cpumask.h> #include <linux/sched.h> /* for current / set_cpus_allowed() */ +#include <linux/dynamic_debug_cpufreq.h> #include <asm/msr.h> #include <asm/io.h>
@@ -1306,7 +1307,6 @@ static int __cpuinit powernowk8_init(void) static void __exit powernowk8_exit(void) {dprintk ("exit\n" ); -cpufreq_unregister_driver (&cpufreq_amd64_driver); }
arch/x86/kernel/cpu/cpufreq/powernow-k8.h +4 -1
@@ -199,7 +199,10 @@ struct pst_s {u8 vid; }; -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg); \ + } while (0)static int core_voltage_pre_transition (struct powernow_k8_data *data,u32 reqvid);static int core_voltage_post_transition (struct powernow_k8_data *data,u32 reqvid);
arch/x86/kernel/cpu/cpufreq/sc520_freq.c +5 -1
@@ -19,6 +19,7 @@#include <linux/delay.h> #include <linux/cpufreq.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/msr.h> #include <asm/timex.h>
@@ -29,7 +30,10 @@static __u8 __iomem *cpuctl; -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg); \ + } while (0)static struct cpufreq_frequency_table sc520_freq_table[] = { {0x01 ,100000 },
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c +5 -1
@@ -20,6 +20,7 @@#include <linux/sched.h> /* current */ #include <linux/delay.h> #include <linux/compiler.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/msr.h> #include <asm/processor.h>
@@ -28,7 +29,10 @@#define PFX "speedstep-centrino: "#define MAINTAINER "[email protected]" -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg); \ + } while (0)#define INTEL_MSR_RANGE (0xffff)
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c +5 -3
@@ -25,6 +25,7 @@#include <linux/pci.h> #include <linux/slab.h> #include <linux/sched.h> +#include <linux/dynamic_debug_cpufreq.h> #include "speedstep-lib.h"
@@ -53,9 +54,10 @@ static struct cpufreq_frequency_table speedstep_freqs[] = { {0, CPUFREQ_TABLE_END}, }; - -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-ich", msg) - +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-ich", msg); \ + } while (0)/** * speedstep_find_register - read the PMBASE address
arch/x86/kernel/cpu/cpufreq/speedstep-smi.c +5 -1
@@ -19,6 +19,7 @@#include <linux/cpufreq.h> #include <linux/slab.h> #include <linux/delay.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/ist.h> #include <asm/io.h>
@@ -56,7 +57,10 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {* of DMA activity going on? */ #define SMI_TRIES 5 -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-smi", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-smi", msg); \ + } while (0)/** * speedstep_smi_ownership
drivers/cpufreq/cpufreq.c +23 -22
76 lines not on this page · raw message
drivers/cpufreq/cpufreq_performance.c +5 -3
@@ -14,10 +14,12 @@#include <linux/module.h> #include <linux/cpufreq.h> #include <linux/init.h> +#include <linux/dynamic_debug_cpufreq.h> -#define dprintk(msg...) \ - cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "performance", msg) - +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_GOVERNOR, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "performance", msg); \ + } while (0)static int cpufreq_governor_performance (struct cpufreq_policy *policy,unsigned int event)
drivers/cpufreq/cpufreq_powersave.c +5 -2
@@ -14,9 +14,12 @@#include <linux/module.h> #include <linux/cpufreq.h> #include <linux/init.h> +#include <linux/dynamic_debug_cpufreq.h> -#define dprintk(msg...) \ - cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "powersave", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_GOVERNOR, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "powersave", msg); \ + } while (0)static int cpufreq_governor_powersave (struct cpufreq_policy *policy,unsigned int event)
drivers/cpufreq/cpufreq_userspace.c +5 -1
@@ -23,6 +23,7 @@#include <linux/fs.h> #include <linux/sysfs.h> #include <linux/mutex.h> +#include <linux/dynamic_debug_cpufreq.h> #include <asm/uaccess.h>
@@ -39,7 +40,10 @@ static unsigned int cpu_is_managed[NR_CPUS];static DEFINE_MUTEX (userspace_mutex);static int cpus_using_userspace_governor; -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "userspace", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_GOVERNOR, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "userspace", msg); \ + } while (0)/* keep track of frequency transitions */ static int
drivers/cpufreq/freq_table.c +5 -2
@@ -8,9 +8,12 @@#include <linux/module.h> #include <linux/init.h> #include <linux/cpufreq.h> +#include <linux/dynamic_debug_cpufreq.h> -#define dprintk(msg...) \ - cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_CORE, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg); \ + } while (0)/********************************************************************* * FREQUENCY TABLE HELPERS *
include/linux/cpufreq.h +9 -2
@@ -366,11 +366,18 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);#define CPUFREQ_DEBUG_DRIVER 2#define CPUFREQ_DEBUG_GOVERNOR 4 -#ifdef CONFIG_CPU_FREQ_DEBUG +#define CPUFREQ_DEBUG_FLAGS_NUM 3 +#define CPUFREQ_DEBUG_FLAGS "CPUFREQ_DEBUG_CORE,CPUFREQ_DEBUG_DRIVER,CPUFREQ_DEBUG_GOVERNOR" + +extern unsigned int cpufreq_debug; +#if defined(CONFIG_CPU_FREQ_DEBUG ) && !defined(CONFIG_DYNAMIC_PRINTK_DEBUG ) +#define DEBUG 1 +#endif + +#if defined(CONFIG_CPU_FREQ_DEBUG ) || defined (CONFIG_DYNAMIC_PRINTK_DEBUG )extern void cpufreq_debug_printk (unsigned int type,const char *prefix,const char *fmt, ...); -#else #define cpufreq_debug_printk(msg...) do { } while(0)
lib/dynamic_printk.c +3 -2
@@ -209,7 +209,8 @@ int register_debug_module(char *mod_name, int type, char *share_name, num_enabled++; } } -if (strcmp (mod_name, share_name)) { +if (strcmp (mod_name, share_name) && (!elem->parent)) { +printk ("register_debug_module: %s :%s\n" , mod_name, share_name); parent =find_debug_module (share_name);if (!parent) {__add_debug_module (share_name);
@@ -227,7 +228,7 @@ int register_debug_module(char *mod_name, int type, char *share_name,list_add_rcu (&elem->shared_list, &parent->shared_list); }else elem->type = type; -if (num_flags >0 ) { +if (num_flags >0 && (!elem->flags)) {if ((elem->type_sharing ==SHARING_MEMBER ) && elem->parent) elem = elem->parent; elem->flags = kzalloc(sizeof(struct flags_descriptor),
Hi,
Quoted 1 line · Jason Baron
+#include <
linux/dynamic_debug_cpufreq.h>
what's contained in this file (couldn't find it in this or one of the other diffs, but may have missed it).
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c MODULE_PARM_DESC(fid, "CPU multiplier to use (11.5 = 115)"); · line 62
Quoted 5 lines
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c +4
-1-#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg); \ + } while (0)
Hm.... What about leaving this as it is, renaming the drivers/cpufreq/cpufreq.c function to __cpufreq_debug_printk(), and then adding to include/linux/cpufreq.h
#define cpufreq_debug_printk(type, prefix, msg...) do { \
if (dynamic_dbg_enabled(TYPE_FLAG, type, cpufreq_debug))
cpufreq_debug_printk(type, prefix, msg); \
} while (0)Quoted 1 line
+#if
defined(CONFIG_CPU_FREQ_DEBUG)|| defined (CONFIG_DYNAMIC_PRINTK_DEBUG)
...
Quoted 1 line
+#if
defined(CONFIG_CPU_FREQ_DEBUG)|| defined (CONFIG_DYNAMIC_PRINTK_DEBUG)
can't we just depend on thing on another?
drivers/cpufreq/cpufreq.c void cpufreq_debug_printk(unsigned int type, const char *prefix, · line 253
Quoted 5 lines
drivers/cpufreq/cpufreq.c +2
-2-module_param (debug, uint,0644 ); -MODULE_PARM_DESC (debug,"CPUfreq debugging: add 1 to debug core," +module_param (cpufreq_debug, uint,0644 ); +MODULE_PARM_DESC (cpufreq_debug,"CPUfreq debugging: add 1 to debug core," " 2 to debug drivers, and 4 to debug governors." );
cpufreq.cpufreq_debug is ugly and not backwards compatible... what about
module_param_named(debug, cpufreq_debug, uint, 0644) [or the other way around, I always forget...])
Best,
Dominik
Quoted 9 lines · Dominik Brodowski
Hi,
Quoted 1 line · Jason Baron
+#include <
linux/dynamic_debug_cpufreq.h>what's contained in this file (couldn't find it in this or one of the other diffs, but may have missed it).
i forgot to include it. A full patch is found below.
Quoted 10 lines
Review
Quoted 5 lines
(quoted diff) +4
-1-#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg) +#define dprintk(msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, CPUFREQ_DEBUG_DRIVER, cpufreq_debug)) \ + cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg); \ + } while (0)Hm.... What about leaving this as it is, renaming the
drivers/cpufreq/cpufreq.cfunction to__cpufreq_debug_printk(), and then adding toinclude/linux/cpufreq.h
Quoted 5 lines
#define cpufreq_debug_printk(type, prefix, msg...) do { \
if (dynamic_dbg_enabled(TYPE_FLAG, type, cpufreq_debug))
cpufreq_debug_printk(type, prefix, msg); \
} while (0)i agree that would be a bit cleaner. the new patch below includes this suggestion.
Quoted 6 lines
Quoted 1 line
+#if
defined(CONFIG_CPU_FREQ_DEBUG)|| defined (CONFIG_DYNAMIC_PRINTK_DEBUG)...
Quoted 1 line
+#if
defined(CONFIG_CPU_FREQ_DEBUG)|| defined (CONFIG_DYNAMIC_PRINTK_DEBUG)can't we just depend on thing on another?
We could make CONFIG_CPU_FREQ_DEBUG force CONFIG_DYNAMIC_PRINTK_DEBUG to be on. However, i'm trying to allow CONFIG_CPU_FREQ_DEBUG to be turned on without enabling CONFIG_DYNAMIC_PRINTK_DEBUG. That's consistent with how i'm trying to do this patch series. That is, individual subsystems can turn their respective debugging on without forcing on CONFIG_DYNAMIC_PRINTK_DEBUG.
Quoted 11 lines
Review
Quoted 5 lines
(quoted diff) +2
-2-module_param(debug, uint, 0644); -MODULE_PARM_DESC(debug, "CPUfreq debugging: add 1 to debug core," +module_param(cpufreq_debug, uint, 0644); +MODULE_PARM_DESC(cpufreq_debug, "CPUfreq debugging: add 1 to debug core," " 2 to debug drivers, and 4 to debug governors.");cpufreq.cpufreq_debug is ugly and not backwards compatible... what about
module_param_named(debug, cpufreq_debug, uint, 0644)[or the other way around, I always forget...])
makes sense.
thanks,
-Jason
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +1 -0
@@ -25,6 +25,7 @@* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c +1 -0
@@ -7,6 +7,7 @@* BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h>
arch/x86/kernel/cpu/cpufreq/gx-suspmod.c +1 -0
@@ -73,6 +73,7 @@* Suspend Modulation - Definitions * ************************************************************************/ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/longhaul.c +1 -0
@@ -21,6 +21,7 @@* BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h>
arch/x86/kernel/cpu/cpufreq/longrun.c +1 -0
@@ -6,6 +6,7 @@* BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +1 -0
@@ -20,6 +20,7 @@* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/powernow-k7.c +1 -0
@@ -12,6 +12,7 @@* - We disable half multipliers if ACPI is used on A0 stepping CPUs. */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h>
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +1 -0
@@ -24,6 +24,7 @@* http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/smp.h> #include <linux/module.h>
arch/x86/kernel/cpu/cpufreq/sc520_freq.c +1 -0
@@ -13,6 +13,7 @@* 2005-03-30: - initial revision */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c +1 -0
@@ -13,6 +13,7 @@* Copyright (C) 2003 Jeremy Fitzhardinge <[email protected]> */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c +1 -0
@@ -18,6 +18,7 @@* SPEEDSTEP - DEFINITIONS * *********************************************************************/ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
arch/x86/kernel/cpu/cpufreq/speedstep-smi.c +1 -0
@@ -12,6 +12,7 @@* SPEEDSTEP - DEFINITIONS * *********************************************************************/ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h>
drivers/cpufreq/cpufreq.c +20 -22
75 lines not on this page · raw message
drivers/cpufreq/cpufreq_performance.c +1 -0
@@ -10,6 +10,7 @@* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/cpufreq.h>
drivers/cpufreq/cpufreq_powersave.c +1 -0
@@ -10,6 +10,7 @@* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/cpufreq.h>
drivers/cpufreq/cpufreq_userspace.c +1 -0
@@ -11,6 +11,7 @@* */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/smp.h>
drivers/cpufreq/freq_table.c +1 -0
@@ -4,6 +4,7 @@* Copyright (C) 2002 - 2003 Dominik Brodowski */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
include/linux/cpufreq.h +9 -4
@@ -366,14 +366,19 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);#define CPUFREQ_DEBUG_DRIVER 2#define CPUFREQ_DEBUG_GOVERNOR 4 -#ifdef CONFIG_CPU_FREQ_DEBUG +#define cpufreq_debug_printk(flag, name, msg...) do { \ + if (dynamic_dbg_enabled(TYPE_FLAG, flag, cpufreq_debug)) \ + __cpufreq_debug_printk(flag, name, msg); \ + } while (0) -extern void cpufreq_debug_printk (unsigned int type,const char *prefix, -const char *fmt, ...); +#if defined(CONFIG_CPU_FREQ_DEBUG ) || defined (CONFIG_DYNAMIC_PRINTK_DEBUG ) +extern unsigned int cpufreq_debug; +extern void __cpufreq_debug_printk (unsigned int type,const char *prefix, +const char *fmt, ...);#else -#define cpufreq_debug_printk(msg...) do { } while(0) +#define __cpufreq_debug_printk(msg...) do { } while(0)#endif /* CONFIG_CPU_FREQ_DEBUG */
include/linux/dynamic_debug_cpufreq.h new file +8 -0
@@ -0,0 +1,8 @@ +#define DYNAMIC_DEBUG_NUM_FLAGS "3" +#define DYNAMIC_DEBUG_FLAG_NAMES "CPUFREQ_DEBUG_CORE,CPUFREQ_DEBUG_DRIVER,CPUFREQ_DEBUG_GOVERNOR" +#define DYNAMIC_DEBUG_TYPE "2" +#define DYNAMIC_DEBUG_MODNAME "cpufreq_shared" + +#ifdef CONFIG_CPU_FREQ_DEBUG +#define DEBUG 1 +#endif
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c line 31
Quoted 10 lines · Jason Baron
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +1
-0@@ -25,6 +25,7 @@* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
kernel.h includes dynamic_debug.h right? Then why not just put the _cpufreq.h stuff in the current cpufreq.h file(s)?
thanks,
greg k-h
Quoted 7 lines · Greg KH
Quoted 6 lines · Jason Baron
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +0
-0@@ -25,6 +25,7 @@* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Quoted 7 lines
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c line 31
Quoted 4 lines
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +1
-0+#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
kernel.hincludesdynamic_debug.hright? Then why not just put the_cpufreq.hstuff in the currentcpufreq.hfile(s)?
Seconded. Makes the cpufreq-related patch even smaller, for we won't have to touch all drivers.
Quoted 4 lines · Jason Baron
Quoted 4 lines
Quoted 1 line
+#if
defined(CONFIG_CPU_FREQ_DEBUG)|| defined (CONFIG_DYNAMIC_PRINTK_DEBUG)...
Quoted 1 line
+#if
defined(CONFIG_CPU_FREQ_DEBUG)|| defined (CONFIG_DYNAMIC_PRINTK_DEBUG)
Quoted 8 lines
Quoted 2 lines
can't we just depend on thing on another?
We could make
CONFIG_CPU_FREQ_DEBUGforceCONFIG_DYNAMIC_PRINTK_DEBUGto be on. However, i'm trying to allowCONFIG_CPU_FREQ_DEBUGto be turned on without enablingCONFIG_DYNAMIC_PRINTK_DEBUG. That's consistent with how i'm trying to do this patch series. That is, individual subsystems can turn their respective debugging on without forcing onCONFIG_DYNAMIC_PRINTK_DEBUG.
Makes sense, and we can discuss depending one thing on another later on.
Looking forward to seeing this infrastructure merged. I guess it will help a lot.
Best,
Dominik
Quoted 7 lines · Greg KH
Quoted 6 lines · Jason Baron
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +0
-0@@ -25,6 +25,7 @@* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Quoted 6 lines
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c line 31
Quoted 4 lines
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +1
-0+#include <linux/dynamic_debug_cpufreq.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
kernel.hincludesdynamic_debug.hright?
yes
Then why not just put the
Quoted 2 lines
_cpufreq.hstuff in the currentcpufreq.hfile(s)?
1) cpufreq.h is included by other subsystems, and thus those other subsystems potentially have the wrong debugging information.
2) For the case where CONFIG_CPU_FREQ_DEBUG is set and CONFIG_DYNAMIC_PRINTK_DEBUG is not set i need to be able get the proper definition of 'dynamic_dbg_enabled()' out of dynamic_print.h (included by kernel.h). This proper definition is obtained by setting 'DEBUG', and thus i need to define this before the kernel.h include.
We can solve #2 by defining an explicit definition for dynamic_dbg_enabled() when only CONFIG_CPU_FREQ_DEBUG within cpufreq.h. roughly:
#ifdef CONFIG_CPU_FREQ_DEBUG
#define cpufreq_debug_printk(flag)
if (cpufreq_debug & flag)
__cpufreq_debug_printk()
However, the way i have it now I don't need two definitions for cpufreq_debug_printk....
If we could pull the subsystem specific header in dynamic_printk.h for each subsytem that would do the trick and be really clean, but i'm not sure of an easy way to do that...
-Jason
Quoted 6 lines · Jason Baron
Then why not just put the
Quoted 2 lines
_cpufreq.hstuff in the currentcpufreq.hfile(s)?1)
cpufreq.his included by other subsystems, and thus those other subsystems potentially have the wrong debugging information.
...
Quoted 3 lines
If we could pull the subsystem specific header in
dynamic_printk.hfor each subsytem that would do the trick and be really clean, but i'm not sure of an easy way to do that...
<within all cpufreq drivers>
#define DYNAMIC_DEBUG_CPU_FREQ 1
<dynamic_printk.h>
#ifdef DYNAMIC_DEBUG_CPU_FREQ
#define DYNAMIC_DEBUG_NUM_FLAGS "3"
...
#else
...
...
#endif
or -- even better -- could we determine the definition of DYNAMIC_DEBUG_CPU_FREQ on the fly? It needs to be set to true for exactly all "modules" which contain a call to cpufreq_debug_printk()...
Quoted 9 lines
2) For the case where
CONFIG_CPU_FREQ_DEBUGis set andCONFIG_DYNAMIC_PRINTK_DEBUGis not set i need to be able get the proper definition of 'dynamic_dbg_enabled()' out ofdynamic_print.h(included bykernel.h). This proper definition is obtained by setting 'DEBUG', and thus i need to define this before thekernel.hinclude.We can solve #2 by defining an explicit definition for
dynamic_dbg_enabled()when onlyCONFIG_CPU_FREQ_DEBUGwithincpufreq.h. roughly:
Quoted 7 lines
#ifdef
CONFIG_CPU_FREQ_DEBUG
#definecpufreq_debug_printk(flag)
if (cpufreq_debug& flag)
__cpufreq_debug_printk()However, the way i have it now I don't need two definitions for
cpufreq_debug_printk....
Not that much of a nuiseance, IMO. Or SELECT CONFIG_DYNAMIC_PRINTK_DEBUG when CONFIG_CPU_FREQ_DEBUG is enabled (if davej agrees ;) )
Best,
Dominik