Fix: Snapshot should be taken asap in core handler script
authorChristian Babeux <christian.babeux@efficios.com>
Thu, 15 Aug 2013 17:03:36 +0000 (13:03 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 15 Aug 2013 17:32:08 +0000 (13:32 -0400)
Taking a snapshot should be the first thing the core handler does.
An enormous core file write to disk could potentially discard a lot
of tracing data if done before the snapshot.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
extras/core-handler/handler.sh

index 781728223bd64b50355a022bc0cf8d24a1348e5c..c2d24027b42224bd31a368d2da9266c69eceb23e 100755 (executable)
@@ -29,6 +29,12 @@ SESSION_NAME="coredump-handler"
 # Sessiond binary name.
 SESSIOND_BIN_NAME="lttng-sessiond"
 
+# TODO: Checking for a sessiond lockfile would be more appropriate.
+if $PGREP_BIN -u root "${SESSIOND_BIN_NAME}" > /dev/null 2>&1
+then
+    $LTTNG_BIN snapshot record -s ${SESSION_NAME} > /dev/null 2>&1
+fi
+
 # Core file settings.
 CORE_PATH="/tmp/lttng/core"
 CORE_PREFIX="core"
@@ -54,9 +60,3 @@ $CAT_BIN - > "${CORE_PATH}/${CORE_PREFIX}.$p"
 
 # Optional, chain core dump handler with original systemd script.
 #$CAT_BIN - | /usr/lib/systemd/systemd-coredump $p $u $g $s $t $e
-
-# TODO: Checking for a sessiond lockfile would be more appropriate.
-if $PGREP_BIN -u root "${SESSIOND_BIN_NAME}" > /dev/null 2>&1
-then
-    $LTTNG_BIN snapshot record -s ${SESSION_NAME} > /dev/null 2>&1
-fi
This page took 0.027608 seconds and 5 git commands to generate.