umount: getopt return value is int, not char
[minix.git] / commands / profile / tools / proftsc.pl
blobd4d1afaa5f5fc2634855de48973bbee3e8112e98
1 #!/usr/local/bin/perl
3 $SAMPLE_SZ = 8;
5 $file = shift;
7 open (FILE, $file) or die ("Unable to open $file: $!");
9 $_ = <FILE>;
11 until (eof(FILE)) {
12 read(FILE, $buf, $SAMPLE_SZ) == $SAMPLE_SZ or die ("Short read.");
13 ($high, $low) = unpack("II", $buf);
15 if ($high - $prevhigh == 0) {
16 push (@res, $low - $prevlow);
19 $prevhigh = $high;
20 $prevlow = $low;
22 #print "$high $low\n";
24 # $pcs{$pc}++ if ($exe eq "kernel");
27 foreach $diff (sort { $a <=> $b } @res) {
28 print $diff."\n";
31 #foreach $pc (sort { $a <=> $b } keys %pcs) {
32 # print "$pc $pcs{$pc}\n";