1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

This is a simple script to output the delta between each TX and TXSTATUS.

Useful for debugging TDMA.
This commit is contained in:
Adrian Chadd 2013-05-05 09:38:02 +00:00
parent 77f8606428
commit 443db1d0c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250265

View File

@ -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;
}