Andriod Debug log

Andriod Debug log

  • 1. Android 4.2/4.3/4.4 wifi log
  • 2. Android 5.0&5.1 wifi log
  • 3. Android 6.0 wifi log
  • 4. Android 7.0 & 8.0 & 8.1 & 9 & Q wifi log
  • 5. kernel log获取
  • 6. memory log抓取
  • 7.0 network log


1. Android 4.2/4.3/4.4 wifi log

要手动修改framework层的code才可以得到wifi的整体log

wpa_cli -i wlan0 -p /data/misc/wifi/sockets log_level DEBUG
logcat -v threadtime -n 8 -r 51200 -f /data/wifi_log.txt &
dumpsys wifi
dumpsys wifiscanner
dumpsys wifip2p

2. Android 5.0&5.1 wifi log

5.0~5.1, 注意":"后面有三个空格,再写1
echo "WIFI_VERBOSE_LOGS:   1" > /data/misc/wifi/autojoinconfig.txt
chmod 777 /data/misc/wifi/autojoinconfig.txt
sync
reboot
wpa_cli -i wlan0 -p /data/misc/wifi/sockets log_level DEBUG
logcat -v threadtime -n 8 -r 51200 -f /data/wifi_log.txt &
## 复现出问题时,再执行,
dumpsys wifi
dumpsys wifiscanner
dumpsys wifip2p

3. Android 6.0 wifi log

6.0 , 注意":"后面没有空格,再写1
echo "WIFI_VERBOSE_LOGS:1" > /data/misc/wifi/autojoinconfig.txt
chmod 777 /data/misc/wifi/autojoinconfig.txt
sync
reboot
logcat -v threadtime -n 8 -r 51200 -f /data/wifi_log.txt &
dumpsys wifi
dumpsys wifiscanner
dumpsys wifip2p

4. Android 7.0 & 8.0 & 8.1 & 9 & Q wifi log

7.0~9.0:
settings put global wifi_verbose_logging_enabled 1
sync
reboot
logcat -v threadtime -n 8 -r 51200 -f /data/wifi_log.txt &
dumpsys wifi
dumpsys wifiscanner
dumpsys wifip2p
dumpsys wificond

5. kernel log获取

echo 8 > /proc/sys/kernel/printk //可打开全部当前标准输出可查看的log
cat /proc/kmsg > /data/kernel.log
或
dmesg -r
或者kernel跟logcat一起抓取:
logcat -v time -f /dev/kmsg | cat /proc/kmsg

6. memory log抓取

# cat /proc/meminfo
cat /proc/slabinfo
cat /proc/zoneinfo

## ring buffer总的的大小
cat /sys/kernel/debug/tracing/buffer_total_size_kb

## 获取对应的虚拟地址
echo 0 > /proc/sys/kernel/kptr_restrict
cat /proc/vmallocinfo

7.0 network log

BUSYBOX=$1;
echo "$BUSYBOX show platform buffer :";
echo "/proc/sys/net/core/rmem_max: "; cat /proc/sys/net/core/rmem_max;
echo "/proc/sys/net/core/rmem_default: "; cat /proc/sys/net/core/rmem_default;
echo "/proc/sys/net/core/wmem_max: "; cat /proc/sys/net/core/wmem_max;
echo "/proc/sys/net/core/wmem_default: "; cat /proc/sys/net/core/wmem_default;
echo "/proc/sys/net/ipv4/tcp_mem: "; cat /proc/sys/net/ipv4/tcp_mem;
echo "/proc/sys/net/ipv4/tcp_rmem: "; cat /proc/sys/net/ipv4/tcp_rmem;
echo "/proc/sys/net/ipv4/tcp_wmem: "; cat /proc/sys/net/ipv4/tcp_wmem;
echo "/proc/sys/net/ipv4/tcp_window_scaling: "; cat /proc/sys/net/ipv4/tcp_window_scaling;
echo "/proc/sys/net/ipv4/tcp_timestamps: "; cat /proc/sys/net/ipv4/tcp_timestamps
echo "/sys/class/net/eth0/mtu: "; cat /sys/class/net/eth0/mtu
echo "/sys/class/net/wlan0/mtu: "; cat /sys/class/net/wlan0/mtu
echo "/sys/class/net/ppp0/mtu: "; cat /sys/class/net/ppp0/mtu

while true
do
    echo "uptime : "; cat  /proc/uptime;
	echo "date: "; date;
	
	echo "/proc/net/snmp begin_snmp: "; cat /proc/net/snmp;
	echo "/proc/net/snmp end_snmp!!!!!"
	
	echo "$BUSYBOX ifconfig begin_ifconfig: "; $BUSYBOX ifconfig;
	echo "$BUSYBOX ifconfig end_ifconfig!!!!!!";
	
	echo "$BUSYBOX netstat begin_netstat: "; $BUSYBOX netstat -autnp;
	echo "$BUSYBOX netstat end_netstat!!!!!!";
	
	sleep 1;
done

你可能感兴趣的:(Tools)