aboutsummaryrefslogtreecommitdiffstats
path: root/trace.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-31 01:18:27 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-31 01:18:27 -0700
commit3f799848f5c0e164510674de8359f332e333ea03 (patch)
treefa875391bc634a713e440cc760d63880454a092a /trace.h
parentb10863e186c700a204fb7b712595072ea2a215d2 (diff)
downloadabc80sim-3f799848f5c0e164510674de8359f332e333ea03.tar.gz
abc80sim-3f799848f5c0e164510674de8359f332e333ea03.tar.xz
abc80sim-3f799848f5c0e164510674de8359f332e333ea03.zip
trace: add trace data dumping facility
Diffstat (limited to 'trace.h')
-rw-r--r--trace.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/trace.h b/trace.h
index 2685697..b25c0a0 100644
--- a/trace.h
+++ b/trace.h
@@ -22,4 +22,14 @@ static inline bool tracing(enum tracing flags)
return unlikely(traceflags & flags);
}
+extern void
+trace_dump_data(const char *prefix, const void *data, unsigned int l);
+
+static inline void
+trace_dump(enum tracing flags, const char *prefix, const void *data, size_t l)
+{
+ if (tracing(flags))
+ trace_dump_data(prefix, data, l);
+}
+
#endif /* TRACE_H */