umount: getopt return value is int, not char
[minix.git] / commands / profile / tools / profextr.pl
blobb81f0da381ac9f1bbb460ad8102afe14a70798bc
1 #!/usr/local/bin/perl
3 $SAMPLE_SZ = 12;
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 ($exe, $pc) = unpack("A8i", $buf);
15 # System and clock task are in kernel image.
16 # $exe =~ s/^system/kernel/;
17 # $exe =~ s/^clock/kernel/;
19 # Memory has p_name "mem" in kernel.
20 # $exe =~ s/^mem/memory/;
22 $pcs{$pc}++ if ($exe eq "fs");
25 foreach $pc (sort { $a <=> $b } keys %pcs) {
26 print "$pc $pcs{$pc}\n";