20170712_jeffrey - silenceuncrio/diary GitHub Wiki

0850

待會 0900 來補個數據

今天預計每兩個小時抄一次數據

0900

Mem: 296908K used, 212880K free, 1004K shrd, 0K buff, 19304K cached
CPU:  13% usr  35% sys   0% nic  38% idle   0% io   0% irq  12% sirq
Load average: 0.92 0.91 0.87 3/93 29936
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
    3     2 root     RW       0   0%   4% [ksoftirqd/0]
 1463     1 root     S     2696   1%   3% {gpio_button.sh} /bin/bash /usr/sbin/i
  321     1 root     S     240m  48%   2% /usr/sbin/icospromsg
 3157   321 root     R     3720   1%   2% ndppd -p /var/run/ndppd.pid -c /var/nd
    7     2 root     SW       0   0%   1% [rcu_preempt]
  618     1 root     S     7864   2%   1% /usr/sbin/snmpd -Ln -c /tmp/icos/snmp/
  634     1 root     S     2692   1%   1% {icos_snmp_apply} /bin/sh /usr/sbin/ic
 1552   321 root     S     8144   2%   1% iweb -p 80 -d /www
 1410     1 root     S     4500   1%   0% mosquitto -c /tmp/icos/mqtt/mqtt.conf
  145     1 root     R     1588   0%   0% /usr/sbin/rngd -r /dev/urandom
   20     2 root     SW       0   0%   0% [cfinteractive]
30708  1571 root     R     2904   1%   0% busybox top
 1442   321 root     S     2864   1%   0% syslogd -n -C200 -L
 3156   321 root     S     1772   0%   0% dhcp6s -c /var/wide_dhcp6s.conf -D -f
25749     2 root     SW       0   0%   0% [kworker/0:0]
  949   948 root     S     138m  28%   0% /usr/lib/strongswan/ipsec/charon --use
 2572   321 root     S    63344  12%   0% agent -c /tmp/icos/cwmp -i /etc/icos/c
 1693   321 root     S    23272   5%   0% netmond
 2757     1 root     S    11476   2%   0% /usr/sbin/dhcpd -cf /tmp/icos/dhcp/dhc
 1558   321 root     S     8056   2%   0% iweb -p 443 -d /www -s

0955

BU II 軟體成員剛剛招開了會議 - Memory Leaking Strategy discussion

我就負責收斂這個

目前 Web Process Abnormal Issue 這個 issue 已被證實為是 Memory Leaking 所導致

先把 WEB Process Abnormal Issue 這臨時專案結掉

再另開一個 Memory Leaking 內部的臨時專案

1020

先做 工作項目 Burn Dual Image for MP

  • mfgtool 燒錄的時候兩個 image 都燒一燒

動工的目標為 mfgtool 用的 ucl2.xml

參考設計圖 U-Boot Image Layout for NAND Flash v2.1 來施工 image

1050

施工後的 mfgtool 用的 ucl2.xml 如下

