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

Re: trace enque only ?



On Mon, 18 Oct 1999, Frank Chu wrote:
 
> Thanks.  But unless I change trace.cc to output all
> those what I want, I will have to do post processing
> which consumes a lot of time and diskspace (because
> all the trace has to be output).
> 
> Changing trace.cc's output format will make some of my
> previous postprocessing programs unable to get what I
> want :(

Hello Frank,

If you need *only* enque events you are probably best off modifying
trace.cc to output only those events (still not changing the output
format of the remaining lines).

If you have links for which you want all events and others where you
only need the enque events you might want to consider writing a
modified version of
   SimpleLink instproc trace  (~ns/tcl/lib/ns-link.tcl),
maybe
   SimpleLink instproc trace-enque
which insert only a Trace/Enque object into the topology.

Then you also need in new 
   Simulator instproc trace-queue  (~ns/tcl/lib/ns-lib.tcl),
maybe
   Simulator instproc trace-queue-enque
which calls your new trace-enque method of a SimpleLink.


You could then go like:

set traceFile [open enque.tr w]
$ns trace-queue-enque $node1 $node2 $traceFile 


I haven't tried this but as far as I understand the subject, it should
work.

I hope this helps,
chris


 -----------------------------------------------------------------
  Christof Brandauer                        [email protected]
  Student of Applied Informatics                 
  Department of Computer Science, University of Salzburg, Austria
 ----------------------------------------------------------------- 

> 
> Anyway, it seems this is already the best we can do. 
> Thanks.
> 
> --- Lloyd Wood <[email protected]> wrote:
> > > The question is how to trace the Enque packets
> > > only, but still didn't find a way work.
> > > 
> > >  set traceobj [$ ns create-trace Enque $f $node1
> > > $node2]
> > >  $traceobj flush  
> > >  $ns flush-trace
> > > 
> > > It just didn't work.  What I am trying to do is to
> > let
> > > the trace file $f contains only the packets when
> > they
> > > are enqued.  However, no file was output.
> > 
> > Generating a tracefile the normal way, then:
> > 
> > grep '+ ' out.tr >enque.tr 
> >        ^ note the space.
> > 
> > works for me. Or you could hack trace.cc around. Or
> > you could
> > postprocess the tracefile with awk and only do stuff
> > if $1
> > was equal to '+'. Lots of ways to skin this
> > particular cat.
> > 
> > 
> > > I tried many other methods and read many times the
> > NS
> > > doc's chapter on trace and felt desperate. 
> > 
> > Don't worry, that much is perfectly normal. Been
> > there, done that.
> > 
> > cheers,
> > 
> > L.
> > 
> > > I wonder
> > > if I missed anything because I am just trying to
> > do a
> > > very simple thing.  Very much appreciate if anyone
> > > can help.
> > > 
> > > Frank
> > 
> >
> <[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>
> > 
> > 
> 
> 
> =====
> 
> __________________________________________________
> Do You Yahoo!?
> Bid and sell for free at http://auctions.yahoo.com
>