Repository navigation
trace: verify argument size - #3393
Conversation
This functionality counldn't handle empty __VA_ARGS__. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
SOF tracing can only handle up to 32-bit long values, attempts to trace 64-bit values produce unpredictable results. Fix such cases by making sure values are within range and casting them to 32 bits. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
d310cfa to
50e239f
Compare
50e239f to
7608f24
Compare
7608f24 to
f26aa46
Compare
lyakh
left a comment
There was a problem hiding this comment.
comments are optional. Thanks for the improvements!
There was a problem hiding this comment.
I guess we could then remove _META_REQRS_1024()..._META_REQRS_16() but that doesn't have to go with this PR. Looks like _META_DEFER_N() and META_DEFER() are unused too , maybe some other "magic" macros too.
There was a problem hiding this comment.
I guess we could then remove _META_REQRS_1024()..._META_REQRS_16() but that doesn't have to go with this PR.
I add it to commit with META_RECURSE depth reduction, because it's a point from which those are unused.
Trace system support arguments no larger that uint32_t, so this condition should be checked for each trace. Create separate CT_ASSERT, because of need to have multiple instances of assertions with the same error message, what is not possible for STATIC_ASSERT. STATIC_ASSERT has better message printing, so it's not replaced by new version. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The PP_NARG() macro can only handle integer type arguments, use META_COUNT_VARAGS_BEFORE_COMPILE() instead to avoid having to cast pointer types to integers. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
7c8f9f2 to
90e71b0
Compare
|
@ktrzcinx can you check CI. |
There is any user in source code who need deeper recursion level, reducing it allow to prevent compiler error message flood during working with META_RECURSE clients (eg. trace system). Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
90e71b0 to
47eb6c7
Compare
|
@ktrzcinx can you fix this one, everything else is good to go. |
|
@lgirdwood it won't work without this semicolon. It's because mapping function doesn't add it, to allow usage different separators, like |
|
@ktrzcinx ok, got you. |
Extracted from #3376.
Here META_MAP functionality has been used, so it's more flexible solution in case of
_TRACE_EVENT_MAX_ARGUMENT_COUNTchange.