<UCL>
  <CFG>
    <STATE name="BootStrap" dev="MX6SL" vid="15A2" pid="0063"/>
    <STATE name="BootStrap" dev="MX6D" vid="15A2" pid="0061"/>
    <STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
    <STATE name="BootStrap" dev="MX6SX" vid="15A2" pid="0071"/>
    <STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
    <STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/>
    <STATE name="Updater"   dev="MSC" vid="066F" pid="37FF"/>
  </CFG>

  <LIST name="NAND Flash" desc="Choose NAND as media">

  <CMD state="BootStrap" type="boot" 
    body="BootStrap" file ="firmware/u-boot-m300.imx-nand">Loading U-boot</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/zImage" address="0x80800000" 
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading Kernel.</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/%initramfs%" address="0x83800000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Initramfs.</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/zImage-imx6ul-%6uldtb%-%nanddtb%.dtb" address="0x83000000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading device tree.</CMD>
  <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>

  <!--burn the uboot to NAND: --> 
  <CMD state="Updater" type="push" 
    body="$ mount -t debugfs debugfs /sys/kernel/debug">Mounting debugfs</CMD>
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd0 0 0">Erasing Boot partition</CMD>
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd1 0 0">Erasing Boot env partition</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/u-boot-m300.imx-nand" ifdev="MX6UL">Sending u-boot.bin</CMD>
  <CMD state="Updater" type="push" 
    body="$ kobs-ng init -x -v --chip_0_device_path=/dev/mtd0 $FILE">Flashing Bootloader</CMD>

  <!-- burn the kernel_a -->
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd2 0 0">Erasing Kernel partition A</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/zImage">Sending kernel zImage</CMD>
  <CMD state="Updater" type="push" 
    body="$ nandwrite -p /dev/mtd2 -p $FILE">Flashing Kernel A</CMD>

  <!-- burn the kernel_b -->
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd7 0 0">Erasing Kernel partition B</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/zImage">Sending kernel zImage</CMD>
  <CMD state="Updater" type="push" 
    body="$ nandwrite -p /dev/mtd7 -p $FILE">Flashing Kernel B</CMD>
  
  <!-- burn the dtb_a -->
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd3 0 0">Erasing dtb partition A</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/zImage-imx6ul-14x14-evk.dtb">Sending Device Tree file</CMD>
  <CMD state="Updater" type="push" 
    body="$ nandwrite -p /dev/mtd3 -p $FILE">Flashing dtb A</CMD>

  <!-- burn the dtb_b -->
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd8 0 0">Erasing dtb partition B</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/zImage-imx6ul-14x14-evk.dtb">Sending Device Tree file</CMD>
  <CMD state="Updater" type="push" 
    body="$ nandwrite -p /dev/mtd8 -p $FILE">Flashing dtb B</CMD>



  <!--prepare all ubi device: -->

  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd4 0 0">Erasing rootfs_a partition</CMD>
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd5 0 0">Erasing config_a partition</CMD>
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd9 0 0">Erasing rootfs_b partition</CMD>
  <CMD state="Updater" type="push" 
    body="$ flash_erase /dev/mtd10 0 0">Erasing config_b partition</CMD>

  <CMD state="Updater" type="push" 
    body="$ ubiformat /dev/mtd4"/>
  <CMD state="Updater" type="push" 
    body="$ ubiformat /dev/mtd5"/>
  <CMD state="Updater" type="push" 
    body="$ ubiformat /dev/mtd9"/>
  <CMD state="Updater" type="push" 
    body="$ ubiformat /dev/mtd10"/>

  <CMD state="Updater" type="push" 
    body="$ ubiattach /dev/ubi_ctrl -m 4">Attaching UBI partition - /dev/ubi0</CMD>
  <CMD state="Updater" type="push" 
    body="$ ubiattach /dev/ubi_ctrl -m 5">Attaching UBI partition - /dev/ubi1</CMD>
  <CMD state="Updater" type="push" 
    body="$ ubiattach /dev/ubi_ctrl -m 9">Attaching UBI partition - /dev/ubi2</CMD>
  <CMD state="Updater" type="push" 
    body="$ ubiattach /dev/ubi_ctrl -m 10">Attaching UBI partition - /dev/ubi3</CMD>

  <CMD state="Updater" type="push" 
    body="$ ubimkvol /dev/ubi0 -N rootfs_a -m"/>
  <CMD state="Updater" type="push" 
    body="$ ubimkvol /dev/ubi1 -N config_a -m"/>
  <CMD state="Updater" type="push" 
    body="$ ubimkvol /dev/ubi2 -N rootfs_b -m"/>
  <CMD state="Updater" type="push" 
    body="$ ubimkvol /dev/ubi3 -N config_b -m"/>

  <!-- burn the rootfs_a -->
  <CMD state="Updater" type="push" 
    body="$ mkdir -p /mnt/rootfs_a"/>
  <CMD state="Updater" type="push" 
    body="$ mount -t ubifs ubi0:rootfs_a /mnt/rootfs_a"/>
  <CMD state="Updater" type="push" 
    body="pipe tar -jxv -C /mnt/rootfs_a" file="files/rootfs.tar.bz2">Sending and writting rootfs_a</CMD>
  <CMD state="Updater" type="push" 
    body="frf">Finishing rootfs write</CMD>
  <CMD state="Updater" type="push" 
    body="$ umount /mnt/rootfs_a">Unmounting rootfs_a partition</CMD>

  <!-- burn the rootfs_b -->
  <CMD state="Updater" type="push" 
    body="$ mkdir -p /mnt/rootfs_b"/>
  <CMD state="Updater" type="push" 
    body="$ mount -t ubifs ubi2:rootfs_b /mnt/rootfs_b"/>
  <CMD state="Updater" type="push" 
    body="pipe tar -jxv -C /mnt/rootfs_b" file="files/rootfs.tar.bz2">Sending and writting rootfs_b</CMD>
  <CMD state="Updater" type="push" 
    body="frf">Finishing rootfs write</CMD>
  <CMD state="Updater" type="push" 
    body="$ umount /mnt/rootfs_b">Unmounting rootfs_a partition</CMD>

  <CMD state="Updater" type="push" 
    body="$ echo Update Complete!">Done</CMD>

  </LIST>

