aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2021-11-10 14:52:00 +0530
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2021-11-10 14:52:45 +0530
commit9064170ac5249c4051eebab5cce79be04f831508 (patch)
tree74030d56bad6bfa2a42c3373c4da3aadf1746af3
parent8fae4f6e49b035e02c3369fd22baef1dbb6a0f6b (diff)
Gather vect data from statistics dump file and remove references to vect files.
Change-Id: I12853c72e3c5f76dc70fa65a4acd3085340b63a4
-rw-r--r--cpu2006.cfg2
-rwxr-xr-xvect-data-to-csv.py37
2 files changed, 20 insertions, 19 deletions
diff --git a/cpu2006.cfg b/cpu2006.cfg
index 7dcc468..cab14d8 100644
--- a/cpu2006.cfg
+++ b/cpu2006.cfg
@@ -8,7 +8,7 @@ test_sponsor = Linaro
tester = Linaro
@SAVE_TEMPS@build_pre_bench=mkdir -p $[top]/result/save.$lognum.temps $[top]/result/vect.$lognum.temps
-@SAVE_TEMPS@build_post_bench=find . \\( -name "*.i" -o -name "*.ii" -o -name "*.s" -o -name "*.S" \\) -print0 | tar -cJf $[top]/result/save.$lognum.temps/$benchmark.tar.xz --null --files-from=-; find . -name "*.vect" -print0 | tar -cJf $[top]/result/vect.$lognum.temps/$benchmark.tar.xz --null --files-from=-
+@SAVE_TEMPS@build_post_bench=find . \\( -name "*.i" -o -name "*.ii" -o -name "*.s" -o -name "*.S" -o -name "statistics" \\) -print0 | tar -cJf $[top]/result/save.$lognum.temps/$benchmark.tar.xz --null --files-from=-
bind = @BIND@
submit = (ulimit -s @ULIMIT_STACK@; taskset -c $BIND setarch @SETARCH@ -R $command)
diff --git a/vect-data-to-csv.py b/vect-data-to-csv.py
index 135a2b9..207c6b0 100755
--- a/vect-data-to-csv.py
+++ b/vect-data-to-csv.py
@@ -14,35 +14,36 @@ the result to file specified as 2nd arg.
The results dir has roughly following structure:
results/
node/
- vect.<node-config>.temps/
- compressed vect files
+ save.<node-config>.temps/
+ compressed statistics files
-To find compressed vect files, we glob recursively for */vect.*/*.tar.xz
+To find compressed stats files, we glob recursively for */save.*/*.tar.xz
and after extracting, add bmk name to each entry.
-For eg, if vect file for 400.perlbench contained:
-f1, 2
-f2, 0
+For eg, if stats file for 400.perlbench contained:
+175 vect "Vectorized loops" "f1" 2
+175 vect "Vectorized loops" "f2" 3
+
then in results.csv, the output would be:
400.perlbench, [.] f1, 2
-400.perlbench, [.] f2, 0.
+400.perlbench, [.] f2, 3.
[.] is prepended to each symbol name to make it's output compatible
with perf.
"""
"""
-parse_dump_file will parse .vect dump file as obtained from -fdump-tree-vect-details,
+parse_dump_file will parse stats dump files obtained from -fdump-statistics,
and return a dict symbol -> num_vect_loops
"""
-def parse_dump_file(vect_dump_file):
+def parse_dump_file(stats_dump_file):
symbol_to_num_vect_loops = dict()
- with open(vect_dump_file, "r") as fp:
+ with open(stats_dump_file, "r") as fp:
lines = fp.readlines()
for line in lines:
- if "note: **vectorized" in line:
- line = line.rstrip()[0:-1]
+ line = line.rstrip()
+ if "Vectorized loops" in line:
components = line.split(" ")
- symbol = components[7]
- num_vect_loops = int(components[3])
+ symbol = components[-2][1: -1] # Strip quotes around symbol name
+ num_vect_loops = int(components[-1])
symbol_to_num_vect_loops[symbol] = num_vect_loops
return symbol_to_num_vect_loops
@@ -59,7 +60,7 @@ def main():
csvwriter = csv.writer(outf)
csvwriter.writerow(("benchmark", "symbol", "num_vect_loops"))
- benchmark_files = glob.glob("{0}/**/vect.*/*.tar.xz".format(results_dir), recursive=True)
+ benchmark_files = glob.glob("{0}/**/save.*/*.tar.xz".format(results_dir), recursive=True)
if len(benchmark_files) == 0:
return
@@ -73,12 +74,12 @@ def main():
curr_dir = os.getcwd()
os.chdir(tmp_dir)
- vect_files = glob.glob("**/*.vect", recursive=True)
+ stats_files = glob.glob("**/*.statistics", recursive=True)
# Accumulate num_vect_loops for symbols having same name across the benchmark
sym_to_vect = dict()
- for vect_file in vect_files:
- dump_info = parse_dump_file(vect_file)
+ for stats_file in stats_files:
+ dump_info = parse_dump_file(stats_file)
for symbol in dump_info.keys():
num_vect_loops = dump_info[symbol]
if symbol in sym_to_vect: