Re: how is the kernel boot-time param "printk.time" implemented?

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

 



On Fri, 25 Apr 2008, Mulyadi Santosa wrote:

> Hi..
>
> On Fri, Apr 25, 2008 at 12:44 PM, Robert P. J. Day
> <rpjday@xxxxxxxxxxxxxx> wrote:
> >  but remember, somehow this is defining that "printk.time" is a valid
> >                                                    ^
> >  boot-time parameter, and i just didn't know you could do that without
> >  writing an actual module.  i guess i'll just take a closer look at the
> >  contents of moduleparam.h to see how this is being done.
>
> yeah, actually I have to thank you, because I didn't know about it
> before :)

you're welcome.  but i'm still confused as to how that code in
kernel/printk.c ends up defining a boot-time parameter named
"printk.time".  i'm still open to suggestions.

rday

p.s.  i can *sort of* follow the logic.  in kernel/printk.c, we have
...
#if defined(CONFIG_PRINTK_TIME)
static int printk_time = 1;
#else
static int printk_time = 0;
#endif
module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
...

  next, in moduleparam.h, we have:
...
#ifdef MODULE
#define MODULE_PARAM_PREFIX /* empty */
#else
#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
#endif
...

which, because that source file is not being built as a module, will
define MODULE_PARAM_PREFIX with the KBUILD_MODNAME value, which i'm
assuming is simply the basename of the source file -- "printk".

so i'm convinced that, if i follow the logic far enough, the
combination of the above will, in fact, define a boot-time parameter
whose name is "printk.time", even though there is no actual "module"
source file named printk.c.

here's an easier question -- given that we *know* that that boot-time
parameter *must* be defined for the kernel, can we use readelf or
objdump to display its existence in a newly-built kernel?  i would
have thought it would have been placed in the "__param" section but i
don't see it there.  thoughts?

--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux