public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] initcall: add config option for compiling initcall_debug
@ 2011-03-27 11:55 Konstantin Khlebnikov
  2011-03-27 17:43 ` Randy Dunlap
  2011-03-28  7:51 ` [PATCH v2 typo-fixed] " Konstantin Khlebnikov
  0 siblings, 2 replies; 6+ messages in thread
From: Konstantin Khlebnikov @ 2011-03-27 11:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

Add bool config option CONFIG_INITCALL_DEBUG for compiling initcalls debuging,
make it on by default to keep current behaviour.

With CONFIG_INITCALL_DEBUG=n bloat-o-meter shows:

add/remove: 0/7 grow/shrink: 3/10 up/down: 88/-1448 (-1360)
function                                     old     new   delta
device_resume                                350     404     +54
__device_suspend                             331     363     +32
device_resume_noirq                          230     232      +2
kernel_init                                  355     354      -1
initcall_debug                                 4       -      -4
__param_str_initcall_debug                    15       -     -15
dpm_suspend                                  431     415     -16
syscore_suspend                              280     250     -30
syscore_shutdown                             123      93     -30
__param_initcall_debug                        32       -     -32
syscore_resume                               215     173     -42
static.initcall_debug_start                   71       -     -71
static.initcall_debug_report                 102       -    -102
legacy_resume                                129       -    -129
async_synchronize_cookie_domain              286     152    -134
legacy_suspend                               135       -    -135
async_run_entry_fn                           348     188    -160
do_one_initcall                              364     197    -167
pm_op                                        536     366    -170
pm_noirq_op                                  576     366    -210

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 Documentation/kernel-parameters.txt |    2 +-
 include/linux/init.h                |    4 ++++
 init/main.c                         |    2 ++
 kernel/async.c                      |    4 +---
 lib/Kconfig.debug                   |    7 +++++++
 5 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c357a31..ea3843a 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -970,7 +970,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
 	initcall_debug	[KNL] Trace initcalls as they are executed.  Useful
 			for working out where the kernel is dying during
-			startup.
+			startup. This depend on CONFIG_INITCALL_DEBUG option.
 
 	initrd=		[BOOT] Specify the location of the initial ramdisk
 
diff --git a/include/linux/init.h b/include/linux/init.h
index 577671c..e2005ab 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -156,7 +156,11 @@ void prepare_namespace(void);
 
 extern void (*late_time_init)(void);
 
+#ifdef CONFIG_INITCALL_DEBUG
 extern int initcall_debug;
+#else
+# define initcall_debug	0
+#endif
 
 #endif
   
diff --git a/init/main.c b/init/main.c
index 4a9479e..0902999 100644
--- a/init/main.c
+++ b/init/main.c
@@ -636,8 +636,10 @@ static void __init do_ctors(void)
 #endif
 }
 
+#ifdef CONFIG_INITCALL_DEBUG
 int initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);
+#endif
 
 static char msgbuf[64];
 
diff --git a/kernel/async.c b/kernel/async.c
index 3d8220a..8801e1e 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -48,6 +48,7 @@ asynchronous and synchronous parts of the kernel.
 
 */
 
+#include <linux/init.h>
 #include <linux/async.h>
 #include <linux/module.h>
 #include <linux/wait.h>
@@ -77,9 +78,6 @@ static DECLARE_WAIT_QUEUE_HEAD(async_done);
 
 static atomic_t entry_count;
 
-extern int initcall_debug;
-
-
 /*
  * MUST be called with the lock held!
  */
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index df9234c..ebc1357 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -807,6 +807,13 @@ config DEBUG_CREDENTIALS
 
 	  If unsure, say N.
 
+config INITCALL_DEBUG
+	bool "Debug kernel initcalls"
+	default y
+	help
+	  This build option allow you trace initcalls after
+	  adding "initcall_debug" to kernel command line.
+
 #
 # Select this config option from the architecture Kconfig, if it
 # it is preferred to always offer frame pointers as a config


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] initcall: add config option for compiling initcall_debug
  2011-03-27 11:55 [PATCH] initcall: add config option for compiling initcall_debug Konstantin Khlebnikov
