Browse Prior Art Database

Technique for Following Wrap-Around Trace File in AIX

IP.com Disclosure Number: IPCOM000116959D
Original Publication Date: 1995-Dec-01
Included in the Prior Art Database: 2005-Mar-31
Document File: 2 page(s) / 70K

Publishing Venue

IBM

Related People

Shue, DY: AUTHOR

Abstract

Applications can generate trace files that record what they are doing. To save disk space these files should wrap around to the beginning when they reach a certain size; otherwise, they will continue to grow in size. It is common for users who wish to look at a trace file to use a browser or editor to view it. This presents a problem because the image of the trace file is frozen and is not updated; meanwhile the application continues to run and generate trace entries that may be important to see. If the file is small enough, it may be overwritten several times before it can be refreshed by the user through the editor or browser. There is a UNIX* "tail" command which allows a user to see appendations to a file in quasi-realtime, but this does not "follow" a wrap-around.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Technique for Following Wrap-Around Trace File in AIX

      Applications can generate trace files that record what they
are doing.  To save disk space these files should wrap around to the
beginning when they reach a certain size; otherwise, they will
continue to grow in size.  It is common for users who wish to look at
a trace file to use a browser or editor to view it.  This presents a
problem because the image of the trace file is frozen and is not
updated; meanwhile the application continues to run and generate
trace entries that may be important to see.  If the file is small
enough, it may be overwritten several times before it can be
refreshed by the user through the editor or browser.  There is a
UNIX* "tail" command which allows a user to see appendations to a
file in quasi-realtime, but this does not "follow" a wrap-around.

      Various processes can call a central routine that is serialized
via a semaphore.  Trace file entries are written by this central
routine to the disk file until the wrap-around point.  These same
entries are simultaneously written through a pipe to a "trace mirror"
process that has established a read to that pipe.

      When the "trace mirror" process starts up it creates a number
of dummy files and a matching number of FIFOs (named pipes) to which
it will attempt to write output it has read from the pipe connected
to the central trace routine, i.e., the central trace routine pipes
its output to the "trace mirror", which in turn disperses it to
readers connected to its FIFOs.

      The "trace mirror" process attempts to write every line read
through the pipe from the central trace routine to each of the FIFOs.
The write routine attempts an "open" of each FIFO.  The results of
the open call are stored in an array element, of which there is one
per FIFO.  If the open fails, the write is skipped.  The open can
fail with a specific e...