summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/coredump/stackdump
blob: 96714ce42d12cfe1041676ccb631759d00d9e7dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

CRASH_PROGRAM_ID=$1
STACKDUMP_FILE=$2

TMP=$(mktemp)

for t in /proc/$CRASH_PROGRAM_ID/task/*; do
	tid=$(basename $t)
	cat /proc/$tid/stat | awk '{print $29}' >> $TMP
done

mv $TMP $STACKDUMP_FILE