@ 2011-03-27 17:43 ` Randy Dunlap
  2011-03-28  7:53   ` Konstantin Khlebnikov
  2011-03-28  7:51 ` [PATCH v2 typo-fixed] " Konstantin Khlebnikov
  1 sibling, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2011-03-27 17:43 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: linux-kernel, Andrew Morton

On Sun, 27 Mar 2011 15:55:06 +0400 Konstantin Khlebnikov wrote:

> Add bool config option CONFIG_INITCALL_DEBUG for compiling initcalls debuging,
> make it on by default to keep current behaviour.

Typo fixes only:


> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> ---
>  Documentation/kernel-parameters.txt |    2 +-
>  include/linux/init.h                |    4 ++++
>  init/main.c                         |    2 ++
>  kernel/async.c                      |    4 +---
>  lib/Kconfig.debug                   |    7 +++++++
>  5 files changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index c357a31..ea3843a 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -970,7 +970,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  
>  	initcall_debug	[KNL] Trace initcalls as they are executed.  Useful
>  			for working out where the kernel is dying during
> -			startup.
> +			startup. This depend on CONFIG_INITCALL_DEBUG option.

			              depends on the CONFIG_INITCALL_DEBUG option.

>  
>  	initrd=		[BOOT] Specify the location of the initial ramdisk


> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index df9234c..ebc1357 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -807,6 +807,13 @@ config DEBUG_CREDENTIALS
>  
>  	  If unsure, say N.
>  
> +config INITCALL_DEBUG
> +	bool "Debug kernel initcalls"
> +	default y
> +	help
> +	  This build option allow you trace initcalls after

	                    allows you to trace initcalls by

> +	  adding "initcall_debug" to kernel command line.

	                          to the kernel command line.

> +
>  #
>  # Select this config option from the architecture Kconfig, if it
>  # it is preferred to always offer frame pointers as a config


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 typo-fixed] initcall: add config option for compiling initcall_debug
  2011-03-27 11:55 [PATCH] initcall: add config option for compiling initcall_debug Konstantin Khlebnikov
  2011-03-27 17:43 ` Randy Dunlap
@ 2011-03-28  7:51 ` Konstantin Khlebnikov
  2011-03-29 22:57   ` Andrew Morton
  1 sibling, 1 reply; 6+ messages in thread
From: Konstantin Khlebnikov @ 2011-03-28  7:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

This patch adds bool config option CONFIG_INITCALL_DEBUG for
compiling initcalls debuging, it on by default to keep current behaviour.

With CONFIG_INITCALL_DEBUG=n bloat-o-meter shows:

add/remove: 0/7 grow/shrink: 3/10 up/down: 88/-1448 (-1360)
function                                     old     new   delta
device_resume                                350     404     +54
__device_suspend                             331     363     +32
device_resume_noirq                          230     232      +2
kernel_init                                  355     354      -1
initcall_debug                                 4       -      -4
__param_str_initcall_debug                    15       -     -15
dpm_suspend                                  431     415     -16
syscore_suspend                              280     250     -30
syscore_shutdown                             123      93     -30
__param_initcall_debug                        32       -     -32
syscore_resume                               215     173     -42
static.initcall_debug_start                   71       -     -71
static.initcall_debug_report                 102       -    -102
legacy_resume                                129       -    -129
async_synchronize_cookie_domain              286     152    -134
legacy_suspend                               135       -    -135
async_run_entry_fn                           348     188    -160
do_one_initcall                              364     197    -167
pm_op                                        536     366    -170
pm_noirq_op                                  576     366    -210

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 Documentation/kernel-parameters.txt |    3 ++-
 include/linux/init.h                |    4 ++++
 init/main.c                         |    2 ++
 kernel/async.c                      |    4 +---
 lib/Kconfig.debug                   |    7 +++++++
 5 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c357a31..a6417e5 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -970,7 +970,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
 	initcall_debug	[KNL] Trace initcalls as they are executed.  Useful
 			for working out where the kernel is dying during
-			startup.
+			startup. This depends on the CONFIG_INITCALL_DEBUG
+			option.
 
 	initrd=		[BOOT] Specify the location of the initial ramdisk
 
diff --git a/include/linux/init.h b/include/linux/init.h
index 577671c..e2005ab 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -156,7 +156,11 @@ void prepare_namespace(void);
 
 extern void (*late_time_init)(void);
 
+#ifdef CONFIG_INITCALL_DEBUG
 extern int initcall_debug;
+#else
+# define initcall_debug	0
+#endif
 
 #endif
   