</UCL>

直接使用 mfgtool 做燒錄

目前看到結果是成功的

直接放到板子上看結果

上電後不等 linux 的 rc.local 走完就拔電

兩次後 uboot 會切換成 partition B 做開機

開機成功

可以準備 燒錄工具包 給產線了

1110

抄數據

Mem: 297156K used, 212632K free, 992K shrd, 0K buff, 18860K cached
CPU:   9% usr  24% sys   0% nic  55% idle   0% io   0% irq  10% sirq
Load average: 1.05 1.16 1.04 1/94 16739
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
    3     2 root     SW       0   0%   5% [ksoftirqd/0]
 1463     1 root     S     2696   1%   4% {gpio_button.sh} /bin/bash /usr/sbin/i
 3157   321 root     S     3720   1%   3% ndppd -p /var/run/ndppd.pid -c /var/nd
  321     1 root     S     240m  48%   3% /usr/sbin/icospromsg
 1552   321 root     S     8144   2%   1% iweb -p 80 -d /www
  634     1 root     S     2692   1%   1% {icos_snmp_apply} /bin/sh /usr/sbin/ic
    7     2 root     SW       0   0%   1% [rcu_preempt]
30708  1571 root     R     2904   1%   0% busybox top
   20     2 root     SW       0   0%   0% [cfinteractive]
  145     1 root     S     1588   0%   0% /usr/sbin/rngd -r /dev/urandom
13665     2 root     SW       0   0%   0% [kworker/0:0]
  949   948 root     S     138m  28%   0% /usr/lib/strongswan/ipsec/charon --use
 2572   321 root     S    63344  12%   0% agent -c /tmp/icos/cwmp -i /etc/icos/c
 1693   321 root     S    23272   5%   0% netmond
 2757     1 root     S    11476   2%   0% /usr/sbin/dhcpd -cf /tmp/icos/dhcp/dhc
 1558   321 root     S     8056   2%   0% iweb -p 443 -d /www -s
  618     1 root     S     7864   2%   0% /usr/sbin/snmpd -Ln -c /tmp/icos/snmp/
 1464     1 root     S     5944   1%   0% /usr/sbin/icoswdog -T 120
  320     1 root     S     5944   1%   0% /usr/sbin/seqcmdd -C /run/seqcmdd/ipt_
 2524   321 root     S     4780   1%   0% ramond -i ppp0 -c /var/ramond_ppp0.con

1300

抄數據

Mem: 297084K used, 212704K free, 932K shrd, 0K buff, 18912K cached
CPU:   9% usr  22% sys   0% nic  58% idle   0% io   0% irq   9% sirq
Load average: 0.29 0.44 0.62 1/92 5211
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 1463     1 root     S     2696   1%   4% {gpio_button.sh} /bin/bash /usr/sbin/i
    3     2 root     SW       0   0%   4% [ksoftirqd/0]
  321     1 root     S     240m  48%   2% /usr/sbin/icospromsg
 3157   321 root     S     3720   1%   2% ndppd -p /var/run/ndppd.pid -c /var/nd
    7     2 root     SW       0   0%   1% [rcu_preempt]
  634     1 root     S     2692   1%   1% {icos_snmp_apply} /bin/sh /usr/sbin/ic
 1552   321 root     S     8144   2%   1% iweb -p 80 -d /www
30708  1571 root     R     2904   1%   1% busybox top
   20     2 root     SW       0   0%   1% [cfinteractive]
 1693   321 root     S    23272   5%   0% netmond
  618     1 root     S     7864   2%   0% /usr/sbin/snmpd -Ln -c /tmp/icos/snmp/
 1410     1 root     S     4500   1%   0% mosquitto -c /tmp/icos/mqtt/mqtt.conf
  405   321 root     S     2048   0%   0% dnsmasq -C /tmp/icos/dns/dnsmasq.conf
  145     1 root     S     1588   0%   0% /usr/sbin/rngd -r /dev/urandom
28558     2 root     SW       0   0%   0% [kworker/0:1]
  949   948 root     S     138m  28%   0% /usr/lib/strongswan/ipsec/charon --use
 2572   321 root     S    63344  12%   0% agent -c /tmp/icos/cwmp -i /etc/icos/c
 2757     1 root     S    11476   2%   0% /usr/sbin/dhcpd -cf /tmp/icos/dhcp/dhc
 1558   321 root     S     8056   2%   0% iweb -p 443 -d /www -s
 1464     1 root     S     5944   1%   0% /usr/sbin/icoswdog -T 120

1410

BU II 小組全體剛剛開了會

1450

發現到從早上 9 點開始

