mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 18:48:08 +00:00
better afl startup detection in afl-whatsup
This commit is contained in:
27
afl-whatsup
27
afl-whatsup
@ -174,11 +174,15 @@ FIRST=true
|
|||||||
TOTAL_WCOP=
|
TOTAL_WCOP=
|
||||||
TOTAL_LAST_FIND=0
|
TOTAL_LAST_FIND=0
|
||||||
|
|
||||||
for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
|
for j in `find . -maxdepth 2 -iname fuzzer_setup | sort`; do
|
||||||
|
|
||||||
|
DIR=$(dirname "$j")
|
||||||
|
i=$DIR/fuzzer_stats
|
||||||
|
|
||||||
|
if [ -f "$i" ]; then
|
||||||
|
|
||||||
sed 's/^command_line.*$/_skip:1/;s/[ ]*:[ ]*/="/;s/$/"/' "$i" >"$TMP"
|
sed 's/^command_line.*$/_skip:1/;s/[ ]*:[ ]*/="/;s/$/"/' "$i" >"$TMP"
|
||||||
. "$TMP"
|
. "$TMP"
|
||||||
DIR=$(dirname "$i")
|
|
||||||
DIRECTORY=$DIR
|
DIRECTORY=$DIR
|
||||||
DIR=${DIR##*/}
|
DIR=${DIR##*/}
|
||||||
RUN_UNIX=$run_time
|
RUN_UNIX=$run_time
|
||||||
@ -210,9 +214,9 @@ for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
|
|||||||
IS_STARTING=
|
IS_STARTING=
|
||||||
IS_DEAD=
|
IS_DEAD=
|
||||||
|
|
||||||
if [ -e "$i" ] && [ -e "$DIRECTORY/fuzzer_setup" ] && [ -n "$FUSER" ]; then
|
if [ -e "$i" ] && [ -e "$j" ] && [ -n "$FUSER" ]; then
|
||||||
|
|
||||||
if [ "$i" -ot "$DIRECTORY/fuzzer_setup" ]; then
|
if [ "$i" -ot "$j" ]; then
|
||||||
|
|
||||||
# fuzzer_setup is newer than fuzzer_stats, maybe the instance is starting?
|
# fuzzer_setup is newer than fuzzer_stats, maybe the instance is starting?
|
||||||
TMP_PID=`fuser -v "$DIRECTORY" 2>&1 | grep afl-fuzz`
|
TMP_PID=`fuser -v "$DIRECTORY" 2>&1 | grep afl-fuzz`
|
||||||
@ -336,6 +340,19 @@ for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if [ ! -e "$i" -a -e "$j" ]; then
|
||||||
|
|
||||||
|
ALIVE_CNT=$((ALIVE_CNT + 1))
|
||||||
|
START_CNT=$((START_CNT + 1))
|
||||||
|
last_find=0
|
||||||
|
IS_STARTING=1
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Formatting for total time, time since last find, crash, and hang
|
# Formatting for total time, time since last find, crash, and hang
|
||||||
@ -346,7 +363,7 @@ EXECS_MILLION=$((TOTAL_EXECS / 1000 / 1000))
|
|||||||
EXECS_THOUSAND=$((TOTAL_EXECS / 1000 % 1000))
|
EXECS_THOUSAND=$((TOTAL_EXECS / 1000 % 1000))
|
||||||
if [ $EXECS_MILLION -gt 9 ]; then
|
if [ $EXECS_MILLION -gt 9 ]; then
|
||||||
FMT_EXECS="$EXECS_MILLION millions"
|
FMT_EXECS="$EXECS_MILLION millions"
|
||||||
elif [ $EXECS_MILLION -gt 0 ]; then
|
elif [ $EXECS_MILLION -gt 0 ]; then
|
||||||
FMT_EXECS="$EXECS_MILLION millions, $EXECS_THOUSAND thousands"
|
FMT_EXECS="$EXECS_MILLION millions, $EXECS_THOUSAND thousands"
|
||||||
else
|
else
|
||||||
FMT_EXECS="$EXECS_THOUSAND thousands"
|
FMT_EXECS="$EXECS_THOUSAND thousands"
|
||||||
|
Reference in New Issue
Block a user