3/26/2017

bootchart

1. bootchart의 기능 

systemd에서 제공되는 boot에 관련된 시간을 측정을 해주는 프로그램이며, 현재 bootchart2까지의 기능을 제공을 해주고 있다.
물론 Kernel에서 printk의 옵션을 넣어 Serial에 Log로 각각의 시간을 볼수가 있지만, 이것은 어디까지나 printk 기반으로 하기 때문에,
bootchart는 init script 이후분석이라고 봐야할 것이다.(물론 Kernel의 모듈도 포함)


Bootchart 사이트
  http://www.bootchart.org/index.html
  http://www.bootchart.org/samples.html
  http://www.bootchart.org/images/bootchart.svgz


kernel의 cmdline에 init 부분을 설정
  https://elinux.org/Bootchart


상위의 정보를 보면 BusyBox에  Bootchart는 포함이 되어있으며, 설정을 하면 bootchard가 사용가능하다.


1.1 Raspberry Pi에서 bootchart 실행  


$ ls /sbin/boot*  // bootchartd 설치 확인 busybox로 설치가능 

$ sudo apt-get install bootchart bootchart-view

$ ls /sbin/boot*  //bootchartd 설치 확인 
/sbin/bootchartd

$cat /proc/cmdline   // Kernel Command line 확인 
8250.nr_uarts=0 cma=256M bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=0c830106-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

$ cat /boot/cmdline.txt  // init 부분 미설정 확인 
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=0c830106-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

$ sudo vi /boot/cmdline.txt  // Raspberry Pi cmdline 수정가능 
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=0c830106-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/sbin/bootchartd

$ sudo reboot

$ cat /proc/cmdline
8250.nr_uarts=0 cma=256M bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=PARTUUID=0c830106-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait init=/sbin/bootchartd

$ ls /var/log/bootchart.tgz  // /sbin/bootchartd 로 bootchart.tgz 생성확인  
/var/log/bootchart.tgz

$ bootchart  //png 파일 생성 
Parsing /var/log/bootchart.tgz
Wrote image: ./bootchart.png

$ scp ./bootchart.png jhlee@192.168.1.101:/home/jhlee/


막상 사용해보니, 나에게는 거의 도움이 되지 않는 것 같으며, 추후 사용할 일 있다면 그때 사용하자.

raspberry pi 3 bootcmd 수정
  https://www.raspberrypi.org/documentation/configuration/cmdline-txt.md

Raspberry Pi는 쉽게 cmdline을 filesystem에서 수정이 가능하지만, 다른 Board일 경우는 Busybox와 uboot에서 적용해야겠다.



1.2 bootchart2 사용법 

bootchart2를 사용하면, 쉽게 python으로 /var/log/bootchart.tgz 정보를 쉽게 볼 수 있다.

$ sudo apt-get install bootchart2

$ pybootchartgui -i 

systemctl 사용법
  https://ahyuo.blogspot.com/2017/03/systemctl.html

Android 관련 Boot Time 소개 (bootchart 포함)
  http://www.slideshare.net/kanru/android-boot-time-optimization

전체 BootTime에 관련된 정보
  https://elinux.org/Boot_Time

나에게는 그다지 큰 도움이 되지 않는 것 같으며, 오히려, systemd 분석도구 가 더 좋은 것 같다.

댓글 없음 :