Repository navigation
debugability: logging: Redesign tracing mechanism to enable proper logging - #390
Conversation
981feec to
4d362f8
Compare
There was a problem hiding this comment.
This struct should be defined outside the macro.
There was a problem hiding this comment.
Every occurrence of trace_event macro defines new anonymous type, that is then linked to separate section of ELF, and, for this purpose, needs to be part of a macro, AFAIK.
There was a problem hiding this comment.
ok, now I see - each structure is anon variable size and placed by the linker in a memory region. Probably best to comment this above the macro. Btw, it looks like the structure can be better aligned and compressed. There are some variables that could be uint16_t and all int32_t types should be aligned on 32bits (one is placed after a variable size char array).
There was a problem hiding this comment.
Since these are never actually processed/loaded by the DSP, and are only read by external tools, I believe that we should optimize for ease of processing, rather than squeeze every bit possible.
There was a problem hiding this comment.
This will cause a memory barrier for every read/write of dst. Probably better if we invalidate and writeback manually after copy?
There was a problem hiding this comment.
whee does 2 come from ? should it be a sizeof or macro ?
There was a problem hiding this comment.
Each log_entry_header is followed by address of log_entry and then by up to 3 parameters, all as payload.
Call to this function is a result of macro expansion with 1 parameter (as function name should suggest), which brings payload size to 2 dwords.
Same pattern applies to all flavours of _trace_event function.
We could pass this value to the function, as it's actually calculated earlier, as part of macro expansion, to determine which variant of the function to call, or create a macro to determine size of buffer in a function-like fashion.
There was a problem hiding this comment.
I've created a macro to cover appearance of magic numbers and attached a comment that should make it easier to wrap head around.
There was a problem hiding this comment.
We have to be careful as not all DSP architecture can allocate dynamically on the stack. It also seems like there is a lot of duplication in these function amd we could reuse if we passed or detected number of args.
d72dec3 to
592b68f
Compare
…gging. Declare log_entry structures that are linked to .static_log_entries section of ELF. trace_event macros extended to accept additional arguments and unconfined number of characters. Signed-off-by: ArturX Kloniecki <[email protected]>
592b68f to
25d2bdf
Compare
Declare log_entry structures that are linked to .static_log_entries
section of ELF.
trace_event macros extended to accept additional parameters and unconfined
number of characters.
Signed-off-by: ArturX Kloniecki [email protected]