From cb387eacc8093db40a287188d6682538782dc1cf Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 9 Jul 2011 15:00:40 -0300 Subject: [PATCH] parse_em28xx_drxk.pl: Add parameters to suppress/see other logs By default, this parser will output just the DRX-K messages, but extra parameters allow to enable/disable other logs Signed-off-by: Mauro Carvalho Chehab --- contrib/em28xx/parse_em28xx_drxk.pl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/contrib/em28xx/parse_em28xx_drxk.pl b/contrib/em28xx/parse_em28xx_drxk.pl index 4824e63..e0ec3fc 100755 --- a/contrib/em28xx/parse_em28xx_drxk.pl +++ b/contrib/em28xx/parse_em28xx_drxk.pl @@ -30,12 +30,20 @@ # use strict; +use Getopt::Long; -my $show_em28xx = 1; -my $show_other_xfer = 1; -my $show_ac97 = 1; +my $show_em28xx = 0; +my $show_other_xfer = 0; +my $show_ac97 = 0; my $show_other_lines = 0; # Useful on some cases +GetOptions( + 'show_em28xx' => \$show_em28xx, + 'show_other_xfer' => \$show_other_xfer, + 'show_ac97' => \$show_ac97, + 'show_other_lines' => \$show_other_lines, +) or die "Invalid arguments.\nUse $0 [--show_em28xx] [--show_other_xfer] [--show_ac97] [--show_other_lines]\n"; + my %reg_map = ( "0x00" => "EM28XX_R00_CHIPCFG", "0x04" => "EM2880_R04_GPO", @@ -2170,6 +2178,7 @@ parse_error: ############## while (<>) { + my $org_line = $_; tr/A-F/a-f/; if (m/c0 00 00 00 ([0-9a-f].) 00 01 00\s+[\<]+\s+([0-9a-f].)/) { if ($1 eq "43" && $2 eq "00") { @@ -2270,5 +2279,5 @@ while (<>) { printf "i2c_master_recv(0x$1>>1, &buf, 0x$2); /* nothing returned */\n" if ($show_other_xfer); next; } - print $_ if ($show_other_lines); + print $org_line if ($show_other_lines); } -- 2.7.4