Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process. Resource utilization and process information are collected during the boot process and are later rendered in a PNG, SVG or EPS encoded chart.
"The challenge is to create a single poster showing graphically what is going on during the boot, what is the utilization of resources, how the current boot differs from the ideal world of 100% disk and CPU utilization, and thus, where are the opportunities for optimization."
Bootchart provides a shell script to be run by the kernel in the init
phase. The script will run in background and collect process information, CPU statistics and disk usage statistics from the /proc
file system. The performance data are stored in memory and are written to disk once the boot process completes.
The boot log file is later processed using a Java application (or the web form) which builds the process tree and renders a performance chart in different formats:
The chart can then be analyzed to examine process dependency and overall resource utilization
编译bootchart.jar
jackie_gnu@host:~/test/bootchart/bootchart-0.9$ ant
Buildfile: build.xml
prepare:
[mkdir] Created dir: /home/jackie_gnu/test/bootchart/bootchart-0.9/build
classes:
[javac] Compiling 28 source files to /home/jackie_gnu/test/bootchart/bootchart-0.9/build
[javac] Note: /home/jackie_gnu/test/bootchart/bootchart-0.9/lib/org/apache/commons/cli/TypeHandler.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] Compiling 26 source files to /home/jackie_gnu/test/bootchart/bootchart-0.9/build
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
jar:
[jar] Building jar: /home/jackie_gnu/test/bootchart/bootchart-0.9/bootchart.jar
javadoc:
[mkdir] Created dir: /home/jackie_gnu/test/bootchart/bootchart-0.9/javadoc/api
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] Loading source files for package org.bootchart...
[javadoc] Loading source files for package org.bootchart.common...
[javadoc] Loading source files for package org.bootchart.parser...
[javadoc] Loading source files for package org.bootchart.parser.linux...
[javadoc] Loading source files for package org.bootchart.renderer...
[javadoc] Constructing Javadoc information...
[javadoc] Standard Doclet version 1.6.0_18
[javadoc] Building tree for all the packages and classes...
[javadoc] Building index for all the packages and classes...
[javadoc] Building index for all classes...
all:
BUILD SUCCESSFUL
Total time: 9 seconds
生成bootchart.png
java -jar bootchar.jar example/bootchart.tgz bootchart.png