-
Notifications
You must be signed in to change notification settings - Fork 152
/
get_unknown_bits_count.sh
executable file
·60 lines (53 loc) · 1.5 KB
/
get_unknown_bits_count.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
function display_help() {
echo "This is a utility script that helps displaying the total"
echo "amount of unknown bits in the various minitest."
echo ""
echo "The minitest must contain a Makefile which flow ends in the"
echo "generation of a FASM file."
echo ""
echo "Arguments:"
echo " -m|--minitests: list of minitest directories from which the FASM files are"
echo " generated and parsed to get the total amount of missing"
}
MINITEST_DIRS=()
MINITEST=0
for arg in $@; do
case "$arg" in
-m|--minitests)
MINITEST=1
;;
*)
if [ $MINITEST -eq 1 ]; then
MINITEST_DIRS+=($arg)
else
display_help
exit 1
fi
;;
esac
done
if [ $# -eq 0 ]; then
display_help
exit 1
fi
for MINITEST in ${MINITEST_DIRS[*]}
do
echo "-----------------------------"
echo "$MINITEST"
echo "-----------------------------"
make -q -C $MINITEST all
FASM_FILE=`find $MINITEST -name "*.fasm"`
MISSING_BITS=`grep "unknown_bit" $FASM_FILE | wc -l`
MISSING_FRAMES=`grep "In frame" $FASM_FILE | wc -l`
echo "Total of unknown bits: $MISSING_BITS"
echo "Total of unknown frames: $MISSING_FRAMES"
echo ""
done