Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753928AbbERLu4 (ORCPT ); Mon, 18 May 2015 07:50:56 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:33213 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753875AbbERLuk (ORCPT ); Mon, 18 May 2015 07:50:40 -0400 From: Iulia Manda To: tim.bird@sonymobile.com Cc: linux-kernel@vger.kernel.org, josh@joshtriplett.org Subject: [PATCH 3/3] init: Set initcall_debug to a default value Date: Mon, 18 May 2015 14:50:32 +0300 Message-Id: <1431949832-13606-3-git-send-email-iulia.manda21@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431949832-13606-1-git-send-email-iulia.manda21@gmail.com> References: <1431949832-13606-1-git-send-email-iulia.manda21@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3176 Lines: 83 Test the previously implemented macros on initcall_debug parameter, after setting CONFIG_CMDLINE_PARSE to 'n'. This change is a first example for how knowing the values of kernel parameters at build time can allow GCC constant folding and result in an actually relevant decrease in size. Other types of parameters also need to be handled. Also, at the moment this would only work with default values. For being able to change those defaults and still know their values at compile time, a pre-compiled stand-alone parser should be run on those variables. This will be discussed in a following patch. The variable corresponding to initcall_debug kernel parameter is set by default to false. Even though DEFINE_CORE_PARAM resumes to nothing when CONFIG_CMDLINE_PARSE is not set, we need to use it in main.c so that it is still defined when this option is 'y'. Bloat-o-meter output: add/remove: 0/3 grow/shrink: 0/9 up/down: 0/-385 (-385) function old new delta initcall_debug 1 - -1 pm_init 105 100 -5 __param_str_initcall_debug 15 - -15 __param_initcall_debug 16 - -16 syscore_suspend 247 224 -23 syscore_resume 175 152 -23 syscore_shutdown 80 55 -25 pci_fixup_device 235 198 -37 async_synchronize_cookie_domain 162 116 -46 async_run_entry_fn 178 127 -51 device_shutdown 256 204 -52 do_one_initcall 339 248 -91 Signed-off-by: Iulia Manda Reviewed-by: Josh Triplett --- include/linux/init.h | 3 ++- init/main.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index 21b6d76..7c7ee80 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -3,6 +3,7 @@ #include #include +#include /* These macros are used to mark some functions or * initialized data (doesn't apply to uninitialized data) @@ -155,7 +156,7 @@ int __init init_rootfs(void); extern void (*late_time_init)(void); -extern bool initcall_debug; +DECLARE_CORE_PARAM(initcall_debug, false, bool); #endif diff --git a/init/main.c b/init/main.c index 2115055..a7d0129 100644 --- a/init/main.c +++ b/init/main.c @@ -688,8 +688,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, false, bool, 0644); #ifdef CONFIG_KALLSYMS struct blacklist_entry { -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/