5

I need the sequence of modules/drivers that are invoked|initialized|probed during the kernl boot.

Can you please let me know if any flash command-line option available to get this sequence ?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Raj
  • 1,013
  • 2
  • 11
  • 23

2 Answers2

9

Passing the option "initcall_debug" on the kernel command line will cause timing information to be printed to the console for each init routine of built-in drivers. The initcalls are used to initialize statically linked kernel drivers and subsystems and contribute a significant amount of time to the Linux boot process. (Loadable modules are not available until after the root filesystem has been mounted.)

The output looks like:

calling  tty_class_init+0x0/0x44 @ 1
initcall tty_class_init+0x0/0x44 returned 0 after 9765 usecs
calling  spi_init+0x0/0x90 @ 1
initcall spi_init+0x0/0x90 returned 0 after 9765 usecs

Reference: http://elinux.org/Initcall_Debug

Addendum

Specifying the kernel parameter "ignore_loglevel" along with the "initcall_debug" will ensure that the information will be displayed during boot.

Community
  • 1
  • 1
sawdust
  • 16,103
  • 3
  • 40
  • 50
  • After enabling both initcall_debug=1 and ignore_loglevel=1 on the kernel command line, I am able to see the module initialization start and end times. The below link has more details on this. https://chengyihe.wordpress.com/2015/12/13/android-kernel-enable-initcall_debug-to-debug-initcall/ – Raj May 31 '16 at 07:09
  • The assignment "=1" is not necessary for the "initcall_debug" parameter. If you do not want to [change the log level](http://stackoverflow.com/questions/16390004/change-default-console-loglevel-during-boot-up/16390389#16390389) on the console, then you can use the `dmesg | less` commands to review the boot messages (assuming the log buffer is large enough and booting is successful to get you a shell prompt). – sawdust Jun 03 '16 at 00:47
  • Or `loglevel=8`. Arghh, very confusing how `pr_debug(` does not show but `printk(KERN_DEBUG` with `ignore_loglevel` and `CONFIG_DYNAMIC_DEBUG`: https://stackoverflow.com/questions/28936199/why-is-pr-debug-of-the-linux-kernel-not-giving-any-output/49835405#49835405 – Ciro Santilli OurBigBook.com May 05 '18 at 19:26
0

After enabling both initcall_debug=1 and ignore_loglevel=1 on the kernel command line, I am able to see the module initialization start and end times. The below link has more details on this.

https://chengyihe.wordpress.com/2015/12/13/android-kernel-enable-initcall_debug-to-debug-initcall/

Raj
  • 1,013
  • 2
  • 11
  • 23
  • Copying my answer for your own answer is tacky. This site won't last very long if every questioner was like you. – sawdust Jun 01 '16 at 06:57
  • Hi sir.. I don't have any wrong thoughts here actually. I found more detail explanation on that web page. So I thought it would be helpful here ans added as a new answer. But still I have given upvote to your answer. – Raj Jun 02 '16 at 16:35
  • Thanks for reconsidering your actions. – sawdust Jun 03 '16 at 00:43