diff options
author | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 02:13:34 +0900 |
---|---|---|
committer | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 02:13:34 +0900 |
commit | 8302bf9f864d62058a5d1e4a4a3aad13175ba97a (patch) | |
tree | d65fbc7fe7f53952b3a62bb37bc9cf44613be36d /all_log_dump | |
parent | adadfec02dc51f10959e8b88f4650fe5ee607270 (diff) | |
download | crash-worker-sdk-8302bf9f864d62058a5d1e4a4a3aad13175ba97a.tar.gz crash-worker-sdk-8302bf9f864d62058a5d1e4a4a3aad13175ba97a.tar.bz2 crash-worker-sdk-8302bf9f864d62058a5d1e4a4a3aad13175ba97a.zip |
Tizen 2.1 base
Diffstat (limited to 'all_log_dump')
-rwxr-xr-x | all_log_dump/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | all_log_dump/all_log_dump.sh | 332 |
2 files changed, 334 insertions, 0 deletions
diff --git a/all_log_dump/CMakeLists.txt b/all_log_dump/CMakeLists.txt new file mode 100755 index 0000000..dd68dd6 --- /dev/null +++ b/all_log_dump/CMakeLists.txt @@ -0,0 +1,2 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/all_log_dump/all_log_dump.sh DESTINATION /usr/bin) diff --git a/all_log_dump/all_log_dump.sh b/all_log_dump/all_log_dump.sh new file mode 100755 index 0000000..a98487d --- /dev/null +++ b/all_log_dump/all_log_dump.sh @@ -0,0 +1,332 @@ +#!/bin/sh + +PARAM1=$1 +PARAM2=$2 +PARAM3=$3 + +#-------------------------------------- +# Setup log dump path +#-------------------------------------- +TIMESTAMP=`date +%m%d_%H%M` +TIMESTAMP_DFMS=`date +%Y%m%d%H%M%S` +LOG_SRC_DIR=/opt/var/log +LOG_DST_DIR_BASE=/opt/usr/media/SLP_debug +if [ "$PARAM1" = "dfms" ]; then + LOG_DIR=factory_${PARAM2}_${PARAM3}_dumpstate${TIMESTAMP_DFMS} +else + LOG_DIR=log_dump_${TIMESTAMP} +fi +LOG_DST_DIR=${LOG_DST_DIR_BASE}/${LOG_DIR} +MOD_LOG_DIR=${LOG_DST_DIR}/module_log +CP_LOG_DIR=${LOG_DST_DIR}/modem_log +SCAN_IGNORE=${LOG_DST_DIR_BASE}/.scan_ignore +mkdir -p ${LOG_DST_DIR_BASE} +chown app:app ${LOG_DST_DIR_BASE} +if [ ! -e ${SCAN_IGNORE} ]; then + touch ${SCAN_IGNORE} +fi +#-------------------------------------- +# LCD on off control +#-------------------------------------- +HW_NAME=`cat /proc/cpuinfo | grep Hardware | awk -F ':' '{print $2}' | tr -d ' '` +if [ "${HW_NAME}" = "U1SLP" ] || [ "${HW_NAME}" = "U1HD" || [ "${HW_NAME}" = "TRATS" ]; then + LCD_BLANK=/sys/class/graphics/fb3/blank +else + LCD_BLANK=/sys/class/graphics/fb0/blank +fi + +lcd_on() { + echo 0 > ${LCD_BLANK} +} + +lcd_off() { + echo 4 > ${LCD_BLANK} +} + +lcd_blank1() { + lcd_on + usleep 200 + lcd_off + usleep 200 +} + +lcd_blank() { + count=$1 + while [ ${count} -gt 0 ] + do + lcd_blank1 + count=`expr ${count} - 1` + done +} + +if [ "$PARAM1" = "hardkey" ]; then + lcd_blank 3 + lcd_on + # enable sdb + /usr/bin/set_usb_debug.sh --set + # change atd to console mode + pkill -SIGUSR1 atd-server +else + if [ "$PARAM1" = "z" ]; then + LOG_ZIP_DST_FILE_NAME=$2 + fi +fi + + +#-------------------------------------- +# common logs - /opt/var/log +#-------------------------------------- +COMMMON_LOG_DIR=${LOG_DST_DIR}/var_log +mkdir -p ${COMMMON_LOG_DIR} +cp -fr ${LOG_SRC_DIR}/* ${COMMMON_LOG_DIR} + + +dlogutil -d -v time -f ${LOG_DST_DIR}/dlog_dump.log +ps -aux > ${LOG_DST_DIR}/ps.log +memps -a > ${LOG_DST_DIR}/memps.log +top -bc -n 1 > ${LOG_DST_DIR}/top.log + + +#-------------------------------------- +# modem +#-------------------------------------- +mkdir -p ${CP_LOG_DIR} +mv -f /opt/etc/modem/err/* ${CP_LOG_DIR} + + +# call each module's log dump script + +#-------------------------------------- +# bluetooth +#-------------------------------------- +BT_DEBUG=${MOD_LOG_DIR}/bluetooth +mkdir -p ${BT_DEBUG} +#cp -rf /var/lib/bluetooth/* ${BT_DEBUG} +tar -cvf ${BT_DEBUG}/bt.log.tar /var/lib/bluetooth + +#-------------------------------------- +# contacts-svc +#-------------------------------------- +CONTACT_SVC_DEBUG=${MOD_LOG_DIR}/contacts-svc +mkdir -p ${CONTACT_SVC_DEBUG} +cp /opt/dbspace/.contacts-svc.db ${CONTACT_SVC_DEBUG} + + +#-------------------------------------- +# eas +#-------------------------------------- +EAS_DEBUG=${MOD_LOG_DIR}/eas +mkdir -p ${EAS_DEBUG} +cp /opt/usr/dbspace/.assync* ${EAS_DEBUG} +cp /opt/usr/dbspace/.eas-common* ${EAS_DEBUG} +cp -fa /opt/usr/data/eas-engine ${EAS_DEBUG} + + +#-------------------------------------- +# ims +#-------------------------------------- +IMS_DEBUG=${MOD_LOG_DIR}/ims +mkdir -p ${IMS_DEBUG} +cp /opt/apps/com.samsung.rcs-im/data/db/.rcs-im.db ${IMS_DEBUG} +cp /opt/share/ims/* ${IMS_DEBUG} + + + +#-------------------------------------- +# kap +#-------------------------------------- +KAP_DEBUG=${MOD_LOG_DIR}/kap +mkdir -p ${KAP_DEBUG} +vconftool get -r db/ > ${KAP_DEBUG}/vconf_db.log +vconftool get -r memory/ > ${KAP_DEBUG}/vconf_memory.log + + + +#-------------------------------------- +# kies-via-wifi +#-------------------------------------- +KW_DEBUG=${MOD_LOG_DIR}/kies_via_wifi +mkdir -p ${KW_DEBUG} +cp -f /opt/dbspace/.kies_device.db* ${KW_DEBUG} + + +#-------------------------------------- +# mobex-for-kies +#-------------------------------------- +TT_DEBUG=${MOD_LOG_DIR}/mobex-for-kies +mkdir -p ${TT_DEBUG} +cp /tmp/hostapd.log ${TT_DEBUG} +cp -rf /opt/dbspace/.kiessyncagent.db ${TT_DEBUG} +cp -rf /opt/data/mobex/mobex_sync_id ${TT_DEBUG} +cp -rf /opt/data/sync-agent-framework/db/.pc_sync_* ${TT_DEBUG} + +vconftool get -r db/ > ${TT_DEBUG}/vconf_db.log +vconftool get -r memory/ > ${TT_DEBUG}/vconf_memory.log + + +#-------------------------------------- +# vt +#-------------------------------------- +VT_DEBUG=${MOD_LOG_DIR}/vt +mkdir -p ${VT_DEBUG} +cp -rf /opt/etc/vt_debug/ ${VT_DEBUG} + + +#-------------------------------------- +# nfc +#-------------------------------------- +NFC_DEBUG=${MOD_LOG_DIR}/nfc +mkdir -p ${NFC_DEBUG} +cp -rf /opt/etc/nfc_debug/ ${NFC_DEBUG} +cp -rf /opt/data/nfc-manager-daemon/message/ ${NFC_DEBUG} + + +#-------------------------------------- +# oma-ds +#-------------------------------------- +OMA_DEBUG=${MOD_LOG_DIR}/oma-ds +mkdir -p ${OMA_DEBUG} +cp -rf /opt/dbspace/.omasyncagent.db* ${OMA_DEBUG} + +vconftool get -r db/ > ${OMA_DEBUG}/vconf_db.log +vconftool get -r memory/ > ${OMA_DEBUG}/vconf_memory.log + + +#-------------------------------------- +# tethering +#-------------------------------------- +TETH_DEBUG=${MOD_LOG_DIR}/tethering +mkdir -p ${TETH_DEBUG} +cp /tmp/hostapd.log ${TETH_DEBUG} +cp -rf /tmp/dnsmasq.conf /opt/var/lib/misc/* ${TETH_DEBUG} + +vconftool get db/mobile_hotspot > ${TETH_DEBUG}/vconf_db.log +vconftool get memory/mobile_hotspot > ${TETH_DEBUG}/vconf_memory.log +iptables -t nat -L -vv > ${TETH_DEBUG}/iptables_nat.log +iptables -L -vv > ${TETH_DEBUG}/iptables_filter.log + + +#-------------------------------------- +# winsys +#-------------------------------------- +export DISPLAY=:0.0 +WINSYS_DEBUG=${MOD_LOG_DIR}/winsys +mkdir -p ${WINSYS_DEBUG} +xinfo -p 2> ${WINSYS_DEBUG}/ping.log +xinfo -xwd_topvwins ${WINSYS_DEBUG} +e_comp_util -l DUMP_INFO -f ${WINSYS_DEBUG}/e_comp.log +border_win_info -p ALL -f ${WINSYS_DEBUG}/e_illume2.log +cp -af /opt/var/log/keygrab_status.txt ${WINSYS_DEBUG} +screenshot bmp ${WINSYS_DEBUG}/slp_screenshot.bmp +xinfo -topvwins 2> ${WINSYS_DEBUG}/xinfo_topvwins.txt + +xberc clist > ${WINSYS_DEBUG}/clist.log + +xberc drmmode_dump > ${WINSYS_DEBUG}/drmmode_dump.log + +find /var/log/ -name "*Xorg*" -exec cp {} ${WINSYS_DEBUG}/ \; + + +#-------------------------------------- +# web-apps +#-------------------------------------- +WEBAPP_DEBUG=${MOD_LOG_DIR}/webapp +mkdir -p ${WEBAPP_DEBUG} + +_app_dir_prefix=/opt/apps +_log_file=${WEBAPP_DEBUG}/web-apps.log + +get_widget_list() { + _widget_list=`sqlite3 /opt/dbspace/.wrt.db "select pkgname from WidgetInfo;"` + return _widget_list +} + +tar_widget() { + _tar_pkg=$1 + tar zcvf ${WEBAPP_DEBUG}/$_tar_pkg.tgz $_app_dir_prefix/$_tar_pkg >> $_log_file +} + +check_widget_running_and_tar() { + _current_widget=$1 + is_running=`aul_test is_run $_current_widget | grep "is running"` + if [ -n "$is_running" ]; then + echo "$_current_widget widget running" >> $_log_file + tar_widget $_current_widget + else + echo "$_current_widget widget not running" >> $_log_file + fi +} + +tar_running_widgets() { + _widget_list=`sqlite3 /opt/dbspace/.wrt.db "select pkgname from WidgetInfo;"` + for _widget_pkg_name in $_widget_list + do + check_widget_running_and_tar $_widget_pkg_name + done +} + +get_logs() { + echo "wrt-launcher -l" >> $_log_file + wrt-launcher -l >> $_log_file + echo "====================================" >> $_log_file +} + +get_logs +tar_running_widgets + +#-------------------------------------- +# ChatON +#-------------------------------------- +CHATON_DEBUG=${MOD_LOG_DIR}/chaton +mkdir -p ${CHATON_DEBUG} +cp -rf /opt/apps/xnq5eh9vop/shared/data/debug/ ${CHATON_DEBUG} +cp -rf /opt/apps/xnq5eh9vop/shared/data/ssm.db ${CHATON_DEBUG} + +#-------------------------------------- +# power-manager +#-------------------------------------- +pmctrl log +PM_DEBUG=${MOD_LOG_DIR}/power-manager +mkdir -p ${PM_DEBUG} +cp -rf /opt/var/log/pm_state.log ${PM_DEBUG} + +#===================================== +# ap log dump copy +#===================================== +AP_LOG_DIR=${LOG_DST_DIR}/ap_log +mkdir -p ${AP_LOG_DIR} +cp -rf /opt/usr/share/crash/core/* ${AP_LOG_DIR} +cp -rf /opt/usr/share/crash/dump/* ${AP_LOG_DIR} +rm -rf /opt/usr/share/crash/core/* +rm -rf /opt/usr/share/crash/dump/* +rm -rf /opt/usr/share/crash/ticket/* + +#====================================== +# log dump done +#====================================== +# change owner so that dump can by read by PC via MTP +cd /opt/usr/media +chown app:app -R ${LOG_DST_DIR_BASE} +chmod 777 -R ${LOG_DST_DIR_BASE} + +if [ "${PARAM1}" = "z" ]; then + tar zcf ${LOG_ZIP_DST_FILE_NAME} -C ${LOG_DST_DIR_BASE} ${LOG_DIR} + chown app:app ${LOG_ZIP_DST_FILE_NAME} + rm -rf ${LOG_DST_DIR} + echo tar zcf ${LOG_ZIP_DST_FILE_NAME} -C ${LOG_DST_DIR_BASE} ${LOG_DIR} + echo rm -rf ${LOG_DST_DIR} +fi + +if [ "${PARAM1}" = "hardkey" ]; then + +if [ "${HW_NAME}" = "U1SLP" ] || [ "${HW_NAME}" = "U1HD" || [ "${HW_NAME}" = "TRATS" ]; then + echo AP > /sys/devices/platform/uart-select/path +else + echo AP > /sys/devices/virtual/sec/switch/uart_sel +fi + +lcd_blank 3 +lcd_on +fi + + |