From a1a508e749a4d45156ba0d39116532fac084be22 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 11 May 2011 14:30:54 -0300 Subject: [PATCH] tools/dirtpan/: introduced terse debug messages also for timeouts - dirtpan.c (debug_event, ack_timeout, reass_timeout): renamed debug_event to debug_timeout - dirtpan.c (debug_timeout): print a terse debug message if debug == 1 --- tools/dirtpan/dirtpan.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/dirtpan/dirtpan.c b/tools/dirtpan/dirtpan.c index 4cb3c01..f59eece 100644 --- a/tools/dirtpan/dirtpan.c +++ b/tools/dirtpan/dirtpan.c @@ -145,10 +145,14 @@ static void debug_dirt(const char *label, void *buf, int size) } -static void debug_event(const char *label) +static void debug_timeout(const char *label) { if (!debug) return; + if (debug == 1) { + fprintf(stderr, "*%c", *label); + return; + } debug_label(label); fprintf(stderr, "\n"); } @@ -347,7 +351,7 @@ static void tx_pck(void *buf, int size) static void ack_timeout(void) { - debug_event("ACK-TO"); + debug_timeout("ACK-TO"); if (++retries == MAX_TRIES) state = s_idle; else @@ -357,7 +361,7 @@ static void ack_timeout(void) static void reass_timeout(void) { - debug_event("REASS-TO"); + debug_timeout("REASS-TO"); state = s_idle; }