From owner-svn-src-all@FreeBSD.ORG Sun May 5 09:38:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A315897; Sun, 5 May 2013 09:38:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93DC17E5; Sun, 5 May 2013 09:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r459c2i7010966; Sun, 5 May 2013 09:38:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r459c2tu010965; Sun, 5 May 2013 09:38:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305050938.r459c2tu010965@svn.freebsd.org> From: Adrian Chadd Date: Sun, 5 May 2013 09:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250265 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 09:38:02 -0000 Author: adrian Date: Sun May 5 09:38:02 2013 New Revision: 250265 URL: http://svnweb.freebsd.org/changeset/base/250265 Log: This is a simple script to output the delta between each TX and TXSTATUS. Useful for debugging TDMA. Added: head/tools/tools/ath/athalq/txdiff.pl (contents, props changed) Added: head/tools/tools/ath/athalq/txdiff.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athalq/txdiff.pl Sun May 5 09:38:02 2013 (r250265) @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +use strict; + +# $FreeBSD$ + +# [1360537229.753890] [100494] TXD +# [1360537229.754292] [100494] TXSTATUS: TxDone=1, TS=0x5ccfa5c7 + +my ($tv_sec) = 0; +my ($tv_usec) = 0; + +sub tvdiff($$$$) { + my ($tv1_sec, $tv1_usec, $tv2_sec, $tv2_usec) = @_; + + if ($tv2_usec < $tv1_usec) { + $tv2_usec += 1000000; + $tv1_sec = $tv1_sec + 1; + } + + return ($tv2_sec - $tv1_sec) * 1000000 + ($tv2_usec - $tv1_usec); +} + +while (<>) { + chomp; + m/^\[(.*?)\.(.*?)\]/ || next; + printf "%d\t| %s\n", tvdiff($tv_sec, $tv_usec, $1, $2), $_; +# if (tvdiff($tv_sec, $tv_usec, $1, $2) > 500) { +# printf "%d\t| %s\n", tvdiff($tv_sec, $tv_usec, $1, $2), $_; +# } + $tv_sec = $1; + $tv_usec = $2; +} +