[OPW,kernel,3/3] init: Set initcall_debug to a default value
diff mbox

Message ID 3604b2c1b6debe829c542a70ea3370f789d8d4b7.1425391406.git.iulia.manda21@gmail.com
State New, archived
Headers show

Commit Message

Iulia Manda March 3, 2015, 2:13 p.m. UTC
Test the previously implemented macros on initcall_debug parameter.

Bloat-o-meter output:

add/remove: 1/0 grow/shrink: 0/2 up/down: 1/-95 (-94)
function                                     old     new   delta
__initcall_debug                               -       1      +1
async_run_entry_fn                           178     174      -4
do_one_initcall                              339     248     -91

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
---
 include/linux/init.h | 2 +-
 init/main.c          | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

Josh Triplett March 3, 2015, 6:17 p.m. UTC | #1
On Tue, Mar 03, 2015 at 04:13:45PM +0200, Iulia Manda wrote:
> Test the previously implemented macros on initcall_debug parameter.

Works for now, though for the final series the commit message should
explain in more detail. :)

> Bloat-o-meter output:
> 
> add/remove: 1/0 grow/shrink: 0/2 up/down: 1/-95 (-94)
> function                                     old     new   delta
> __initcall_debug                               -       1      +1
> async_run_entry_fn                           178     174      -4
> do_one_initcall                              339     248     -91

This should improve significantly if the version in the header becomes a
static const.

> Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
> ---
>  include/linux/init.h | 2 +-
>  init/main.c          | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/init.h b/include/linux/init.h
> index ef32825..50863b7 100644
> --- a/include/linux/init.h
> +++ b/include/linux/init.h
> @@ -163,7 +163,7 @@ extern void (*late_time_init)(void);
>          const bool name
>  #endif
>  
> -extern bool initcall_debug;
> +extern DECLARE_CORE_PARAM(initcall_debug);

This should drop the extern, and let DECLARE_CORE_PARAM handle that.  In
the CONFIG_CMDLINE_PARSE case, DECLARE_CORE_PARAM should include extern;
in the other case, DECLARE_CORE_PARAM can declare a static const.
You'll need additional macro arguments for the type "bool" and the value
"false".

>  #endif
>    
> diff --git a/init/main.c b/init/main.c
> index 6f0f1c5f..27c446e 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -685,8 +685,7 @@ static void __init do_ctors(void)
>  #endif
>  }
>  
> -bool initcall_debug;
> -core_param(initcall_debug, initcall_debug, bool, 0644);
> +DEFINE_CORE_PARAM(initcall_debug, initcall_debug, 0, bool, 0644);

For a bool, the default value should be "false", not "0", right?  Or does
the command-line parsing not handle that?

- Josh Triplett

Patch
diff mbox

diff --git a/include/linux/init.h b/include/linux/init.h
index ef32825..50863b7 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -163,7 +163,7 @@  extern void (*late_time_init)(void);
         const bool name
 #endif
 
-extern bool initcall_debug;
+extern DECLARE_CORE_PARAM(initcall_debug);
 
 #endif
   
diff --git a/init/main.c b/init/main.c
index 6f0f1c5f..27c446e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -685,8 +685,7 @@  static void __init do_ctors(void)
 #endif
 }
 
-bool initcall_debug;
-core_param(initcall_debug, initcall_debug, bool, 0644);
+DEFINE_CORE_PARAM(initcall_debug, initcall_debug, 0, bool, 0644);
 
 #ifdef CONFIG_KALLSYMS
 struct blacklist_entry {