174 lines · plain
1.TH BOOTGRAPH 82.SH NAME3bootgraph \- Kernel boot timing analysis4.SH SYNOPSIS5.ft B6.B bootgraph7.RB [ OPTIONS ]8.RB [ COMMAND ]9.SH DESCRIPTION10\fBbootgraph \fP reads the dmesg log from kernel boot and11creates an html representation of the initcall timeline. It graphs12every module init call found, through both kernel and user modes. The13timeline is split into two phases: kernel mode & user mode. kernel mode14represents a single process run on a single cpu with serial init calls.15Once user mode begins, the init process is called, and the init calls16start working in parallel.17.PP18If no specific command is given, the tool reads the current dmesg log and19outputs a new timeline.20.PP21The tool can also augment the timeline with ftrace data on custom target22functions as well as full trace callgraphs.23.PP24Generates output files in subdirectory: boot-yymmdd-HHMMSS25 html timeline : <hostname>_boot.html26 raw dmesg file : <hostname>_boot_dmesg.txt27 raw ftrace file : <hostname>_boot_ftrace.txt28.SH OPTIONS29.TP30\fB-h\fR31Print this help text32.TP33\fB-v\fR34Print the current tool version35.TP36\fB-addlogs\fR37Add the dmesg log to the html output. It will be viewable by38clicking a button in the timeline.39.TP40\fB-result \fIfile\fR41Export a results table to a text file for parsing.42.TP43\fB-o \fIname\fR44Overrides the output subdirectory name when running a new test.45Use {date}, {time}, {hostname} for current values.46.sp47e.g. boot-{hostname}-{date}-{time}48.SS "advanced"49.TP50\fB-f or -callgraph\fR51Use ftrace to create initcall callgraphs (default: disabled). If -func52is not used there will be one callgraph per initcall. This can produce53very large outputs, i.e. 10MB - 100MB.54.TP55\fB-fstat\fR56Use ftrace to add function detail (default: disabled)57.TP58\fB-maxdepth \fIlevel\fR59limit the callgraph trace depth to \fIlevel\fR (default: 2). This is60the best way to limit the output size when using -callgraph.61.TP62\fB-mincg \fIt\fR63Discard all callgraphs shorter than \fIt\fR milliseconds (default: 0=all).64This reduces the html file size as there can be many tiny callgraphs65which are barely visible in the timeline.66The value is a float: e.g. 0.001 represents 1 us.67.TP68\fB-cgfilter \fI"func1,func2,..."\fR69Reduce callgraph output in the timeline by limiting it to a list of calls. The70argument can be a single function name or a comma delimited list.71(default: none)72.TP73\fB-cgskip \fIfile\fR74Reduce callgraph output in the timeline by skipping over uninteresting75functions in the trace, e.g. printk or console_unlock. The functions listed76in this file will show up as empty leaves in the callgraph with only the start/end77times displayed.78(default: none)79.TP80\fB-timeprec \fIn\fR81Number of significant digits in timestamps (0:S, 3:ms, [6:us])82.TP83\fB-expandcg\fR84pre-expand the callgraph data in the html output (default: disabled)85.TP86\fB-func \fI"func1,func2,..."\fR87Instead of tracing each initcall, trace a custom list of functions (default: do_one_initcall)88.TP89\fB-reboot\fR90Reboot the machine and generate a new timeline automatically. Works in 4 steps.91 1. updates grub with the required kernel parameters92 2. installs a cron job which re-runs the tool after reboot93 3. reboots the system94 4. after startup, extracts the data and generates the timeline95.TP96\fB-manual\fR97Show the requirements to generate a new timeline manually. Requires 3 steps.98 1. append the string to the kernel command line via your native boot manager.99 2. reboot the system100 3. after startup, re-run the tool with the same arguments and no command101 102.SH COMMANDS103.SS "rebuild"104.TP105\fB-dmesg \fIfile\fR106Create HTML output from an existing dmesg file.107.TP108\fB-ftrace \fIfile\fR109Create HTML output from an existing ftrace file (used with -dmesg).110.SS "other"111.TP112\fB-flistall\fR113Print all ftrace functions capable of being captured. These are all the114possible values you can add to trace via the -func argument.115.TP116\fB-sysinfo\fR117Print out system info extracted from BIOS. Reads /dev/mem directly instead of going through dmidecode.118 119.SH EXAMPLES120Create a timeline using the current dmesg log.121.IP122\f(CW$ bootgraph\fR123.PP124Create a timeline using the current dmesg and ftrace log.125.IP126\f(CW$ bootgraph -callgraph\fR127.PP128Create a timeline using the current dmesg, add the log to the html and change the folder.129.IP130\f(CW$ bootgraph -addlogs -o "myboot-{date}-{time}"\fR131.PP132Capture a new boot timeline by automatically rebooting the machine.133.IP134\f(CW$ sudo bootgraph -reboot -addlogs -o "latest-{hostname)"\fR135.PP136Capture a new boot timeline with function trace data.137.IP138\f(CW$ sudo bootgraph -reboot -f\fR139.PP140Capture a new boot timeline with trace & callgraph data. Skip callgraphs smaller than 5ms.141.IP142\f(CW$ sudo bootgraph -reboot -callgraph -mincg 5\fR143.PP144Capture a new boot timeline with callgraph data over custom functions.145.IP146\f(CW$ sudo bootgraph -reboot -callgraph -func "acpi_ps_parse_aml,msleep"\fR147.PP148Capture a brand new boot timeline with manual reboot.149.IP150\f(CW$ sudo bootgraph -callgraph -manual\fR151.IP152\f(CW$ vi /etc/default/grub # add the CMDLINE string to your kernel params\fR153.IP154\f(CW$ sudo reboot # reboot the machine\fR155.IP156\f(CW$ sudo bootgraph -callgraph # re-run the tool after restart\fR157.PP158.SS "rebuild timeline from logs"159.PP160Rebuild the html from a previous run's logs, using the same options.161.IP162\f(CW$ bootgraph -dmesg dmesg.txt -ftrace ftrace.txt -callgraph\fR163.PP164Rebuild the html with different options.165.IP166\f(CW$ bootgraph -dmesg dmesg.txt -ftrace ftrace.txt -addlogs\fR167 168.SH "SEE ALSO"169dmesg(1), update-grub(8), crontab(1), reboot(8)170.PP171.SH AUTHOR172.nf173Written by Todd Brandt <todd.e.brandt@linux.intel.com>174