diff --git a/README.adoc b/README.adoc index 6b98b61..c914638 100644 --- a/README.adoc +++ b/README.adoc @@ -2363,6 +2363,24 @@ Source: link:kernel_module/user/sleep_forever.c[] This executable is a convenient simple init that does not panic and sleeps instead. +==== time_boot.out + +Get a reasonable answer to "how long does boot take?": + +.... +./run -F '/time_boot.out' +.... + +Dmesg contains a message of type: + +.... +[ 2.188242] time_boot.c +.... + +which tells us that boot took `2.188242` seconds. + +Bibliography: https://stackoverflow.com/questions/12683169/measure-time-taken-for-linux-kernel-from-bootup-to-userpace/46517014#46517014 + [[init-busybox]] === Run command at the end of BusyBox init diff --git a/kernel_module/user/init_dev_kmsg.c b/kernel_module/user/time_boot.c similarity index 58% rename from kernel_module/user/init_dev_kmsg.c rename to kernel_module/user/time_boot.c index bd20257..babec6e 100644 --- a/kernel_module/user/init_dev_kmsg.c +++ b/kernel_module/user/time_boot.c @@ -1,4 +1,4 @@ -/* https://stackoverflow.com/questions/12683169/measure-time-taken-for-linux-kernel-from-bootup-to-userpace/46517014#46517014 */ +/* https://github.com/cirosantilli/linux-kernel-module-cheat#time_boot-out */ #include #include