File: timecmp

package info (click to toggle)
swh-plugins 0.4.17-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,264 kB
  • sloc: ansic: 23,551; xml: 12,633; perl: 1,114; sh: 964; makefile: 218
file content (61 lines) | stat: -rwxr-xr-x 1,096 bytes parent folder | download | duplicates (2)
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
60
61
#!/usr/bin/perl -w

my $pattern = shift @ARGV;

my $reps = 4;

open(RC, "timetest.rc");
while(<RC>) {
	next if /^\s*#/;
	next if /^\s*$/;
	next if ($pattern && !/$pattern/);
	@stuff = split("\t");
	$name = $stuff[0];
	$line = $stuff[1];
	chomp $line;
	$line =~ /(\S+\.so)/;
	$command = $line." 2>&1";
	$cycles = 10000000000;
	$pers = 100000;
	my $count;
	for $count (1..$reps+1) {
		$out = `$command`;
		chomp $out;
		$out =~ /Plugin cycles: (\d+) \((\d+)\//;
		if ($1 < $cycles) {
			$cycles = $1;
		}
		if ($2 < $pers) {
			$pers = $2;
		}
	}
	$out =~ /UID: (\d+)/;
	$UID = $1;
	$acycles = $cycles;
	
	$line =~ s/(.*\.\.)/$1\/icc-so/;
#print $line."\n";
	$command = $line." 2>&1";
	$cycles = 10000000000;
	$pers = 100000;
	$ok = 1;
	for $count (1..$reps+1) {
		$out = `$command`;
		chomp $out;
		unless ($out =~ /Plugin cycles: (\d+) \((\d+)\//) {
			print("ERROR\t$name\n");
			$ok = 0;
			last;
		}
		if ($1 < $cycles) {
			$cycles = $1;
		}
		if ($2 < $pers) {
			$pers = $2;
		}
	}
	next if !$ok;
	$out =~ /UID: (\d+)/;
	$UID = $1;
	print sprintf("%.3f", ($cycles/$acycles))."\t$name\n";
}