svn commit: r250265 - head/tools/tools/ath/athalq
Adrian Chadd
adrian at FreeBSD.org
Sun May 5 09:38:02 UTC 2013
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;
+}
+
More information about the svn-src-head
mailing list