M300 耗用 memory 的成長線性趨勢的特性突然不見了

image

這才發現 /usr/sbin/icospromsgVSZ 停在 240m

  321     1 root     S     240m  48%   2% /usr/sbin/icospromsg

神奇的是 aaron 桌上的 沒幹甚麼事的 M300

這兩天有事沒事過去看一下也發現持續成長的 /usr/sbin/icospromsgVSZ 也停在 240m

好奇之餘過去 38 號 DQA 那邊看一下...

他們的 M300 的 /usr/sbin/icospromsgVSZ 停在 247m...

還以為抓到 /usr/sbin/icospromsg 什麼上限值之類的

還是繼續抄數據好了

1500

繼續

Mem: 298504K used, 211284K free, 940K shrd, 0K buff, 19080K cached
CPU:  10% usr  22% sys   0% nic  56% idle   0% io   0% irq  10% sirq
Load average: 0.64 0.48 0.69 1/93 32169
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 1463     1 root     S     2696   1%   4% {gpio_button.sh} /bin/bash /usr/sbin/i
    3     2 root     SW       0   0%   4% [ksoftirqd/0]
  321     1 root     S     240m  48%   2% /usr/sbin/icospromsg
 3157   321 root     S     3720   1%   2% ndppd -p /var/run/ndppd.pid -c /var/nd
    7     2 root     RW       0   0%   1% [rcu_preempt]
  634     1 root     S     2692   1%   1% {icos_snmp_apply} /bin/sh /usr/sbin/ic
   20     2 root     SW       0   0%   1% [cfinteractive]
 1552   321 root     S     8144   2%   1% iweb -p 80 -d /www
  618     1 root     S     7864   2%   0% /usr/sbin/snmpd -Ln -c /tmp/icos/snmp/
31364  1571 root     R     2904   1%   0% busybox top
  145     1 root     S     1588   0%   0% /usr/sbin/rngd -r /dev/urandom
 1693   321 root     S    23272   5%   0% netmond
 1410     1 root     S     4500   1%   0% mosquitto -c /tmp/icos/mqtt/mqtt.conf
 1442   321 root     S     2864   1%   0% syslogd -n -C200 -L
  949   948 root     S     138m  28%   0% /usr/lib/strongswan/ipsec/charon --use
 2572   321 root     S    63344  12%   0% agent -c /tmp/icos/cwmp -i /etc/icos/c
 2757     1 root     S    11476   2%   0% /usr/sbin/dhcpd -cf /tmp/icos/dhcp/dhc
 1558   321 root     S     8056   2%   0% iweb -p 443 -d /www -s
 1464     1 root     S     5944   1%   0% /usr/sbin/icoswdog -T 120
  320     1 root     S     5944   1%   0% /usr/sbin/seqcmdd -C /run/seqcmdd/ipt_

順便追加個 cat /proc/meminfo

root@Mobile Router:~# cat /proc/meminfo
MemTotal:         509788 kB
MemFree:          211488 kB
MemAvailable:     224116 kB
Buffers:               0 kB
Cached:            19136 kB
SwapCached:            0 kB
Active:           255376 kB
Inactive:           8992 kB
Active(anon):     245588 kB
Inactive(anon):      584 kB
Active(file):       9788 kB
Inactive(file):     8408 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:         509788 kB
LowFree:          211488 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                80 kB
Writeback:             0 kB
AnonPages:        245152 kB
Mapped:            10932 kB
Shmem:               940 kB
Slab:              13956 kB
SReclaimable:       4140 kB
SUnreclaim:         9816 kB
KernelStack:         752 kB
PageTables:         1716 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      254892 kB
Committed_AS:     468464 kB
VmallocTotal:    1548288 kB
VmallocUsed:        5580 kB
VmallocChunk:    1340408 kB
CmaTotal:         327680 kB
CmaFree:          146480 kB
root@Mobile Router:~#

1700

不抄數據了

參考 Memory Leaking

目前利用 john 提供的 /mnt/data/IGNORED_MODULE_LIST 已取得了一些進展

加上 aaron 提供的 script 固定時間打印 /usr/sbin/icospromsgVSZ

目前 aaron 已經找到了 openvpn 的 memory leaking 問題

至於是否還有其他模組還有 memory leaking 的問題則有待觀察

1745

已經肯定跟 pppoe 沒有關係

那就把隔壁和我們這邊 pppoe 的測試環境都撤掉

自己桌上的 M300 利用 aaron 提供的 script 固定 30 秒打印 /usr/sbin/icospromsgVSZ

先放到明天看看

⚠️ **GitHub.com Fallback** ⚠️