|
1 # Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # This script extracts the data from a uibench.htm file |
|
15 # |
|
16 # |
|
17 |
|
18 my $htm=$ARGV[0]; |
|
19 print "Parsing $htm, time, unit, rot, src, dst\n"; |
|
20 my $testdata = process_test_log2($htm,'st_perf_'); |
|
21 foreach my $result (@$testdata) { |
|
22 next if defined $testname and $result->{'testname'} ne $testname; |
|
23 if ($ARGV[1] eq '--notestname') { |
|
24 print "$result->{'dura'}\n"; |
|
25 } elsif ($ARGV[1] eq '-tab') { |
|
26 print "$result->{'testname'} $result->{'dura'} $result->{'unit'} $result->{'rota'} $result->{'smode'} $result->{'dmode'}\n"; |
|
27 } else { |
|
28 print "$result->{'testname'},$result->{'dura'},$result->{'unit'},$result->{'rota'},$result->{'smode'},$result->{'dmode'}\n"; |
|
29 } |
|
30 } |
|
31 exit; |
|
32 |
|
33 sub process_test_log2 { |
|
34 my ($file,$prefix) = @_; |
|
35 print "Processing $file\n" if $DEBUG; |
|
36 open(LOG,$file) or die "Error opening $file\n$!\n"; |
|
37 |
|
38 my $result = []; |
|
39 my ($name,$start,$end); |
|
40 |
|
41 while (my $line = <LOG>) { |
|
42 |
|
43 if ($line =~ /[0-9:]{12}\s+.+?\s+TID:\s*/) { |
|
44 ($prt1,$prt2)=split(/\s+TID:\s+/,$line); |
|
45 ($tname,$prt3)=split(/\s+Rot:\s+/,$prt2); |
|
46 ($rotation,$x1,$srcMode,$x2,$dstMode,$x3,$iters,$x5,$duration, $unit)=split(/\s+/,$prt3); |
|
47 push @$result, {'testname' => $tname, 'dura' => $duration, 'rota' => $rotation, 'smode' => $srcMode, 'dmode' => $dstMode, 'unit' => $unit}; |
|
48 } |
|
49 } |
|
50 return $result; |
|
51 } |
|
52 |