synth/arm/trace.h

52 lines
973 B
C
Raw Permalink Normal View History

2022-05-17 03:56:25 +00:00
#pragma once
#define TRACE_DUMP_WHEN_FULL 0
#ifdef __x86_64__
#include <cstdio>
#define TRACE(x) printf(#x "\n")
#else // __x86_64__
#define TRACE(...) tracing::trace(__VA_ARGS__)
#endif // __x86_64__
2022-05-17 03:56:25 +00:00
#include <cstdint>
namespace tracing {
enum class TraceEvent : uint8_t {
kUnknown = 0,
kUartIsr = 1,
kUartRxCb = 2,
kUartTxCb = 3,
kUartSend = 10,
kUartRecv = 11,
kUartTxBufferFull = 12,
kUartTxBufferNotFull = 13,
kUartWriteDone = 20,
kAsyncResume = 4,
kAsyncEnqueue = 5,
kAsyncTask = 6,
kAsyncResumeSetPending = 7,
kAsyncAwaitWasNotified = 8,
kAsyncSchedule = 9,
kAsyncTaskDone = 14,
kAsyncException = 15,
kAsyncCallParent = 16,
kAsyncCallParentDone = 17,
kAsyncCoAwait = 18,
kAsyncSuspend = 19,
kAsyncDestroy = 21,
kAsyncGimmeWaiting = 22,
kAsyncGimmeResume = 23,
2022-05-17 03:56:25 +00:00
};
void trace(TraceEvent event);
void trace(int raw_event);
void dump();
} // namespace tracing