Close a file descriptor through the MIO library.
Modular I/O library (libmio.a)
#include <libmio.h>
int MIO_close (FileDescriptor)
int FileDescriptor;
This subroutine is an entry point of the MIO library. Use this subroutine to instrument your application with the MIO library. You can replace the close kernel I/O subroutine with this equivalent MIO subroutine. See the Modular I/O in AIX® Version 7.1 Performance management for the MIO library implementation.
Use this subroutine to close a file with the FileDescriptor parameter through the Modular I/O (MIO) library. The FileDescriptor parameter results from the MIO_open64 subroutine.
The parameters are those of the corresponding standard POSIX system call close.
The return values are those of the corresponding standard POSIX system call close.
The error codes are those of the corresponding standard POSIX system call close.
MIO library outputs are flushed on the MIO_close subroutine call in the stats file.
The diagnostic file name is defined in the MIO_STATS environment variable if the stats option is set to the default value of mioout.
Standard output includes the following information:
name of the subroutine
count of calling of this subroutine
time of processing for this subroutine
requested (requested size to read or write) total (real size read or write: returned by AIX(r) system call) min (minimum size to read or write) max (maximum size to read or write)
the average seek delta (total seek delta/seek count)
count, time and rate of transfer time including suspend, and read or write time
The following is an example of a trace diagnostic:
Trace oncloseor intermediate:
previous module or calling program<->next module:file name:
(total transferred bytes/total time)=rate
demand rate=rate/s=total transferred bytes/(close time-open time)
current size=actual size of the filemax_size=max size of the file
mode=file open mode
FileSystemType=file system type given by fststat(stat_b.f_vfstype)
sector size=Minimum direct i/o transfer size
oflags=file open flags
open open count open time
fcntl fcntl count fcntl time
read read count read time requested size total size minimum maximum
aread aread count aread time requested size total size minimum maximum
suspend count time rate
write write count write time requested size total size minimum maximum
seek seek count seek time average seek delta
size
page fcntl page_info count
The following is a sample of a trace diagnostic:
MIO statistics file : Tue May 10 14:14:08 2005
hostname=host1 : with Legacy aio available
Program=example
MIO library libmio.a 3.0.0.60 AIX(r) 5.1 32 bit addressing built
Apr 19 2005 15:08:17
MIO_INSTALL_PATH=
MIO_STATS =example.stats
MIO_DEBUG =OPEN
MIO_FILES = *.dat [ trace/stats ]
MIO_DEFAULTS = trace/kbytes
MIO_DEBUG OPEN =T
Opening file file.dat
modules[11]=trace/stats
============================================================================
Trace close : program <-> aix : file.dat : (4800/0.04)=111538.02 kbytes/s
demand rate=42280.91 kbytes/s=4800/(0.12-0.01))
current size=0 max_size=1600
mode =0640 FileSystemType=JFS sector size=4096
oflags =0x302=RDWR CREAT TRUNC
open 1 0.00
write 100 0.02 1600 1600 16384 16384
read 200 0.02 3200 3200 16384 16384
seek 101 0.01 average seek delta=-48503
fcntl 1 0.00
trunc 1 0.01
close 1 0.00
size 100
============================================================================
The following is a template of the pf module diagnostic:
pf close for<name of the file in the cache>
pf close for global or private cache <global cache number>
<nb_pg_compute>page of<page-size> <sector_size> bytes per sector
<nb_real_pg_not_pf>/<nb_pg_not_pf> pages not preread for write
<nb_unused_pf>unused prefetches out of<nb_start_pf>
prefetch=<nb_pg_to_pf>
<number> of write behind
<number> of page syncs forced by ill formed writes
<number> of pages retained over close
<unit> transferred / Number of requests
program --> <bytes written into the cache by parent>/
<number of write from parent>--> pf -->
<written out of the cache from the child>/<number of partial page written>
program --> <bytes read out of the cache by parent>/
<number of read from parent><– pf <–
<bytes read in from child of the cache>/<number of page read from child>
The following is a sample of the pf module diagnostic:
pf close for /home/user1/pthread/258/SM20182_0.SCR300
50 pages of 2097152 bytes 131072 bytes per sector
133/133 pages not preread for write
23 unused prefetches out of 242 : prefetch=2
95 write behinds
mbytes transferred / Number of requests
program --> 257/257 --> pf --> 257/131 --> aix
program <-- 269/269 <-- pf <-- 265/133 <-- aix
The following is the recov module output:
The following is a sample of the recov module:
15:30:00
recov : command=ls -l file=file.dat errno=28 try=0
recov : failure : new_ret=-1
/usr/lib/libmio.a