Linux驱动开发(工具.1:嵌入式Linux性能分析工具bootchart)

参考:https://www.freesion.com/article/1911209178/#LinuxBootChart_41

我为大家准备了两个工具的安装包:

https://download.csdn.net/download/qq_36813351/20359920

一.安装编译嵌入式Linux系统下的bootchart-lite

1.使用gcc交叉编译bootchart-lite安装包下src文件夹下的bootchart-lite,
路径:bootchart使用方法\开发板\bootchart-lite-master.zip\bootchart-lite-master\src

2.将得到的可执行文件放到嵌入式设备的/sbin文件夹

3.新版本的Linux内核需要自己写system下的服务/etc/systemed/system

4.systemctl enable rc-local.service 使能服务

文件名:rc-local.service

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

这部分参考:http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html

在/etc文件夹下建立rc.local文件

#!/bin/bash
#癡HIS FILE IS 酓DED餏OR COMPATIBILITY xURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to xarallel execution during boot
# this script will NOT be run after all other services.
#
# that this script will be executed during boot.
echo "Now begain bootchart-lite"
/sbin/bootchart-lite
echo "Hello World!"

这一步执行完就可以在Linux内核启动时启动bootchart-lite文件,bootchart-lite在执行时会在/etc/bootchart-lite文件夹下生成。但是文件夹bootchart-lite不会自动生成需要你手动写一个文件夹出来。再给这几个文件全都加上权限chmod 777 XXX.然后等着结果出来就行了。

二.安装Ubuntu下的bootchart分析工具

1.安装Linux的java环境,并配置环境变量
2.安装ant,sudo apt-get install ant
3.安装bootchart,先将代码解压,执行安装脚本sudo ./install.sh,自动编译java文件,生成bootchart.jar工具
4.将截取的三个log压缩,tar czf bootchart.tgz *.log
5.调用java生成的bootchart工具去生成照片。前边是工具路径,后边是压缩文件路径。java -jar /usr/bootchart-0.9/bootchart.jar /usr/bootchart.tgz

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌入式吴彦祖

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值