Debian Codegraph @

benchmarks.larceny/summarize

raw
1 #!/usr/bin/awk -f
2
3 function clearvars () {
4 test = "";
5 cpu = "";
6 real = "";
7 codesize = "";
8 failed = 0;
9 crashed = 0;
10 runtime = 0;
11 }
12
13 function output () {
14 if (test != "") {
15
16 failure = "";
17
18 if ((crashed != 0) && (failed == 0)) {
19 failure = "crashed";
20 }
21 else if ((crashed == 0) && (failed != 0)) {
22 failure = "failed";
23 }
24 else if ((crashed != 0) && (failed != 0)) {
25 failure = "crashed-and-failed";
26 }
27
28 if (failure == "") {
29 printf "(%-10s %11s %11s %9s)\n", test, cpu, real, codesize;
30 }
31 else {
32 printf "(%-10s %10s)\n", test, failure;
33 }
34 }
35 clearvars();
36 }
37
38 BEGIN {
39 clearvars();
40 }
41
42 /^Testing/ {
43 output();
44 test=$2;
45 }
46
47 /^Running.../ {
48 runtime = 1;
49 }
50
51 runtime == 1 && $0 == "*** wrong result ***" {
52 failed = 1;
53 }
54
55 runtime == 1 && /^Command .* with non-zero/ {
56 crashed = 1;
57 }
58
59 runtime == 1 && /^Command terminated by signal/ {
60 crashed = 1;
61 }
62
63 runtime == 1 && /Abort trap/ {
64 crashed = 1;
65 }
66
67 runtime == 1 && /Error/ {
68 crashed = 1;
69 }
70
71 runtime == 1 && / === context ===/ {
72 crashed = 1;
73 }
74
75
76 runtime == 1 && /ERROR/ && $0 !~ /^FATAL-ERROR$/ && $0 !~ /^SCHEME-ERROR$/ && $0 !~ /^SLATEX-ERROR$/ {
77 crashed = 1;
78 }
79
80 runtime == 1 && /^[ ]*[0-9]+ ms cpu time \([0-9]+ user, [0-9]+ system\)$/ {
81 cpu = $1;
82 }
83
84 runtime == 1 && /^[ ]*[0-9]+ ms real time$/ {
85 real = $1;
86 }
87
88 runtime == 1 && /^cpu time: ([0-9]+) real time: ([0-9]+)/ {
89 cpu = $3;
90 real = $6;
91 }
92
93 runtime == 1 && /^[ ]*([0-9.]+) real [ ]*([0-9.]+) user [ ]*([0-9.]+) sys$/ {
94 cpu = ($3 + $5) * 1000;
95 real = $1 * 1000;
96 }
97
98 runtime == 1 && /[ ]*([0-9.]+)s real [ ]*([0-9.]+)s user [ ]*([0-9.]+)s sys/ {
99 real = $1 * 1000;
100 cpu = ($3 + $5) * 1000;
101 }
102
103
104 runtime == 1 && /^Elapsed time\.\.\.: ([0-9]+) ms/{
105 real = $3;
106 }
107
108 runtime == 1 && /\(User: ([0-9]+) ms; System: ([0-9]+) ms\)/{
109 user= $6;
110 sys=$9;
111 cpu = user+sys;
112 }
113
114 # runtime == 1 && /([0-9.]+)s real/{
115 # real= $1*1000;
116 # }
117 # runtime == 1 && /([0-9.]+)s user/{
118 # user = $1*1000;
119 # }
120 # runtime == 1 && /([0-9.]+)s system/{
121 # sys = $1*1000;
122 # }
123 # runtime == 1 && user && sys {
124 # cpu = user + sys;
125 # }
126
127
128
129
130 runtime == 1 && /^code size = [0-9]+$/ {
131 codesize = $4;
132 }
133
134 END { output() }