2 # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
8 if [ "$outfile" = "" ]; then
9 echo "Specify an output file as first argument, it will be overwritten."
13 # Generate a random string to use as an identifier
14 ident
=$
(tr -dc 'a-zA-Z0-9' < /dev
/urandom |
fold -w 8 |
head -n1)
17 make syscalls_extractor
19 sudo insmod .
/src
/lttng-wrapper.ko
20 sudo insmod .
/src
/lttng-syscalls-extractor.ko ident
="$ident" || true
21 sudo rmmod lttng-wrapper
25 sudo dmesg |
sed -n -e 's/\(\[.*\] \)\?'"$ident"'//p' > "$outfile"
27 # Make sure we have both the start and end markers
28 if grep -q -- '---START---' "$outfile"; then
29 sed -i '/^---START---/d' "$outfile"
31 echo "Error: Start marker missing from dmesg output, your kernel log buffer is probably too small, set CONFIG_LOG_BUF_SHIFT to a bigger value."
35 if grep -q -- '---END---' "$outfile"; then
36 sed -i '/^---END---/d' "$outfile"
38 echo "Error: End marker missing from dmesg output, something went wrong."