[Skiboot] [PATCH 02/10] external/trace: Print timestamps in prlog()'s format
Oliver O'Halloran
oohall at gmail.com
Mon Oct 12 13:53:06 AEDT 2020
Make the trace tool's output format match that of skiboot's prlog().
Printing a timebase tick count in hex isn't terribly useful and having
a common format makes correlating trace entries to log entries much
easier.
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
external/trace/dump_trace.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/external/trace/dump_trace.c b/external/trace/dump_trace.c
index 5a832c791fb6..c68eea894715 100644
--- a/external/trace/dump_trace.c
+++ b/external/trace/dump_trace.c
@@ -45,13 +45,18 @@ static void *ezalloc(size_t size)
return p;
}
+#define TB_HZ 512000000ul
+
static void display_header(const struct trace_hdr *h)
{
static u64 prev_ts;
u64 ts = be64_to_cpu(h->timestamp);
- printf("%16lx (+%8lx) [%03x] : ",
- ts, prev_ts ? (ts - prev_ts) : 0, be16_to_cpu(h->cpu));
+ printf("[%5lu.%09lu,%d] (+%8lx) [%03x] : ",
+ ts / TB_HZ, /* match the usual skiboot log header */
+ ts % TB_HZ,
+ h->type, /* hey why not */
+ prev_ts ? (ts - prev_ts) % TB_HZ : 0, be16_to_cpu(h->cpu));
prev_ts = ts;
}
--
2.26.2
More information about the Skiboot
mailing list