Rearrange crash-manager tasks 27/102227/2 accepted/tizen/3.0/common/20161209.160720 accepted/tizen/3.0/ivi/20161209.102509 accepted/tizen/3.0/mobile/20161209.102413 accepted/tizen/3.0/tv/20161209.102432 accepted/tizen/3.0/wearable/20161209.102502 submit/tizen_3.0/20161208.073002
authorSunmin Lee <sunm.lee@samsung.com>
Mon, 5 Dec 2016 07:59:22 +0000 (16:59 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Mon, 5 Dec 2016 09:55:30 +0000 (18:55 +0900)
Launching crash popup and collecting log are required to be done first.

Change-Id: I97d48117223fffc7c61923c742062f16b4f288eb

src/crash-manager/99-crash-manager.conf.in
src/crash-manager/crash-manager.sh.in

index 8277deb..505bc20 100644 (file)
@@ -1,3 +1,3 @@
 # Tizen crash-manager
-kernel.core_pattern=|/usr/bin/crash-manager.sh %p %u %g %s %t %e
+kernel.core_pattern=|/usr/bin/crash-manager.sh %p %u %g %s %t %e %E
 kernel.core_pipe_limit=10
index 882f0c3..93e1e6a 100644 (file)
@@ -26,7 +26,7 @@ DEBUG=1
 
 # Expected invocation from kernel:
 #
-#   argv0 PID UID GID SIGNAL TIME CMD
+#   argv0 PID UID GID SIGNAL TIME CMD EXEPATH
 pid="$1"
 time="$5"
 cmd="$6"
@@ -48,34 +48,10 @@ then
   mv "$sysassert_cs_path" "$pfx/"
 fi
 
-if [ $DEBUG -eq 1 ]
-then
-  @CRASH_PIPE_PATH@ --save-core "$core_path" --report "$@" > "$info_path"
-#  @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
-else
-  @CRASH_PIPE_PATH@ --report "$@" > "$info_path"
-#  @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
-fi
-
 if [ -e $TZ_SYS_ETC/.debugmode ]
 then
 #Find the full path of executable. The path is used to find appid in the crash-popup
-       exepath=" "
-       found=0
-       while read line
-       do
-               if [ $found -eq 1 ]
-               then
-                       exepath=$(echo $line | sed "s/0: //")
-                       break
-               fi
-
-               if [ "$line" = "Cmdline:" ]
-               then
-                       found=1
-               fi
-
-       done < $info_path
+       exepath="$(echo $7 | sed 's/!/\//g')"
 
 #Call dbus method to launch the crash-popup
        /usr/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=120000 --dest=org.tizen.system.popup /Org/Tizen/System/Popup/Crash org.tizen.system.popup.Crash.PopupLaunch dict:string:string:"_SYSPOPUP_CONTENT_","crash","_PROCESS_NAME_","${cmd}","_EXEPATH_","${exepath}"
@@ -84,8 +60,16 @@ fi
 
 dump_systemstate -d -k -f "$log_path" || true
 
+if [ $DEBUG -eq 1 ]
+then
+  @CRASH_PIPE_PATH@ --save-core "$core_path" --report "$@" > "$info_path"
+#  @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
+else
+  @CRASH_PIPE_PATH@ --report "$@" > "$info_path"
+#  @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path"
+fi
+
 tar czf "${temp_dir}/report.tar.gz" -C "$temp_dir" "$name"
 mv "${temp_dir}/report.tar.gz" "$result_path"
 
 [ "$temp_dir" ] && rm -rf "$temp_dir"
-