Cleanup: Remove deprecated TODO file
[lttng-modules.git] / instrumentation / syscalls / lttng-syscalls-extract.sh
CommitLineData
9143c6d5 1#!/bin/bash
b7cdc182 2# SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
9143c6d5
MJ
3
4set -eu
5
6outfile="${1:-}"
7
8if [ "x$outfile" = "x" ]; then
9 echo "Specify an output file as first argument, it will be overwritten."
10 exit 1
11fi
12
13cd lttng-syscalls-extractor || exit 1
14make
15cd - || exit 1
16
17# Generate a random string to use as an identifier
18ident=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 8 | head -n1)
19
20sudo insmod ./lttng-syscalls-extractor/lttng-syscalls-extractor.ko ident="$ident" || true
21
22sudo dmesg | sed -n -e 's/\(\[.*\] \)\?'"$ident"'//p' > "$outfile"
23
24# Make sure we have both the start and end markers
25if grep -q -- '---START---' "$outfile"; then
26 sed -i '/^---START---/d' "$outfile"
27else
28 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."
29 exit 1
30fi
31
32if grep -q -- '---END---' "$outfile"; then
33 sed -i '/^---END---/d' "$outfile"
34else
35 echo "Error: End marker missing from dmesg output, something went wrong."
36 exit 1
37fi
This page took 0.024434 seconds and 4 git commands to generate.