mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00

Add a test which checks that the kstkesp field in /proc/pid/stat can be read for all threads of a coredumping process. For full details including the motivation for this test and how it works, see the README file added by this commit. Reviewed-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Nam Cao <namcao@linutronix.de> Link: https://lore.kernel.org/r/50e737b6576208566d14efcf1934fe840de6b1f4.1735805772.git.namcao@linutronix.de Signed-off-by: Christian Brauner <brauner@kernel.org>
14 lines
243 B
Bash
Executable file
14 lines
243 B
Bash
Executable file
#!/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
|