#!/usr/bin/perl $urbrequest=0; use Switch; $enabled=1; $setuppacket=0; $urbrequest="000001"; $selectinterface=0; $enabledisoc=1; $direction=0; $dir_out = 0; $bulk = 0; $dir_in = 1; my %urbhash=(); while (<>){ # <<< URB 1 coming back <<< # [42 ms] >>> URB 2 going down >>> if(/>>>/){ if(/\[(\d{1,}) ms\] >>> URB (\d{1,})/){ $urbrequest=sprintf("%06d",$2); $timing=$1; } $enabled=1; $bulk=0; $setuppacket=0; $selectinterface=0; $direction=$dir_out } if(/<<>> "; } else { print "<<< "; } foreach $inkey (@{$urbhash{$indexkey}{'in'}}){ print " $inkey"; } print "\n"; } else { print "$indexkey: "; if($urbhash{$indexkey}{'remark'}[0] ne ""){ print $urbhash{$indexkey}{'remark'}[0]; next; } print "OUT: "; printf("%06d ms %06d ms ",$urbhash{sprintf("%06d",($indexkey+1))}{'timing'}-$urbhash{$indexkey}{'timing'},$urbhash{$indexkey}{'timing'}); if($#{$urbhash{$indexkey}{'out'}} >= 0){ printf("BULK[%05d] >>> ",$urbhash{$indexkey}{'endpoint'}); } else { printf("BULK[%05d] <<< ",$urbhash{$indexkey}{'endpoint'}); } foreach $outkey (@{$urbhash{$indexkey}{'out'}}){ print "$outkey "; } foreach $inkey (@{$urbhash{$indexkey}{'in'}}){ print "$inkey "; } print "\n"; } } }