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

Re: [ns] compressed trace



yes you can, in your script : 
set trace [open " | gzip > trace.gz" w] 

and then:

$ns trace-all $trace. 

You can do the same thing with awk too, so you could filter what you want to be 
written to the tracefile. Say you only want the "r" events to be recorded, for 
example, you would have a script (call it script.awk) that
says : 

{
	if ($2 == "r") print $0
}

and you would put in your simulation script : 

set trace [open "| awk -f script.awk > filteredtrace.tr" w]
$ns trace-all $trace

Depending on how complex your script might be it can slow down the simulation 
time pretty badly, you've been warned. 

 
> Hi,
> I have very large traces for my simulation, does anyone know if I can
> buils gzip traces on the fly?
> 
> Thanks!
> 
> Regards,
>     Ezio Ricca
>         Politecnico di Torino (Italy )
> 

Tarik