本文转载地址:
https://blog.csdn.net/u013485539/article/details/18313571
编译时添加环境变量定义:
make INIT_BOOTCHART = true
烧录完成后:
echo 30 > /data/bootchart-start (设置统计时间为30s)
重启
文件生成在:
/data/bootchart/
该目录下所有文件打包为bootchart.tgz
ubuntu下:
安装bootchart并执行:
bootchart bootchart.tgz
可能会遇到python问题:
ZeroDivisionError: float division by zero
解决方法:
直接修改ubuntu下/usr/share/pyshared/pybootchartgui/目录的draw.py,parsing.py,samples.py三个文件,分别修改如下:
draw.py:
[html] view plaincopy
将200,201行由:
xscale = float(chart_bounds[2]) / max(x for (x,y) in data)
yscale = float(chart_bounds[3]) / max(y for (x,y) in data)
改为:
xscale = float(chart_bounds[2]) / max(0.00001, max(x for (x,y) in data))
yscale = float(chart_bounds[3]) / max(0.00001, max(y for (x,y) in data))
[html] view plaincopy
在156行后添加:
if interval == 0:
interval = 1
修改后如下:
sums = [ a - b for a, b in zip(sample1.diskdata, sample2.diskdata) ]
if interval == 0:
interval = 1
[html] view plaincopy
在81行后添加:
if interval == 0:
interval = 1
修改后如下:
def calc_load(self, userCpu, sysCpu, interval):
if interval == 0:
interval = 1