Skip to content

Commit 7b8811e

Browse files
committed
rename init_dev_kmsg to time_boot and move doc to README
1 parent be6319a commit 7b8811e

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,24 @@ Source: link:kernel_module/user/sleep_forever.c[]
23632363

23642364
This executable is a convenient simple init that does not panic and sleeps instead.
23652365

2366+
==== time_boot.out
2367+
2368+
Get a reasonable answer to "how long does boot take?":
2369+
2370+
....
2371+
./run -F '/time_boot.out'
2372+
....
2373+
2374+
Dmesg contains a message of type:
2375+
2376+
....
2377+
[ 2.188242] time_boot.c
2378+
....
2379+
2380+
which tells us that boot took `2.188242` seconds.
2381+
2382+
Bibliography: https://stackoverflow.com/questions/12683169/measure-time-taken-for-linux-kernel-from-bootup-to-userpace/46517014#46517014
2383+
23662384
[[init-busybox]]
23672385
=== Run command at the end of BusyBox init
23682386

kernel_module/user/init_dev_kmsg.c renamed to kernel_module/user/time_boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* https://stackoverflow.com/questions/12683169/measure-time-taken-for-linux-kernel-from-bootup-to-userpace/46517014#46517014 */
1+
/* https://github.com/cirosantilli/linux-kernel-module-cheat#time_boot-out */
22

33
#include <stdio.h>
44
#include <unistd.h>

0 commit comments

Comments
 (0)