From 3eeceee332e1fa319794c8c59cf5bc11ff51bf05 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 18 Jun 2005 23:06:26 +0000 Subject: [PATCH] hcidump: Show human readable timestamps only in verbose decoding mode --- tools/parser/parser.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/parser/parser.h b/tools/parser/parser.h index 193c9f2f1..d807a94a7 100644 --- a/tools/parser/parser.h +++ b/tools/parser/parser.h @@ -114,13 +114,15 @@ static inline void p_indent(int level, struct frame *f) if (!parser.state) { if (parser.flags & DUMP_TSTAMP) { - struct tm tm; - time_t t = f->ts.tv_sec; - localtime_r(&t, &tm); - printf("%04d-%02d-%02d %02d:%02d:%02d.%06lu ", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, f->ts.tv_usec); - //printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec); + if (parser.flags & DUMP_VERBOSE) { + struct tm tm; + time_t t = f->ts.tv_sec; + localtime_r(&t, &tm); + printf("%04d-%02d-%02d %02d:%02d:%02d.%06lu ", + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, f->ts.tv_usec); + } else + printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec); } printf("%c ", (f->in ? '>' : '<')); parser.state = 1; -- 2.47.3