Bootloader sequence with time prefix
Dear all, Is there any uboot config option in to print boot sequence with time prefixes similar to kernel option CONFIG_PRINTK ? Thanks & Regards Dhyan
On Mon, 20 May 2013 12:37:25 +0530, Dhyan said:
Is there any uboot config option in to print boot sequence with time prefixes similar to kernel option CONFIG_PRINTK ?
I think you meant CONFIG_PRINTK_TIME there - and if that kernel option is set, all your printks will show up with that, even stuff coming out of early_printk(). Getting userspace to do it as well is a userspace problem, not a kernel problem. You'll have to fix multiple pieces - everything from your syslog daemon (whichever one you use) to sysvinit/systemd/upstart or whatever you boot with to output the right stuff on the console. There's almost certainly other stuff lurking as well, but your syslog and init packages are going to be about 90% of it.
Dear* *Valdis, Thank you for your quick reply, but what i need is "*time in bootloader print output*". Kernel i already enabled and i am getting the time, So i need time information like * * [ Time XXXX ] *U-Boot 1.1.4-gedeced79 (Feb 6 2012 - 09:27:11)* * * [ Time XXX2 ] *Load address: 0x80e80000* [ Time XXX3 ] *DRAM: 1024 MB* *Hit any key to stop autoboot: 0 * *kernel @ 80008000 (3728760)* *ramdisk @ 81000000 (295902)* *I2C read: I/O error* * * *Starting kernel ...* * * *Uncompressing Linux... done, booting the kernel.* [ 0.000000] Initializing cgroup subsys cpu ===> Kernel I am already getting timing information with CONFIG_PRINTK_TIME=y Thanks & Regards Dhyan On Mon, May 20, 2013 at 1:19 PM, <Valdis.Kletnieks@vt.edu> wrote:
On Mon, 20 May 2013 12:37:25 +0530, Dhyan said:
Is there any uboot config option in to print boot sequence with time prefixes similar to kernel option CONFIG_PRINTK ?
I think you meant CONFIG_PRINTK_TIME there - and if that kernel option is set, all your printks will show up with that, even stuff coming out of early_printk().
Getting userspace to do it as well is a userspace problem, not a kernel problem. You'll have to fix multiple pieces - everything from your syslog daemon (whichever one you use) to sysvinit/systemd/upstart or whatever you boot with to output the right stuff on the console. There's almost certainly other stuff lurking as well, but your syslog and init packages are going to be about 90% of it.
On Mon, 20 May 2013 13:55:25 +0530, Dhyan said:
Thank you for your quick reply, but what i need is "*time in bootloader print output*". Kernel i already enabled and i am getting the time,
That will require fixing your bootloader, which may be more than slightly interesting, as there's usually no timer services initialized by the boot loader (so all you'll get is a bunch of [0.0000] headers). What problem are you trying to solve by adding those timestamps? Maybe there's a different way to solve your issue.
Thank you Valdis !!! I was working on to measure boottime for bootime optimization. On Mon, May 20, 2013 at 2:40 PM, <Valdis.Kletnieks@vt.edu> wrote:
On Mon, 20 May 2013 13:55:25 +0530, Dhyan said:
Thank you for your quick reply, but what i need is "*time in bootloader print output*". Kernel i already enabled and i am getting the time,
That will require fixing your bootloader, which may be more than slightly interesting, as there's usually no timer services initialized by the boot loader (so all you'll get is a bunch of [0.0000] headers).
What problem are you trying to solve by adding those timestamps? Maybe there's a different way to solve your issue.
On Mon, 20 May 2013 15:07:33 +0530, Dhyan said:
I was working on to measure boottime for bootime optimization.
The bootloader is probably not where you're going to find places to optimize. It's got two jobs to do - load the kernel and load the initrd. And it's usually pretty optimized to do that. About all you can do there is minimize the size of the kernel and initrd so there's less to load (and move to SSD if you're really hardcore). The only other place to really win in the boot loader is to set the "hit any key to go to the boot menu" timeout to 0 or 1 seconds. Of course, this means you have little (or zero) chance to enter an alternate kernel or commandline. The *big* places for improving boot time: 1) Turn off services you don't need. If you don't need NFS, don't waste the 0.75 seconds or whatever it takes to load. 2) Use an 'init' process that can multithread better than the old sysvinit system that runs one startup script at a time. systemd (for all its other faults, including a huge learning curve) does this, as does upstart (I'm told). I've even seen one nice use of 'make -j' as a system startup program. 3) There's a nice program called 'bootchart' that will show you in a graphic form where your boot time went. Look at that, plus the kernel and related message logs, to see where your pauses during system startup are. 4) If feasible, consider the use of an SSD rather than spinning disk.
On 05/20/2013 07:40 AM, Valdis.Kletnieks@vt.edu wrote:
On Mon, 20 May 2013 15:07:33 +0530, Dhyan said:
I was working on to measure boottime for bootime optimization. The bootloader is probably not where you're going to find places to optimize. It's got two jobs to do - load the kernel and load the initrd. And it's usually pretty optimized to do that. About all you can do there is minimize the size of the kernel and initrd so there's less to load (and move to SSD if you're really hardcore).
The only other place to really win in the boot loader is to set the "hit any key to go to the boot menu" timeout to 0 or 1 seconds. Of course, this means you have little (or zero) chance to enter an alternate kernel or commandline. Valdis is absolutely right.
In case the boot loader is not so optimized or you are trying to reduce the boot time by milliseconds try using a GPIO pin and a USB logic analyzer (e.g. Salea Logic). Toggle a pin at key places in the boot sequence to measure time. Setting up a timer and printing relative time over a serial port will negatively impact your boot time.
participants (3)
-
Dhyan -
Lucas Rangit Magasweran -
Valdis.Kletnieks@vt.edu