Skip to content

Commit 7567328

Browse files
committed
better stat output
1 parent 9b9d121 commit 7567328

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

afl-cov.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ test "$1" = "-v" && { OPT="-v" ; shift ; }
2424
afl-cov $OPT -d "$DST" --cover-corpus --coverage-cmd "$2" --code-dir . --overwrite
2525

2626
test -e "$1"/fuzzer_stats && {
27-
echo "runtime :" $(expr `grep last_update "$DST"/fuzzer_stats|awk '{print$3}'` - `grep start_time "$DST"/fuzzer_stats|awk '{print$3}'`) seconds
27+
DIFF=$(expr `grep last_update "$DST"/fuzzer_stats|awk '{print$3}'` - `grep start_time "$DST"/fuzzer_stats|awk '{print$3}'`)
28+
echo "runtime : $DIFF seconds"
29+
TIME=`date -u -d "@$SECONDS" +"%T"`
30+
echo "run_clock : $TIME"
2831
egrep 'execs_done|paths_total|^unique_|stability' "$DST"/fuzzer_stats
2932
LINES=
3033
test -e "$1"/cov/afl-cov.log && LINES=`grep -w lines "$1"/cov/afl-cov.log|tail -n 1|sed 's/.*(//'|sed 's/ .*//'`
31-
echo "coverage : $LINES"
34+
echo "coverage : $LINES lines"
3235
} | tee "$1"/stats.out
3336

3437
echo open "file://$DST/cov/web/index.html"

afl-stat.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ while [ -n "$1" ]; do
1212
{
1313
egrep 'run_time|execs_done|execs_per_sec|paths_total|^unique_|stability' "$1"/fuzzer_stats
1414
SECONDS=`egrep run_time "$1"/fuzzer_stats | awk '{print$3}'`
15-
TIME=`date -u -d "@$SECONDS" +"%T"`
16-
echo "run_clock : $TIME"
15+
test -n "$SECONDS" && {
16+
TIME=`date -u -d "@$SECONDS" +"%T"`
17+
echo "run_clock : $TIME"
18+
}
1719
} | sort | tee "$1"/stats.out
1820
LINES=
1921
test -e "$1"/cov/afl-cov.log && {
2022
LINES=`grep -w lines "$1"/cov/afl-cov.log|tail -n 1|sed 's/.*(//'|sed 's/ .*//'`
21-
echo "coverage : $LINES" | tee -a "$1"/stats.out
23+
echo "coverage : $LINES lines" | tee -a "$1"/stats.out
2224
}
2325
shift
2426
done

0 commit comments

Comments
 (0)