diff --git a/init/main.c b/init/main.c
index 4a9479e..0902999 100644
--- a/init/main.c
+++ b/init/main.c
@@ -636,8 +636,10 @@ static void __init do_ctors(void)
 #endif
 }
 
+#ifdef CONFIG_INITCALL_DEBUG
 int initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);
+#endif
 
 static char msgbuf[64];
 
diff --git a/kernel/async.c b/kernel/async.c
index 3d8220a..8801e1e 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -48,6 +48,7 @@ asynchronous and synchronous parts of the kernel.
 
 */
 
+#include <linux/init.h>
 #include <linux/async.h>
 #include <linux/module.h>
 #include <linux/wait.h>
@@ -77,9 +78,6 @@ static DECLARE_WAIT_QUEUE_HEAD(async_done);
 
 static atomic_t entry_count;
 
-extern int initcall_debug;
-
-
 /*
  * MUST be called with the lock held!
  */
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index df9234c..f6e6c17 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -807,6 +807,13 @@ config DEBUG_CREDENTIALS
 
 	  If unsure, say N.
 
+config INITCALL_DEBUG
+	bool "Debug kernel initcalls"
+	default y
+	help
+	  This build option allows you to trace initcalls by
+	  adding "initcall_debug" to the kernel command line.
+
 #
 # Select this config option from the architecture Kconfig, if it
 # it is preferred to always offer frame pointers as a config


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] initcall: add config option for compiling initcall_debug
  2011-03-27 17:43 ` Randy Dunlap
@ 2011-03-28  7:53   ` Konstantin Khlebnikov
  0 siblings, 0 replies; 6+ messages in thread
From: Konstantin Khlebnikov @ 2011-03-28  7:53 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel@vger.kernel.org, Andrew Morton

Randy Dunlap wrote:
> On Sun, 27 Mar 2011 15:55:06 +0400 Konstantin Khlebnikov wrote:
>
>> Add bool config option CONFIG_INITCALL_DEBUG for compiling initcalls debuging,
>> make it on by default to keep current behaviour.
>
> Typo fixes only:

Ok, thanks.

>
>
>> Signed-off-by: Konstantin Khlebnikov<khlebnikov@openvz.org>
>> ---
>>   Documentation/kernel-parameters.txt |    2 +-
>>   include/linux/init.h                |    4 ++++
>>   init/main.c                         |    2 ++
>>   kernel/async.c                      |    4 +---
>>   lib/Kconfig.debug                   |    7 +++++++
>>   5 files changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
>> index c357a31..ea3843a 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -970,7 +970,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>>
>>   	initcall_debug	[KNL] Trace initcalls as they are executed.  Useful
>>   			for working out where the kernel is dying during
>> -			startup.
>> +			startup. This depend on CONFIG_INITCALL_DEBUG option.
>
> 			depends on the CONFIG_INITCALL_DEBUG option.
>
>>
>>   	initrd=		[BOOT] Specify the location of the initial ramdisk
>
>
>> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
>> index df9234c..ebc1357 100644
>> --- a/lib/Kconfig.debug
>> +++ b/lib/Kconfig.debug
>> @@ -807,6 +807,13 @@ config DEBUG_CREDENTIALS
>>
>>   	  If unsure, say N.
>>
>> +config INITCALL_DEBUG
>> +	bool "Debug kernel initcalls"
>> +	default y
>> +	help
>> +	  This build option allow you trace initcalls after
>
> 	allows you to trace initcalls by
>
>> +	  adding "initcall_debug" to kernel command line.
>
> 	to the kernel command line.
>
>> +
>>   #
>>   # Select this config option from the architecture Kconfig, if it
>>   # it is preferred to always offer frame pointers as a config
>
>
> ---
> ~Randy
> *** Remember to use Documentation/SubmitChecklist when testing your code ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 typo-fixed] initcall: add config option for compiling initcall_debug
  2011-03-28  7:51 ` [PATCH v2 typo-fixed] " Konstantin Khlebnikov
@ 2011-03-29 22:57   ` Andrew Morton
  2011-03-30 22:31     ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2011-03-29 22:57 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: linux-kernel, Rafael J. Wysocki, Tejun Heo, Arjan van de Ven

On Mon, 28 Mar 2011 11:51:31 +0400
Konstantin Khlebnikov <khlebnikov@openvz.org> wrote:

