[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] callback tracing parameters of TCP agent? (fwd)



> a TCP connection. How can I trace every change of them on-fly as
> the 'trace-callback' feature on a SimpleLink?
> 
> Can we use the Agent::trace() in agent.cc to do this?

That method is used to keep track of value changes of bound variables. If
it's turned on whenevr the value is changed a line is written to nam trace
file, if any. See tcl/ex/nam-example.tcl (probably this name, or grep
trace) for an example.

> For a Link, it has a 'handle' function to deal with enq/deq/drop events,
> callback can be actived by these events. But for a parameter of a TCP
> agent, its change doesn't generate events. 

The mechanism to implement the handle and variable tracing are completely
different. To implement this handle for traced variables could be much
more expensive, but if you really want it you can add it yourself, e.g.,
add an evalf() in Agent::trace().

- Haobo