2 # SPDX-License-Identifier: GPL-2.0+
4 # Create a spreadsheet from torture-test Kconfig options and kernel boot
5 # parameters. Run this in the directory containing the scenario files.
7 # Usage: config2csv path.csv [ "scenario1 scenario2 ..." ]
9 # By default, this script will take the list of scenarios from the CFLIST
10 # file in that directory, otherwise it will consider only the scenarios
11 # specified on the command line. It will examine each scenario's file
12 # and also its .boot file, if present, and create a column in the .csv
13 # output file. Note that "CFLIST" is a synonym for all the scenarios in the
14 # CFLIST file, which allows easy comparison of those scenarios with selected
15 # scenarios such as BUSTED that are normally omitted from CFLIST files.
20 echo "Need .csv output file as first argument."
24 defaultconfigs
="`tr '\012' ' ' < CFLIST`"
27 scenariosarg
=$defaultconfigs
31 scenarios
="`echo $scenariosarg | sed -e "s
/\
<CFLIST\
>/$defaultconfigs/g
"`"
33 T
=`mktemp -d /tmp/config2latex.sh.XXXXXX`
36 cat << '---EOF---' >> $T/p.
awk
41 echo ' s["'$i'"] = 1;' >> $T/p.
awk
42 grep -v '^#' < $i |
grep -v '^ *$' > $T/p
45 tr -s ' ' '\012' < $i.boot |
grep -v '^#' >> $T/p
47 sed -e 's/^[^=]*$/&=?/' < $T/p |
48 sed -e 's/^\([^=]*\)=\(.*\)$/\tp["\1:'"$i"'"] = "\2";\n\tc["\1"] = 1;/' >> $T/p.
awk
50 cat << '---EOF---' >> $T/p.
awk
53 for (j
= 1; j
<= ns
; j
++)
54 printf ",\"%s\"", ss
[j
];
56 for (i
= 1; i
<= nc
; i
++) {
57 printf "\"%s\"", cs
[i
];
58 for (j
= 1; j
<= ns
; j
++) {
59 printf ",\"%s\"", p
[cs
[i
] ":" ss
[j
]];
65 awk -f $T/p.
awk < /dev
/null
> $T/p.csv