10 if (!getopts('abi:su', \%opt) || !$ARGV[0]) {
11 die "Usage: $0 [-a] [-b] [-s] [-u] [-i type1,type2,...] logfile\n"
12 . "-a ... print all packet types, not only default types\n"
13 . "-b ... print also bad bytes (wrong CRC, non-packets, etc.)\n"
14 . "-i ... also ignore packets of given types\n"
15 . "-s ... print also strange packets\n"
16 . "-u ... print unique packets only (filter out duplicates)\n";
19 my $logfile = shift @ARGV;
21 my $reader = SCX::LogReader->new({
27 $args{dump_bad_bytes} = 1 if $opt{b};
28 $args{dump_strange} = 1 if $opt{s};
29 $args{uniq_only} = 1 if $opt{u};
31 my %default_skip_types = map { $_ => 1 } qw(bus_free_time controller);
32 my %skip_types = ($opt{a} ? () : %default_skip_types);
35 %skip_types = (%skip_types, map { $_ => 1 } split(/,/, $opt{i}));
38 $args{skip_types} = \%skip_types;
40 my $printer = SCX::LogPrinter->new(\%args);
42 while (my ($l_time, @data) = $reader->get_data()) {
43 $printer->add_data($l_time, @data);