hdf5/bin/iostats
Robb Matzke cc2184b6ef [svn-r1240] Changes since 19990427
----------------------

./tools/h5ls.c
	Added a `--address' (`-a') switch which causes h5ls to display
	file addresses for raw data. For contiguous datasets it's just
	a nice simple number, but for chunked datasets it's a list of
	logical dataset coordinates, file addresses, filter masks, and
	storage sizes.

	Changed `--dump' switch to `--data'.

./src/H5D.c
./src/H5F.c
./src/H5Fprivate.h
	Enhanced the indexed-storage B-tree iterator so it can dump
	raw data addresses (and other info) to the standard error
	stream.

	Added H5Ddebug() so h5ls has a way to dump addresses for
	datasets. I'm not sure what else this API function should do,
	so I think we should discuss it before we document it. So far,
	h5ls is the only thing that uses it, and we can easily change
	that.

./src/H5Tconv.c
./test/dtypes.c
	Finally had a chance to verify Paul's H5T_conv_s_s (general
	string to string conversions) bug fixes and incorporate them
	into H5T_conv_f_f (general floating-point to floating-point
	conversions) and H5T_conv_i_i (general integer to integer
	conversons). Thanks Paul.

./src/H5D.c
./src/H5S.c
./src/H5Sprivate.h
	Added performance timers around data space read and write
	callbacks. They were already there for the gather/scatter
	callbacks.

	The timings for read/write callbacks are displayed along with
	gather/scatter when data space debugging is turned on.

./bin/iostats
	Updated to print totals. Added a `--fast' option that doesn't
	do any output except the totals and is much faster.

./bin/trace
	Changed __unused__ to UNUSED to match source code.

./config/gnu-flags
	Updated error message for pgcc. I've sent bug reports to the
	pgcc people but the new version still has the same bug.

./configure.in
./config/conclude.in
./config/depend.in
	Fixed dependencies for non-GNU makes when run in a directory
	other than the hdf5 source tree.

	Updated GNU `make dep' rules to copy the distributed
	dependencies for non-GNU makes into the source tree when run
	in some other directory.
1999-04-30 10:54:52 -05:00

84 lines
2.3 KiB
Perl
Executable File

#!/usr/bin/perl
# Usage: pipe the output of Linux's `strace' program into the stdin of
# this command, and the output of this command into gnuplot.
my ($fast,$npasses);
if ($ARGV[0] =~ /^--?fast$/) {
$fast = 1;
shift;
}
my $filename = shift || "tstab2.h5";
my $total = 0;
my %What; # What{pos}{nbytes}{r|w} = naccesses
my($total_writes, $total_bytes_out, $total_reads, $total_bytes_in);
while (<>) {
if (!defined $fd) {
if (/^open\("(.*?)".*=\s+(\d+)/ && $1 eq $filename) {
$fd = $2;
$pos = 0;
}
} elsif (/^close\((\d+)/ && $1==$fd) {
$fd = undef;
} elsif (!$fast &&
/^lseek\((\d+), -?\d+,.*= (\d+)/ &&
$1==$fd && $2>=0) {
$pos = $2;
} elsif (!$fast && /^lseek\((\d+),/ && $1==$fd) {
die $_;
} elsif (/^write\((\d+), ".*?"(\.\.\.)?, \d+\)\s*= (\d+)/ &&
$1==$fd && $3>=0) {
my $nbytes = $3;
if ($fast) {
$total_writes++;
$total_bytes_out += $nbytes;
} else {
$What{$pos}{$nbytes}{w}++;
printf "%d %d\n", $total, $pos;
$pos += $nbytes;
$total += $nbytes;
}
} elsif (/^write\((\d+),/ && $1==$fd) {
die $_;
} elsif (/^read\((\d+), ".*?"(\.\.\.)?, \d+\)\s*= (\d+)/ &&
$1==$fd && $3>=0) {
my $nbytes = $3;
if ($fast) {
$total_reads++;
$total_bytes_in += $nbytes;
} else {
$What{$pos}{$nbytes}{r}++;
printf "%d %d\n", $total, $pos;
$pos += $nbytes;
$total += $nbytes;
}
} elsif (/^read\((\d+),/ && $1==$fd) {
die $_;
}
}
if (!$fast) {
print "="x36, "\n";
printf "%8s %8s %8s %8s\n","Position","NBytes","NReads","NWrites";
for $pos (sort {$a<=>$b} keys %What) {
for $nbytes (sort {$a<=>$b} keys %{$What{$pos}}) {
printf("%8d %8d %8d %8d\n", $pos, $nbytes,
$What{$pos}{$nbytes}{r},
$What{$pos}{$nbytes}{w});
$total_writes += $What{$pos}{$nbytes}{w};
$total_reads += $What{$pos}{$nbytes}{r};
$total_bytes_out += $What{$pos}{$nbytes}{w} * $nbytes;
$total_bytes_in += $What{$pos}{$nbytes}{r} * $nbytes;
}
}
}
print "="x36, "\n";
printf("Write: %8d calls, %10d total bytes, %10g average bytes\n",
$total_writes, $total_bytes_out, $total_bytes_out/$total_writes);
printf("Read: %8d calls, %10d total bytes, %10g average bytes\n",
$total_reads, $total_bytes_in, $total_bytes_in/$total_reads);