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

Re: [Crash-utility] [PATCH 0/2] The new API about ikconfig.




----- Original Message -----
> Hi,
> 
> I would like to suggest new ikconfig's API from defs.h.
> 
> The get_kernel_config("config name without CONFIG_ prefix", &val)
> will return one of target kernel configurations.
> If val == NULL, return value is poinited whether config is valid or
> not.
> IKCONFIG_N: kernel config is not set (not valid).
> IKCONFIG_Y: kernel config is set y (valid).
> IKCONFIG_M: kernel config is set m (valid).
> IKCONFIG_STR: kernel config is values or strings, etc (valid).
> 
> API require CONFIG_IKCONFIG=y. Otherwise user is warned.
> 
> I think it is useful for such as extension module developers
> to write kernel config switch code.
> 
> Although ifdef or symbol APIs can be used instead,
> I believe using this API can write more impressive or flexible code
> about kernel config depended parts (over my senses...).

This does look like a good idea for extension modules.  I'm off today,
but will check your patches out tomorrow.

Thanks,
  Dave


> Thanks,
> Toshi.
> -----------------------------------------------------------
> 
> Example usage: Resolve RADIX_TREE_MAP_SHIFT from config depends.
> 
> [ code of kernel-2.6.35 ]
> 
> #define RADIX_TREE_MAP_SHIFT (CONFIG_BASE_SMALL ? 4 : 6)
> 
> [ code of crash utility or extension modules ]
> 
> static int radix_tree_map_shift = 6;
> #define RADIX_TREE_MAP_SHIFT radix_tree_map_shift
> 
> int _init(void)
> {
> read_in_kernel_config(IKCFG_SETUP);
> 
> if (get_kernel_config("BASE_SMALL", NULL) == IKCONFIG_Y)
> radix_tree_map_shift = 4;
> 
> return 0;
> }
> 
> int int _fini(void)
> {
> read_in_kernel_config(IKCFG_FREE);
> 
> return 0;
> }
> 
> Toshikazu Nakayama (2):
> new ikconfig API.
> dump_kernel_table()
> 
> crash-5.1.1/defs.h | 13 ++++
> crash-5.1.1/kernel.c | 166
> +++++++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 178 insertions(+), 1 deletions(-)
> 
> --
> 1.7.4.rc2
> 
> --
> Crash-utility mailing list
> Crash-utility redhat com
> https://www.redhat.com/mailman/listinfo/crash-utility


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