BOBA CALI Macros
Use this skill when editing BoBa profiling scopes.
Ownership Rules
- Put
BOBA_CALI_MARKon public entry points or meaningful top-level operations, not on every small helper. - Keep each
BOBA_CALI_BEGIN(...)and its matchingBOBA_CALI_END(...)orBOBA_CALI_SWITCH(...,...)in the layer that owns the full profiled operation. - Keep each
BOBA_CALI_SWITCH(from, to)next to the code that actually transitions between those two phases. - For each
BOBA_CALI_SWITCH(B, C), there must be a preceedingBOBA_CALI_BEGIN(B)ORBOBA_CALI_SWITCH(A, B)to matchB - For each
BOBA_CALI_SWITCH(B, C), there must be a followingBOBA_CALI_END(C)ORBOBA_CALI_SWITCH(C, D)to matchC - Every function that has
BOBA_CALI...profiling region must either (1) start withBOBA_CALI_BEGIN(...)OR (2) haveBOBA_CALI_MARKand no otherBOBA_CALI...macros - Every function that has
BOBA_CALI_BEGIN(...)must have aBOBA_CALI_END(...)that corresponds to the lastBOBA_CALI_SWITCH(...,...)orBOBA_CALI_BEGIN(...)if there are no switches - Do not split ownership of one phase transition across caller and callee.
- Do not duplicate the same
SWITCHin both the front-end wrapper and the backend helper. - Ensure that if the function ends to hits a
returnthat there is aBOBA_CALI_END(...)to close the profiling region - You cannot have multiple ``BOBA_CALI_BEGIN(...)
in the same scope. UseBOBA_CALI_SWITCH(...,...)` instead.
Consistency Rules
- Prefer fewer, accurate phases over many weakly defined phases.
- Check whether a helper now performs multiple profiled phases but still has no local switches.
- Rebuild and run the affected target after moving CALI macros.