1 #!/bin/bash 2 # SPDX-License-Identifier: GPL-2.0 3 4 before=$(grep "^pid " /proc/slabinfo | awk '{print $2}') 5 6 nr_leaks=$(./debugfs_target_ids_pid_leak 1000) 7 expected_after_max=$((before + nr_leaks / 2)) 8 9 after=$(grep "^pid " /proc/slabinfo | awk '{print $2}') 10 11 echo > /sys/kernel/debug/damon/target_ids 12 13 echo "tried $nr_leaks pid leak" 14 echo "number of active pid slabs: $before -> $after" 15 echo "(up to $expected_after_max expected)" 16 if [ $after -gt $expected_after_max ] 17 then 18 echo "maybe pids are leaking" 19 exit 1 20 else 21 exit 0 22 fi
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.