File: new2oldctx

package info (click to toggle)
lmbench 3.0-a9%2Bdebian.1-6
  • links: PTS
  • area: non-free
  • in suites: bookworm
  • size: 2,996 kB
  • sloc: ansic: 12,328; perl: 6,531; sh: 2,784; makefile: 731
file content (31 lines) | stat: -rwxr-xr-x 565 bytes parent folder | download | duplicates (5)
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

# Convert the new format:
# Context switch of 8 4k processes: 64.17 (60.02 overhead)
# to the old format:
#"size=0 ovr=22
# 2 8
# 4 14
# 8 18
# 16 21
# 20 22

eval 'exec perl -Ssw $0 "$@"'
	if 0;

@lines = grep(/Context switch/, <>);
foreach $size ("0k", "4k", "16k", "32k", "64k") {
	@data = grep(/$size/, @lines);
	@a = @b = @c = ();
	$i = 0;
	foreach $n (2, 4, 8, 16, 20) {
		@tmp = ();
		foreach $_ (grep(/of $n/, @data)) {
			@_ = split;
			push(@tmp, "$_[3] $_[6]\n");
		}
		($a[$i],$b[$i],$c[$i]) = @tmp;
		$i++;
	}
	print "\n\"size=$size \n";
	print @c;
}