Bootchart2
Use bootchart2 to profile system boot or a running system.
Configure bootchart2
- Add the bootchart2 package to your device.
- Add the following kernel command line parameters:
initcall_debug printk.time=y quiet
Profile system boot
- add the following kernel command line parameter:
PMOS_BOOTCHART2
. - (optional) modify EXIT_PROC in /etc/bootchartd.conf to define when the collector is to stop.
- Boot the system.
- mkinitfs will start
/sbin/bootchartd
. /sbin/bootchartd
will run/sbin/init
.- Approximately 20 seconds after sshd starts (if using the default value of EXIT_PROC), the collector will exit.
/usr/bin/pybootchartgui
will create a visualization in/var/log/bootchart.png
.
- mkinitfs will start
Profile a running system
- Use the command
/sbin/bootchartd start
(as root) to start profiling - Execute the commands or perform the activity that you want to profile.
- Use the command
/sbin/bootchartd stop
(as root) to stop profiling/usr/bin/pybootchartgui
will create a visualization in/var/log/bootchart.png
.
Example (QEMU)
This example demonstrates how to use bootchart2 with device-qemu-amd64.
- Run
pmbootstrap init
. At theExtra packages
prompt, enterbootchart2
.> pmbootstrap init
[18:46:26] Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.
...
[18:46:29] Choose your target device vendor (either an existing one, or a new one for porting).
[18:46:29] Available vendors (43): amazon, asus, bq, chuwi, fairphone, finepower, google, gp, hisense, htc, huawei, infocus, jolla, leeco, lenovo, lg, medion, meizu, motorola, nextbit, nobby, nokia, oneplus, oppo, ouya, pine64, planet, purism, qemu, raspberry, samsung, semc, sony, surftab, t2m, tablet, teclast, wiko, wileyfox, wingtech, xiaomi, yu, zte
[18:46:29] Vendor [qemu]:
[18:46:30] Available codenames (3): aarch64, amd64, vexpress
[18:46:30] Device codename [amd64]:
...
[18:46:35] Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none"
[18:46:35] Extra packages [none]: bootchart2
...
[18:46:40] Done!
>
- Run
pmbootstrap install
. - Start qemu. Use the kernel command line parameters from the deviceinfo file, and add the bootchart2 parameters. For example:
pmbootstrap qemu --image-size=2G --host-qemu --display=gtk --cmdline 'PMOS_BOOTCHART2 initcall_debug printk.time=y quiet console=tty1 console=ttyS0 PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE'
- Wait until bootchart2 has written the image to
/var/log/bootchart.png
. - Copy the file to your host system (
scp -P 2222 <qemu username>@localhost:/var/log/bootchart.png .
).