X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=extras%2Fcore-handler%2Ftest.sh;h=db4e3ac05c53d13363e9a2b6bb68fad8d5c2bb67;hp=0c04bcd97fed9f2153238a17a31793f09098226d;hb=4d513dce5d26cbc477a00b348beb537d01231cd9;hpb=57f0bd0c140c6a5b1f48b45a6680c55348ddbe96 diff --git a/extras/core-handler/test.sh b/extras/core-handler/test.sh index 0c04bcd97..db4e3ac05 100755 --- a/extras/core-handler/test.sh +++ b/extras/core-handler/test.sh @@ -17,16 +17,20 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -LTTNG_BIN="lttng" -CHANNEL_NAME="chan" +SESSION_NAME="coredump-handler" + +# Just recording kernel event sched_switch as an example, but we can as +# well record user-space events from UST domain. EVENT_NAME="sched_switch" -echo "Setup..." -$LTTNG_BIN create --no-output -$LTTNG_BIN enable-channel "${CHANNEL_NAME}" -k --overwrite --output mmap -$LTTNG_BIN enable-event "${EVENT_NAME}" -c "${CHANNEL_NAME}" -k -$LTTNG_BIN start +SNAPSHOT_PATH="/tmp/lttng/snapshot" +SNAPSHOT_URI="file://${SNAPSHOT_PATH}" + +echo "Setup ${SESSION_NAME}..." +$LTTNG_BIN create ${SESSION_NAME} --snapshot -U ${SNAPSHOT_PATH} +$LTTNG_BIN enable-event ${EVENT_NAME} -k -s ${SESSION_NAME} +$LTTNG_BIN start ${SESSION_NAME} echo "Sleeping..." sleep 10 @@ -37,7 +41,8 @@ $(dirname $0)/crash echo "Sleeping..." sleep 10 -$LTTNG_BIN stop -$LTTNG_BIN destroy +$LTTNG_BIN stop ${SESSION_NAME} +$LTTNG_BIN destroy ${SESSION_NAME} -echo "Core dump and snapshot will be available in /tmp/lttng/{core,snapshot}." +echo "Core dump will be available in /tmp/lttng/core." +echo "Snapshot will be available in ${SNAPSHOT_PATH}."