next up previous contents
Next: Graphical output Up: Simulation output Previous: Pretty-printing traces   Contents

Output filtering

Enqueue and dequeue records can be selected in trace output with the tcsim_filter script.

Usage:

tcsim_filter $[$-c$]$ $[$-s time $\ldots]$ $[$-e$\vert$-d$]$ $[$selector $\ldots]$ $[$output $\ldots]$ $[$file $...]$

-c
Count the results instead of printing data points on standard output.
-s time
Write counter snapshot to standard output at the specified time (in seconds). This option can be repeated any number of times. If tcsim_filter output is piped to tcsim_plot (see section 6.6.4), the latter will propagate snapshots to its standard output.
-e
Only consider enqueue events (default: enqueue and dequeue)
-d
Only consider dequeue events
selector
Expression of the type field=value. Only records where the field has the specified value will be shown or counted.
output
Include the value of the specified field in the output.
file
Read from the specified file. Default: read from standard input.

The following fields are recognized:

tos TOS byte
len Total length field
src Source IP address
dst Destination IP address
sport Source port (TCP or UDP)
dport Destination port (TCP or UDP)
dev Device name (e.g. eth0)

Selected records are condensed into an identification string that begins with the event type (E or D), followed by the hexadecimal values of all output fields, separated by colons.

When counting, the records with the same ID string are counted. When printing records, each line contains the time, the ID string, the packet length in bytes, and the skb address (or, if using -g, the generation number), separated by spaces.

Examples:

tcsim examples/dsmark+policing | tcsim_filter -c tos
D:00 201
D:b8 139
E:00 201
E:01 201

tcsim examples/dsmark+policing | tcsim_filter -c tos=0xb8
D 141

tcsim examples/dsmark+policing | tcsim_filter src | sed 4q
0.000000 E:0a000001 1000 0x80b7888
0.000000 D:0a000001 1000 0x80b7888
0.000000 E:0a000001 1000 0x80ba060
0.000800 D:0a000001 1000 0x80ba060


next up previous contents
Next: Graphical output Up: Simulation output Previous: Pretty-printing traces   Contents
Martin A. Brown 2003-11-06