This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: parse_usb.pl: fix handling of ./parse_tcpdump_log.pl logs
Author:  Mauro Carvalho Chehab <m.che...@samsung.com>
Date:    Fri Jul 25 11:17:13 2014 -0300

The regex were not parsing right those logs. Fix it, and add
the timestamps to the dumps.

Signed-off-by: Mauro Carvalho Chehab <m.che...@samsung.com>

 contrib/usb_parse/parse_usb.pl |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=3ab2d8c43c37205de92f84e865a46eadb9f0cf44

diff --git a/contrib/usb_parse/parse_usb.pl b/contrib/usb_parse/parse_usb.pl
index 5af6408..3d88943 100755
--- a/contrib/usb_parse/parse_usb.pl
+++ b/contrib/usb_parse/parse_usb.pl
@@ -61,16 +61,19 @@ sub type_req($)
 }
 
 while (<>) {
-       tr/A-F/a-f/;
-       if (m/([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) 
([0-9a-f].) ([0-9a-f].) ([0-9a-f].)[\<\>\s]+(.*)/) {
-               my $reqtype = hex($1);
-               my $req = hex($2);
-               my $wvalue = hex("$4$3");
-               my $windex = hex("$6$5");
-               my $wlen = hex("$8$7");
-               my $payload = $9;
+       if (m/(.*)([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) 
([0-9a-f].) ([0-9a-f].) ([0-9a-f].)[\<\>\s]+(.*)/) {
+               my $timestamp = $1;
+               my $reqtype = hex($2);
+               my $req = hex($3);
+               my $wvalue = hex("$5$4");
+               my $windex = hex("$7$6");
+               my $wlen = hex("$9$8");
+               my $payload = $10;
 
-               printf("%s, Req %3d, wValue: 0x%04x, wIndex 0x%04x, wlen %d: 
%s\n",
-                       type_req($reqtype), $req, $wvalue, $windex, $wlen, 
$payload);
+               $timestamp =~ s/^\s+//;
+               $timestamp =~ s/\s+$//;
+
+               printf("%s %s(0x%02x), Req 0x%02x, wValue: 0x%04x, wIndex 
0x%04x, wlen %d: %s\n",
+                       $timestamp, type_req($reqtype), $reqtype, $req, 
$wvalue, $windex, $wlen, $payload);
        }
 }

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to