> This patch adds bool config option CONFIG_INITCALL_DEBUG for
> compiling initcalls debuging, it on by default to keep current behaviour.
> 
> With CONFIG_INITCALL_DEBUG=n bloat-o-meter shows:
> 
> add/remove: 0/7 grow/shrink: 3/10 up/down: 88/-1448 (-1360)
> function                                     old     new   delta
> device_resume                                350     404     +54
> __device_suspend                             331     363     +32
> device_resume_noirq                          230     232      +2
> kernel_init                                  355     354      -1
> initcall_debug                                 4       -      -4
> __param_str_initcall_debug                    15       -     -15
> dpm_suspend                                  431     415     -16
> syscore_suspend                              280     250     -30
> syscore_shutdown                             123      93     -30
> __param_initcall_debug                        32       -     -32
> syscore_resume                               215     173     -42
> static.initcall_debug_start                   71       -     -71
> static.initcall_debug_report                 102       -    -102
> legacy_resume                                129       -    -129
> async_synchronize_cookie_domain              286     152    -134
> legacy_suspend                               135       -    -135
> async_run_entry_fn                           348     188    -160
> do_one_initcall                              364     197    -167
> pm_op                                        536     366    -170
> pm_noirq_op                                  576     366    -210

Well.  One hopes that most things which use initcall_debug are
marked __init or __initdata.

I see that async and pm have borrowed inticall_debug for reasonably
appropriate reasons, but I wonder if all that is permanent code, or if
it will later get removed.  Because if it gets removed, this patch
becomes rather pointless.

And the async code didn't try very hard anyway - it has a bunch of code
wired into .text which is only used at boot time.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 typo-fixed] initcall: add config option for compiling initcall_debug
  2011-03-29 22:57   ` Andrew Morton
@ 2011-03-30 22:31     ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2011-03-30 22:31 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Konstantin Khlebnikov, linux-kernel, Tejun Heo, Arjan van de Ven

On Wednesday, March 30, 2011, Andrew Morton wrote:
> On Mon, 28 Mar 2011 11:51:31 +0400
> Konstantin Khlebnikov <khlebnikov@openvz.org> wrote:
> 
> > This patch adds bool config option CONFIG_INITCALL_DEBUG for
> > compiling initcalls debuging, it on by default to keep current behaviour.
> > 
> > With CONFIG_INITCALL_DEBUG=n bloat-o-meter shows:
> > 
> > add/remove: 0/7 grow/shrink: 3/10 up/down: 88/-1448 (-1360)
> > function                                     old     new   delta
> > device_resume                                350     404     +54
> > __device_suspend                             331     363     +32
> > device_resume_noirq                          230     232      +2
> > kernel_init                                  355     354      -1
> > initcall_debug                                 4       -      -4
> > __param_str_initcall_debug                    15       -     -15
> > dpm_suspend                                  431     415     -16
> > syscore_suspend                              280     250     -30
> > syscore_shutdown                             123      93     -30
> > __param_initcall_debug                        32       -     -32
> > syscore_resume                               215     173     -42
> > static.initcall_debug_start                   71       -     -71
> > static.initcall_debug_report                 102       -    -102
> > legacy_resume                                129       -    -129
> > async_synchronize_cookie_domain              286     152    -134
> > legacy_suspend                               135       -    -135
> > async_run_entry_fn                           348     188    -160
> > do_one_initcall                              364     197    -167
> > pm_op                                        536     366    -170
> > pm_noirq_op                                  576     366    -210
> 
> Well.  One hopes that most things which use initcall_debug are
> marked __init or __initdata.
> 
> I see that async and pm have borrowed inticall_debug for reasonably
> appropriate reasons, but I wonder if all that is permanent code, or if
> it will later get removed.  Because if it gets removed, this patch
> becomes rather pointless.

This is permanent code, as far as PM is concerned.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-30 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-27 11:55 [PATCH] initcall: add config option for compiling initcall_debug Konstantin Khlebnikov
2011-03-27 17:43 ` Randy Dunlap
2011-03-28  7:53   ` Konstantin Khlebnikov
2011-03-28  7:51 ` [PATCH v2 typo-fixed] " Konstantin Khlebnikov
2011-03-29 22:57   ` Andrew Morton
2011-03-30 22:31     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox