at v4.16 163 lines 5.3 kB view raw
1.TH BOOTGRAPH 8 2.SH NAME 3bootgraph \- Kernel boot timing analysis 4.SH SYNOPSIS 5.ft B 6.B bootgraph 7.RB [ OPTIONS ] 8.RB [ COMMAND ] 9.SH DESCRIPTION 10\fBbootgraph \fP reads the dmesg log from kernel boot and 11creates an html representation of the initcall timeline. It graphs 12every module init call found, through both kernel and user modes. The 13timeline is split into two phases: kernel mode & user mode. kernel mode 14represents a single process run on a single cpu with serial init calls. 15Once user mode begins, the init process is called, and the init calls 16start working in parallel. 17.PP 18If no specific command is given, the tool reads the current dmesg log and 19outputs a new timeline. 20.PP 21The tool can also augment the timeline with ftrace data on custom target 22functions as well as full trace callgraphs. 23.PP 24Generates output files in subdirectory: boot-yymmdd-HHMMSS 25 html timeline : <hostname>_boot.html 26 raw dmesg file : <hostname>_boot_dmesg.txt 27 raw ftrace file : <hostname>_boot_ftrace.txt 28.SH OPTIONS 29.TP 30\fB-h\fR 31Print this help text 32.TP 33\fB-v\fR 34Print the current tool version 35.TP 36\fB-addlogs\fR 37Add the dmesg log to the html output. It will be viewable by 38clicking a button in the timeline. 39.TP 40\fB-o \fIname\fR 41Overrides the output subdirectory name when running a new test. 42Use {date}, {time}, {hostname} for current values. 43.sp 44e.g. boot-{hostname}-{date}-{time} 45.SS "advanced" 46.TP 47\fB-f\fR 48Use ftrace to add function detail (default: disabled) 49.TP 50\fB-callgraph\fR 51Use ftrace to create initcall callgraphs (default: disabled). If -func 52is not used there will be one callgraph per initcall. This can produce 53very large outputs, i.e. 10MB - 100MB. 54.TP 55\fB-maxdepth \fIlevel\fR 56limit the callgraph trace depth to \fIlevel\fR (default: 2). This is 57the best way to limit the output size when using -callgraph. 58.TP 59\fB-mincg \fIt\fR 60Discard all callgraphs shorter than \fIt\fR milliseconds (default: 0=all). 61This reduces the html file size as there can be many tiny callgraphs 62which are barely visible in the timeline. 63The value is a float: e.g. 0.001 represents 1 us. 64.TP 65\fB-cgfilter \fI"func1,func2,..."\fR 66Reduce callgraph output in the timeline by limiting it to a list of calls. The 67argument can be a single function name or a comma delimited list. 68(default: none) 69.TP 70\fB-timeprec \fIn\fR 71Number of significant digits in timestamps (0:S, 3:ms, [6:us]) 72.TP 73\fB-expandcg\fR 74pre-expand the callgraph data in the html output (default: disabled) 75.TP 76\fB-func \fI"func1,func2,..."\fR 77Instead of tracing each initcall, trace a custom list of functions (default: do_one_initcall) 78.TP 79\fB-reboot\fR 80Reboot the machine and generate a new timeline automatically. Works in 4 steps. 81 1. updates grub with the required kernel parameters 82 2. installs a cron job which re-runs the tool after reboot 83 3. reboots the system 84 4. after startup, extracts the data and generates the timeline 85.TP 86\fB-manual\fR 87Show the requirements to generate a new timeline manually. Requires 3 steps. 88 1. append the string to the kernel command line via your native boot manager. 89 2. reboot the system 90 3. after startup, re-run the tool with the same arguments and no command 91 92.SH COMMANDS 93.SS "rebuild" 94.TP 95\fB-dmesg \fIfile\fR 96Create HTML output from an existing dmesg file. 97.TP 98\fB-ftrace \fIfile\fR 99Create HTML output from an existing ftrace file (used with -dmesg). 100.SS "other" 101.TP 102\fB-flistall\fR 103Print all ftrace functions capable of being captured. These are all the 104possible values you can add to trace via the -func argument. 105.TP 106\fB-sysinfo\fR 107Print out system info extracted from BIOS. Reads /dev/mem directly instead of going through dmidecode. 108 109.SH EXAMPLES 110Create a timeline using the current dmesg log. 111.IP 112\f(CW$ bootgraph\fR 113.PP 114Create a timeline using the current dmesg and ftrace log. 115.IP 116\f(CW$ bootgraph -callgraph\fR 117.PP 118Create a timeline using the current dmesg, add the log to the html and change the folder. 119.IP 120\f(CW$ bootgraph -addlogs -o "myboot-{date}-{time}"\fR 121.PP 122Capture a new boot timeline by automatically rebooting the machine. 123.IP 124\f(CW$ sudo bootgraph -reboot -addlogs -o "latest-{hostname)"\fR 125.PP 126Capture a new boot timeline with function trace data. 127.IP 128\f(CW$ sudo bootgraph -reboot -f\fR 129.PP 130Capture a new boot timeline with trace & callgraph data. Skip callgraphs smaller than 5ms. 131.IP 132\f(CW$ sudo bootgraph -reboot -callgraph -mincg 5\fR 133.PP 134Capture a new boot timeline with callgraph data over custom functions. 135.IP 136\f(CW$ sudo bootgraph -reboot -callgraph -func "acpi_ps_parse_aml,msleep"\fR 137.PP 138Capture a brand new boot timeline with manual reboot. 139.IP 140\f(CW$ sudo bootgraph -callgraph -manual\fR 141.IP 142\f(CW$ vi /etc/default/grub # add the CMDLINE string to your kernel params\fR 143.IP 144\f(CW$ sudo reboot # reboot the machine\fR 145.IP 146\f(CW$ sudo bootgraph -callgraph # re-run the tool after restart\fR 147.PP 148.SS "rebuild timeline from logs" 149.PP 150Rebuild the html from a previous run's logs, using the same options. 151.IP 152\f(CW$ bootgraph -dmesg dmesg.txt -ftrace ftrace.txt -callgraph\fR 153.PP 154Rebuild the html with different options. 155.IP 156\f(CW$ bootgraph -dmesg dmesg.txt -ftrace ftrace.txt -addlogs\fR 157 158.SH "SEE ALSO" 159dmesg(1), update-grub(8), crontab(1), reboot(8) 160.PP 161.SH AUTHOR 162.nf 163Written by Todd Brandt <todd.e.brandt@linux.intel.com>