| Summary: | Rationalise bootchart support | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Paul Eggleton <bluelightning> | ||||||
| Component: | core | Assignee: | Max Eliaser <max.eliaser> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Alexandru Georgescu <alexandru.c.georgescu> | ||||||
| Severity: | enhancement | ||||||||
| Priority: | Medium | CC: | alexandru.c.georgescu, elizabeth.flanagan, meta.mr.watcher, meta.watcher, ross.burton | ||||||
| Version: | 1.5.1 | ||||||||
| Target Milestone: | 1.7 | ||||||||
| Hardware: | All | ||||||||
| OS: | Multiple | ||||||||
| Whiteboard: | |||||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||||
| Verified: | Documentation change: | Don't know | |||||||
| Attachments: |
|
||||||||
|
Description
Paul Eggleton
2014-02-27 11:00:01 UTC
Created attachment 2001 [details]
the first bootchart generated with bootchart2
I have now got bootchart2 creating boot charts on Poky with SysV Init. However, there are some caveats.
To get the bootchart2 recipe from meta-webos building on the current Poky git tree, it was necessary to change "inherit autotools" to "inherit autotools-brokensep".
Bootchart2 wants to run initially as PID 1, and will launch whatever's in /sbin/init after it has finished setting itself up. The recipe from meta-webos tried to use the update-alternatives mechanism to link /sbin/init to /sbin/bootchartd, but the problem is that this causes an infinite recursive loop. So I commented out all the update-alternatives stuff from the recipe and instead invoke bootchartd on the QEMU line:
runqemu qemux86 bootparams="initcall_debug printk.time=y quiet init=/sbin/bootchartd"
This works well enough, although if we want to use bootchart2 outside of QEMU, a better solution is needed.
Bootchart2 has a configurable list of programs that signify that the boot process is completed. This consists of things like gnome-shell, openbox, kdm_greet, etc. When one of these programs is run, bootchart2 stops collecting data and creates the actual chart in /var/log. Just one problem: in a command-line-only image, this never happens. So you have to log in and manually run
bootchartd stop
from within Poky. This is fine, but it means you can't really use it for precise boot time measurements (since it depends on how fast a typist you are.) I think adding "login" to that list of programs would fix the problem, but where you want bootchart2 to stop really varies from image to image.
The actual chart is generated by a Python program that uses some modules from the Python standard libraries. Apparently these libraries were recently split out into multiple separate packages, so the following need to be added to bootchart2's RDEPENDS:
python-textutils python-shell python-compression python-codecs
If those libraries are present on the image, then /var/log/bootchart.png will be generated when "bootchartd stop" is run.
The bootchart2 documentation strongly advises that your kernel be built with CONFIG_TASKSTATS=y, but claims that it will work without it. In fact, I was unable to get a useful bootchart at all unless I enabled CONFIG_TASKSTATS. Perhaps the fallback functionality rotted and the bootchart2 maintainers never noticed.
To get the actual bootchart over to my workstation so I could view it, I build an image with dropbear on it and used scp to copy it over the QEMU tap0 interface.
Perhaps a good modification would be to not generate bootchart.png in Poky, and instead copy /var/log/bootchart.tgz to the host system so the png can be generated there. That would save a lot of dependencies.
The bootchart2 recipe from meta-webos was set to check out a two-year-old Git revision. I have as yet been unable to get it working with the latest Git revision, although I can keep working on it if this is deemed a priority.
I have attached the first bootchart I was able to generate.
Created attachment 2018 [details]
bootchart with initscript to stop collection
Adding "login" to bootchartd's EXIT_PROC configuration did not work. However, I was able to create an initscript in /etc/rc5.d to stop bootchart collection, and this worked fine.
For sato and other GUI images, this may not be what we want.
Attached is a bootchart without the bottleneck of my typing speed, and without the overhead of the initial dropbear setup. It's probably closer to representing the true boot time of the system.
I have opened the following bug with upstream bootchart2: https://github.com/mmeeks/bootchart/issues/51 I have now submitted three patches to the upstream bootchart2 project. The first two fix regressions that happened since their 0.14.5 release. The third fixes a bug that goes back as far in bootchart2's history as I could see, which is that it wouldn't work when the kernel was built with CONFIG_TASKSTATS=n. See the following bug reports and pull requests for details: https://github.com/mmeeks/bootchart/pull/50 https://github.com/mmeeks/bootchart/issues/51 https://github.com/mmeeks/bootchart/pull/52 https://github.com/mmeeks/bootchart/issues/53 https://github.com/mmeeks/bootchart/pull/54 The upstream developers have agreed to tag a 0.14.6 stable release with these fixes, so that's what I'm using in my bootchart2 recipe. Just to be clear, as of bootchart2 0.14.6, no special kernel configuration is needed for bootchart2 to work, although you may still get a nicer chart with TASKSTATS. The bootchart2 recipe is almost ready to go at this point, just a few more things to test, clean up, and document. The patches written by the WebOS people for the original recipe are all directly related to Upstart, which we don't support in upstream Poky, so those patches will not be included-- the WebOS guys will need to write a bbappend to apply them. Bootchart2 is now in oe-core master, and ubootchart has been removed from oe-core as well. The only thing left to do at this point is verify that systemd's built-in bootchart works as expected, and possibly remove the original bootchart from meta-oe if people think there's a good reason to. Closing this bug. This commit adds a bootchart2 recipe: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b88b5b7c8d5e60a73b6bd1fa4b3c0b7dc45c9892 This commit removes the ubootchart recipe: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2917308ec3c38ae17ad4d47e90c56952fbc55d20 However, systemd-bootchart is, in fact, broken. It creates blank output about half the time. The bug is very difficult to reproduce or prove that it's fixed. It's being reported to the upstream systemd maintainers, I wasn't able to come up with a patch for it. Also, the original bootchart remains in meta-oe, I will be submitting a patch to remove it soon. Nonetheless, all yocto/oe-core specific work on this bug is complete, so I'm closing it. |