diff --git a/docs/Diagnostics.md b/docs/Diagnostics.md index 41e8fcf..d446647 100644 --- a/docs/Diagnostics.md +++ b/docs/Diagnostics.md @@ -1,4 +1,22 @@ +## Logs + +To enable various logs, modify the defines in m3_config.h + +```C +# define d_m3LogParse 0 // .wasm binary decoding info +# define d_m3LogModule 0 // Wasm module info +# define d_m3LogCompile 0 // wasm -> metacode generation phase +# define d_m3LogWasmStack 0 // dump the wasm stack when pushed or popped +# define d_m3LogEmit 0 // metacode-generation info +# define d_m3LogCodePages 0 // dump metacode pages when released +# define d_m3LogExec 0 // low-level interpreter specific logs +# define d_m3LogRuntime 0 // higher-level runtime information +# define d_m3LogStackTrace 0 // dump the call stack when traps occur +# define d_m3LogNativeStack 0 // track the memory usage of the C-stack +``` + + ## Operation Profiling To profile the interpreter's operations enable `d_m3EnableOpProfiling` in `m3_config.h` @@ -38,3 +56,4 @@ their instance counts will be printed to stderr. 1 op_u32_Xor_ss 1 op_i64_Subtract_ss ``` +