Plan 9 from Bell Labs’s /usr/web/sources/contrib/axel/leak/perlbased/blocksum

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/perl

# for each location in column 4 sum the amount of column 3

#  block 0x000af9a8 0x00000040 0x0001ddf3 0x00000000
#  block 0x000afd88 0x00000040 0x0001ddf3 0x00000000

while(<>) {
	chomp();
	@f = split();
	$v= hex($f[2]);
	$tot{$f[3]} += $v;
	$count{$f[3]} ++;
}
foreach $k (keys %tot) {
	print "src($k);\t// $tot{$k}\t$count{$k}\n";
	$sum += $tot{$k};
}
print "// $sum\n";

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.