Skip to content

Commit 424905f

Browse files
committed
Minor tweaks to the eba-linux.sh script
1 parent 9179b2b commit 424905f

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
EBA is a prototype bug finder for C based on side-effect analysis and model-checking.
44

5-
For now, you can use it to find double-lock bugs in the Linux kernel:
5+
For now, you can use it to find double-lock bugs in the Linux kernel, e.g.:
66

77
git clone --depth=1 https://github.com/torvalds/linux.git
88
cd linux
99
make allyesconfig
10-
scripts/eba-linux.sh drivers/
10+
scripts/eba-linux.sh drivers/net
1111

1212
The script will find all C source files under `drivers/`, call CPP on them, and call EBA to find potential double-locks. Be patient, this may take several hours.
1313

14-
The preprocessed files and the findings of EBA are put under the `_eba` sub-directory. If EBA finds some potential bug in `_eba/path/to/file.c`, it will write the bug traces in `_eba/path/to/file.warn`:
14+
If EBA finds some potential bug in `path/to/file.c`, it will write the bug traces in `_eba/path/to/file.warn`:
1515

1616
find _eba/ -iname '*.warn'
1717

scripts/eba-linux.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ analyze() {
1414
fi
1515

1616
if [ -f "$tfile" ]; then
17-
echo -n "Analyzing $cfile ... " >&2
18-
/usr/bin/time -o /dev/fd/3 --format="%E" timeout 15m \
17+
echo -n "Analyzing $cfile ... " >>eba-linux.log
18+
/usr/bin/time -a -o eba-linux.log --format="%E" timeout 15m \
1919
eba -L --warn-output --externs-do-nothing ${tfile} \
20-
3>&2 >>eba.log 2>&1 || true
20+
>>eba.log 2>&1 || true
21+
rm -f "${tfile}" "${ifile}"
22+
rm -f -d "$(dirname ${tfile})"
2123
fi
2224
}
2325

@@ -40,8 +42,14 @@ if ! command -v eba > /dev/null; then
4042
exit 1
4143
fi
4244

43-
echo "OK, let's analyze... (this may take several hours)" >&2
45+
echo "NOTE: This may take several hours." >&2
46+
echo -ne "OK, let's analyze...\r" >&2
47+
file_count=0
4448
find "$linuxdir" -type f -name '*.c' -print0 | \
4549
while IFS= read -r -d '' file; do
4650
analyze "$file"
51+
file_count=$((file_count + 1))
52+
echo -ne "Analyzed $file_count files...\r" >&2
4753
done
54+
echo -ne "\n"
55+
echo "Done!" >&2

0 commit comments

Comments
 (0)