File: test.sh

package info (click to toggle)
ltt-control 2.13.15-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 17,656 kB
  • sloc: ansic: 167,287; sh: 27,018; makefile: 2,828; python: 1,380; yacc: 692; lex: 129; java: 109; perl: 99; cpp: 35; xml: 23
file content (35 lines) | stat: -rwxr-xr-x 851 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# Copyright (C) 2013 Christian Babeux <christian.babeux@efficios.com>
#
# SPDX-License-Identifier: GPL-2.0-only
#

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"

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

echo "Crashing..."
$(dirname $0)/crash

echo "Sleeping..."
sleep 10

$LTTNG_BIN stop ${SESSION_NAME}
$LTTNG_BIN destroy ${SESSION_NAME}

echo "Core dump will be available in /tmp/lttng/core."
echo "Snapshot will be available in ${SNAPSHOT_PATH}."