summaryrefslogtreecommitdiffstats
path: root/scripts/parse-results.pl
blob: 0a981e362c50a9d381c5aee9324789334835d77d (plain)
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
#!/usr/bin/perl

my $file = shift or die "usage $0 <filename>";

my $runs_per_test   = 10;
my $cur_kbsec_total = 0;
my $cur_ms_total    = 0;
my $cur_fsec_total  = 0;
my $header          = "";

open( IN, "<$file") or die "cant open $file";

print "Device, Blit, Orientation, Bandwidth ( Kb/Sec), Surface Creation time ( ms), Frames per sec\n"; 

while(<IN>)
{
    if (/^test-.*$/)
    {
	if (/(\d+)\s+KB\/sec/i)
	{
	    $cur_kbsec_total += $1;
	}
	elsif (/(\d+)\s+ms/i)
	{
	    $cur_ms_total += $1;
	}
	elsif (/(\d+)\s+frames\/sec/i)
	{
	    $cur_fsec_total += $1;
	}

    } else {

	if ($cur_kbsec_total > 0)
	{
	    print " $header, ".($cur_kbsec_total/$runs_per_test).
		",".($cur_ms_total/$runs_per_test).
		",".($cur_fsec_total/$runs_per_test)."\n";
	}
	
	$cur_kbsec_total = 0;
	$cur_ms_total    = 0;
	$cur_fsec_total  = 0;
	unless (/^\*+/ or /^\s+$/)
	{
	    $header = $_ ;
	    chomp($header);
	}
    }
}

if ($cur_kbsec_total > 0)
{
    print " $header, ".($cur_kbsec_total/$runs_per_test).
	",".($cur_ms_total/$runs_per_test).
	",".($cur_fsec_total/$runs_per_test)."\n";
}

close(IN);