TheLoneJoker TheLoneJoker - 3 years ago 190
Linux Question

Measure time taken for linux kernel from bootup to userpace

Is there a Kernel instrumentation based way to measure the time at which the Kernel transfers over to the Userspace during boot-up ? I could use printk's with timing information, but I just wasn't sure, where exactly to place this printk, in order to observe when the Kernel transfers over to the Userspace.

Answer Source

The start_kernel() is called by architecture specific code (arch/architecture_type). After the kernel loads, it calls the first user-space process,i.e. /sbin/init (or systemd on a more recent distribution) from init_post() Both these functions are defined in init/main.c.

You might want to read this blog for a detailed description of the boot process.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download