2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-21 17:37:39 +00:00
समीर सिंह Sameer Singh da7f5b75f4 coredump: enable coredump generation on arm
Add relevant elf header constants and notes for the arm platform
to enable coredump generation.

Signed-off-by: समीर सिंह Sameer Singh <lumarzeli30@gmail.com>
2025-03-03 13:58:50 +00:00

55 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -x
# shellcheck source=test/others/env.sh
source ../env.sh || exit 1
function gen_imgs {
PID=$(../loop with a very very very very very very very very very very very very long cmdline)
if ! $CRIU dump -v4 -o dump.log -D ./ -t "$PID"; then
echo "Failed to checkpoint process $PID"
cat dump.log
kill -9 "$PID"
exit 1
fi
images_list=$(ls -1 ./*.img)
if [ -z "$images_list" ]; then
echo "Failed to generate images"
exit 1
fi
}
function run_test {
echo "= Test core dump"
echo "=== img to core dump"
$CRIU_COREDUMP -i ./ -o ./ || exit $?
echo "=== done"
cores=$(ls -1 core.*)
if [ -z "$cores" ]; then
echo "Failed to generate coredumps"
exit 1
fi
for x in $cores
do
echo "=== try readelf $x"
readelf -a "$x" || exit $?
echo "=== done"
done
echo "= done"
}
UNAME_M=$(uname -m)
if [[ "$UNAME_M" != "aarch64" && "$UNAME_M" != "armv7l" &&"$UNAME_M" != "x86_64" ]]; then
echo "criu-coredump only supports aarch64 armv7l, and x86_64. skipping."
exit 0
fi
gen_imgs
run_test