Re: How to determine when kernel booting has completed ?

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

 



On Sat, 2008-11-15 at 15:52 +0530, Manish Katiyar wrote:
> Hi,
> 
> I got a simple (probably silly question) while we were trying to hook
> a system call few days back in one of the threads posted earlier.
> Let's say I want to log all the users/calls of someone calling
> kmem_cache_alloc() after the system has come up ie... any external
> module which might be calling this during load.
> 
>  If I just add a printk to log it will record all the calls, not the
> one which were made after the kernel came up and we logged into the
> system (or userspace scripts loaded some module during booting). So
> the basic question is how do i conditionalize this printk. From kernel
> how can I know that my system is still booting or it has come up ?? Is
> there any global variable for example which says kernel_state=BOOTING
> or any other way which tells me in what phase of booting are we ? If
> it were I could have easily done something like :-
> 
> if (kernel_state  >= BOOT_COMPLETE)
>        printk(...........);
> 
> Makes sense ???
> 
> Thanks -
> Manish
> 
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ

Look at 
init/main.c  
	init_post()

system_state = SYSTEM_RUNNING;


this is the last of the kernel initialization.

--anup


--
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