I want to generate images for an embedded system and automatically measure the time they took for booting (especially for different systems).

I'm using Buildroot to generate my Linux Images. I already know the methods and how to apply them, it's just the question about how to do the time measuring.

ATM for the measuring, a GPIO Pin is set in the 1st-level bootloader to "high" and the same pin is set to "low" when entering the userspace. Then with an oscilloscope the time is measured with the cursors by hand.

Now to the problem: I got some methods I'd like to be automatically implemented by choosing these in a GUI and then let the program apply them (this shouldn't be a big deal). What I'm not so sure about is to measure the boot time afterwards when the images are ready automatically.

Has anyone a nice idea for measuring the boot time?

The only thing that comes to my mind is to rely on the kernel printk times, unfortunately these measure only the kernel time.

  • 1
    Have a look at elinux.org/Bootchart#BusyBox – patrickdepinguin Mar 13 '14 at 15:33
  • If I understood this right, that busybox bootchart is the conventional one, not the EmbBootchart right ? In that presentation given on your link, I can read that it's pretty unhandy to use the common one for embedded systems? Anyways is there some further information about it ? like where it is saved to? – user3085931 Mar 14 '14 at 7:23

You could try bootchart, a tool designed to analyse your boot proceedure and create a chart showing how much time was spent in each stage:

After install, simply add these options to your kernel command-line, normally in /boot/grub/menu.lst:

initcall_debug printk.time=y quiet init=/sbin/bootchartd ...

Then - after bootup, run 'pybootchartgui -i' to get an interactive chart rendering tool. If you want to chart the initrd, add rdinitrd=/sbin/bootchartd to the kernel command-line.

To make bootchart2 work best, please ensure your kernel is configured with CONFIG_PROC_EVENTS=y and CONFIG_TASKSTATS=y, without these we are slower, less accurate, and produce an uglier task hierarchy.

If you want to start bootchart2 in a dracut (version >= 008) initramfs, you have to change "init=/sbin/bootchartd" to "rdinit=/sbin/bootchartd" and regenerate the initramfs with bootchart support with "# dracut -f -a bootchart".

It produces images like this one:

  enter image description here

  • Thanks for the input, bootchart is a very nice tool, isn't it just for the kernel time too?. Anyways I think this is not working for me , since I'm measuring the boot time of an embedded system and I'm not using Grub. I'm using AT91Bootstrap and U-Boot as bootloaders. I think bootchart is designed just for PC's – user3085931 Mar 13 '14 at 14:52
  • @user3085931 don't really know. I tried it once but had trouble getting it to play nice with my init system so I'm not really sure about the details. – terdon Mar 13 '14 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.