增加文件 /MSM8930/LA17443015/trunk/TW01/LINUX/android/device/qcom/msm8960/init.corelog.sh
#!/system/bin/sh
#LOGPATH=/sdcard/corelog
LOGPATH=/data/corelog
LOGPATH_LAST=$LOGPATH/last
LOGCAT=$LOGPATH/logcat.txt
LOGCAT_RADIO=$LOGPATH/logcat_radio.txt
LOGKMSG=$LOGPATH/kmsg.txt
#ensure $LOGPATH is exist
mkdir $LOGPATH
# remove old backup log files
rm -r $LOGPATH_LAST
# re-creat backup directory
mkdir $LOGPATH_LAST
#copy last files to backup directory
mv $LOGPATH/*.* $LOGPATH_LAST
# set core_pattern to let kernel generate core dump during process crash
# core dump file(core-PID-EXE_NAME-TIME.dump) will be generated in /data
#echo $LOGPATH/core-%p-%e-%t.dump > /proc/sys/kernel/core_pattern
# set RLIMIT_CORE to set core dump file size(multiply of 512)
#ulimit -c 2048
#/system/bin/sh ulimit -c 2048
#use init buildin command setrlimit
#setrlimit 4 40960000 40960000
cat /proc/kmsg > $LOGKMSG &
/system/bin/logcat -v time -f $LOGCAT &
/system/bin/logcat -b radio -v time -f $LOGCAT_RADIO &
/system/bin/insmod /etc/printk2glog.ko
#echo 1048576@0x7FE00000 > /proc/glog
#for j in {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 };
#do
#for i in {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 };
#do
#cat /proc/glog >> /data/corelog/glog.txt
#done
#done
修改文件/MSM8930/LA17443015/trunk/TW01/LINUX/android/device/qcom/msm8960/init.target.rc中增加
service corelog /system/bin/sh /etc/init.corelog.sh
disabled
user root
oneshot
# and it is set by init
on property:ro.corelog_enable=1
start corelog
修改文件/MSM8930/LA17443015/trunk/TW01/LINUX/android/device/qcom/msm8960/msm8960.mk中增加
# corelog files
PRODUCT_COPY_FILES += device/qcom/msm8960/init.corelog.sh:system/etc/init.corelog.sh
修改文件/MSM8930/LA17443015/trunk/TW01/LINUX/android/device/qcom/msm8960/system.prop中增加
#qhs add
ro.corelog_enable=1