Android bootchart

本文转载地址:
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))    

parsing.py

[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  

samples.py

[html] view plaincopy

在81行后添加:    
    if interval == 0:    
        interval = 1  
修改后如下:  
    def calc_load(self, userCpu, sysCpu, interval):  
        if interval == 0: 
            interval = 1    
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值