Utility Programs
There are several command-line programs that are a part of the 4N6 project.
Some of these are meant for use on the front-end (these are mostly performance
monitoring tools) , and some for use on the back-end (these are mostly
database querying tools)
Front-End Tools
.
Back-End Tools
-
client_session.sh - Initializes the database and runs the network
client. When the server closes the connection, it runs the post-processing
scripts.
-
list_all_dups.sh pid filename time - Gives you a list of all
file descriptors pointing to filename at time time.
-
get_active.sh start end - Gives you a list of all pid's that
did anything between start and end.
-
did_proc_write.sh pid filename start end - Prints "1" if pid
wrote to filename between start and end, prints 0
otherwise. I would have just made it return 1 and 0 (which it also
does), but I don't know how to check the returncode from a function in a
bash script yet. Wu-chang will probably berate me for this.
-
get_writers.sh file start end - Get a list of all pid's
that wrote to file between start and end. Currently,
the way this operates is very inefficient. It's just for demo purposes.
Rewriting this is on my TODO list.
-
get_io.sh pid - Takes a pid and outputs all of the writes that went to
that pid's stdout, stdin and stderr. The format of the returned data is
"[date]-tab-[count]-tab-[data]". The data is in binary-escaped format (i..e,
you don't see a newline, you see "\n"). The data is not necessarily
sorted by date.
- get_io pid rollcount - Takes a pid and a rollcount, and does what get_io.sh
does. However, it does it much more efficiently, and it also takes into account the
fcntl syscall. Does not handle dups that are interleaved between processes created
with clone. But other than that it's pretty good.
-
replay_shell [-f filename] [-r] [pid] - Replays a shell session. Or, in
fact, this will replay the output written to stdout and stderr by any
process. Parameters:
- -f filename: a file in the format generated by get_io.sh.
- -r: If present, this specifies that the session is to be replayed
in realtime (default is to play as fast as possible).
- pid Specifies a pid in the database. You do not need to
specify a pid if you specify a filename. Note that retrieving the
data from the database can be time-consuming. It is a better idea to use
get_io.sh to retrieve the data and store it in a file, and then use
replay_shell to simply access that file.
Currently, this program is a bit buggy. It won't handle sessions larger
than 32k in length. I'll fix that soon.
Binary
Source
Mike Shea
Last modified: Mon Mar 31 19:12:14 PST 2003