In the second mode of operation the same information is logged and displayed but for the duration of the execution of command. Care has been taken to minimize the pollution of the log by the msglog program. Before starting command the log is cleared. The log is read at regular intervals rather than being polled continuously.
The output generated by msglog consists of a first line (given as a printf(3) format string): ``min %ld, max %ld, missed %ld (%d%%)'', followed by one or more lines of the following format: ``src -> dst: %ld'' where src and dst are displayed as either an integer or as a string when its name is known, followed by the message count. This message count is always larger than zero. The following names are known: tty, dp8390, scsi, winchester, syn_alarm, idle, printer, floppy, memory, clock, sys, hardware, mm, fs, inet. The lines are sorted on task number.
$ msglog -o /tmp/o ls -l /dev/null crw-rw-rw- 1 root kmem 1, 3 Jan 20 18:04 /dev/null $ cat /tmp/o min 15443458, max 15443903, missed 0 (0%) tty -> fs: 5 dp8390 -> inet: 1 syn_alarm -> inet: 1 memory -> fs: 2 clock -> syn_alarm: 1 clock -> mm: 2 clock -> fs: 5 clock -> inet: 3 sys -> mm: 116 sys -> fs: 30 sys -> inet: 1 mm -> clock: 2 mm -> sys: 116 mm -> fs: 17 mm -> 17: 4 mm -> 18: 13 fs -> tty: 4 fs -> memory: 2 fs -> clock: 5 fs -> sys: 30 fs -> mm: 17 fs -> inet: 1 fs -> 16: 2 fs -> 17: 4 fs -> 18: 16 inet -> dp8390: 1 inet -> clock: 3 inet -> sys: 1 inet -> fs: 1 16 -> fs: 2 17 -> mm: 4 17 -> fs: 4 18 -> mm: 14 18 -> fs: 16The second example tries to read 4096 message from the message log after the ls -l > /dev/null command. Of these 4096 message, the number of message from task -3 are shown, grouped per clock tick.
$ ls -l > /dev/null; msglog -f -3 4565906: 1 4565907: 2 4565908: 2 4566001: 2 4566002: 5 4566004: 2 4566100: 4 ...
Commands consisting of digits only should be specified with their directory expilicitly stated to distinguish them from the amount of messages read, i.e. ``./33'' instead of ``33''.