xref: /openbmc/linux/tools/power/pm-graph/bootgraph.8 (revision 6b5fc336)
BOOTGRAPH 8
NAME
bootgraph - Kernel boot timing analysis
SYNOPSIS
bootgraph [ OPTIONS ] [ COMMAND ]
DESCRIPTION
bootgraph reads the dmesg log from kernel boot and creates an html representation of the initcall timeline up to the start of the init process.

If no specific command is given, the tool reads the current dmesg log and outputs bootgraph.html.

The tool can also augment the timeline with ftrace data on custom target functions as well as full trace callgraphs.

OPTIONS

-h Print this help text

-v Print the current tool version

-addlogs Add the dmesg log to the html output. It will be viewable by clicking a button in the timeline.

-o file Override the HTML output filename (default: bootgraph.html)

"Ftrace Debug"

-f Use ftrace to add function detail (default: disabled)

-callgraph Use ftrace to create initcall callgraphs (default: disabled). If -filter is not used there will be one callgraph per initcall. This can produce very large outputs, i.e. 10MB - 100MB.

-maxdepth level limit the callgraph trace depth to level (default: 2). This is the best way to limit the output size when using -callgraph.

-mincg t Discard all callgraphs shorter than t milliseconds (default: 0=all). This reduces the html file size as there can be many tiny callgraphs which are barely visible in the timeline. The value is a float: e.g. 0.001 represents 1 us.

-timeprec n Number of significant digits in timestamps (0:S, 3:ms, [6:us])

-expandcg pre-expand the callgraph data in the html output (default: disabled)

-filter "func1,func2,..." Instead of tracing each initcall, trace a custom list of functions (default: do_one_initcall)

COMMANDS

-reboot Reboot the machine and generate a new timeline automatically. Works in 4 steps. 1. updates grub with the required kernel parameters 2. installs a cron job which re-runs the tool after reboot 3. reboots the system 4. after startup, extracts the data and generates the timeline

-manual Show the requirements to generate a new timeline manually. Requires 3 steps. 1. append the string to the kernel command line via your native boot manager. 2. reboot the system 3. after startup, re-run the tool with the same arguments and no command

-dmesg file Create HTML output from an existing dmesg file.

-ftrace file Create HTML output from an existing ftrace file (used with -dmesg).

-flistall Print all ftrace functions capable of being captured. These are all the possible values you can add to trace via the -filter argument.

EXAMPLES
Create a timeline using the current dmesg log.
$ bootgraph

Create a timeline using the current dmesg and ftrace log.

$ bootgraph -callgraph

Create a timeline using the current dmesg, add the log to the html and change the name.

$ bootgraph -addlogs -o myboot.html

Capture a new boot timeline by automatically rebooting the machine.

$ sudo bootgraph -reboot -addlogs -o latestboot.html

Capture a new boot timeline with function trace data.

$ sudo bootgraph -reboot -f

Capture a new boot timeline with trace & callgraph data. Skip callgraphs smaller than 5ms.

$ sudo bootgraph -reboot -callgraph -mincg 5

Capture a new boot timeline with callgraph data over custom functions.

$ sudo bootgraph -reboot -callgraph -filter "acpi_ps_parse_aml,msleep"

Capture a brand new boot timeline with manual reboot.

$ sudo bootgraph -callgraph -manual
$ vi /etc/default/grub # add the CMDLINE string to your kernel params
$ sudo reboot # reboot the machine
$ sudo bootgraph -callgraph # re-run the tool after restart

"SEE ALSO"
dmesg(1), update-grub(8), crontab(1), reboot(8)

AUTHOR
Written by Todd Brandt <todd.e.brandt@linux.intel.com>