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