Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hygenic tracing hooks #1085

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Jun 7, 2024

  1. Add traceQUEUE_RESET and traceQUEUE_RESET_FAILED hooks.

    xQueueGenericReset does not feature any tracing hooks besides the API
    ENTER and EXIT calls.
    
    This introduces two new tracing hooks that, in the same style as all
    other queue APIs, inform a tracer that a queue has been reset.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    1fb36a0 View commit details
    Browse the repository at this point in the history
  2. Add extended queue send and queue send failed hooks.

    This commit adds extended versions of all queue send trace hooks
    (including FROM_ISR and FAILED variants) that also hygenically expose
    the value of xCopyPosition.
    
    This enables tracers to identify the type of queue send and therefor
    queue state after the operation, which was not possible without
    accessing scope variables before.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    9c3f770 View commit details
    Browse the repository at this point in the history
  3. Add extended traceCREATE_COUNTING_SEMAPHORE hook.

    Adds an extended version of traceCREATE_COUNTING_SEMAPHORE that also
    exposes the handle of the semaphore. This provides the tracer with the
    initial semaphore count which is set after the call to traceQUEUE_CREATE
    and was not hygienically exposed without this hook.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    93f008b View commit details
    Browse the repository at this point in the history
  4. Split traceTASK_NOTIFY_TAKE into _EXT and _FAILED hooks.

    The old traceTASK_NOTIFY_TAKE hook was always called (no matter the
    success or failure of the action) and did not hygienically expose
    enough information for the tracer to determine the state of the task
    notification after it has been taken.
    
    The new traceTASK_NOTIFY_TAKE_EXT hook is called only if
    the notification was taken successfully and hygienically expose
    xClearCountOnExit.
    
    The new traceTASK_NOTIFY_TAKE_FAILED hook is called if the notification
    could not be taken.
    
    This matches how the tracing hooks for all other APIs that attempt to
    receive/take a resource and my block function: First, if the task blocks,
    a BLOCK or BLOCKING trace hook is called. Then, either a normal or
    FAILED trace hook is called, indicating if the operation timed out or
    succeeded.
    
    Both hooks fall back on the old traceTASK_NOTIFY_TAKE, preserving its
    functionality for backwards compatibility.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    402f715 View commit details
    Browse the repository at this point in the history
  5. Add traceTASK_NOTIFY_STATE_CLEAR and traceTASK_NOTIFY_VALUE_CLEAR hooks.

    Both xTaskGenericNotifyStateClear and ulTaskGenericNotifyValueClear did
    not feature any tracing hooks besides the ENTER and EXIT calls.
    
    This adds the relevant hooks to inform a tracer that the notification
    state/value has changed.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    e786375 View commit details
    Browse the repository at this point in the history
  6. Add extended versions of all notify / notify give tracing hooks.

    The previous versions of these macros did not hygienically expose what
    task was being notified, and how/if the notification value was notified.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    ab558f5 View commit details
    Browse the repository at this point in the history
  7. Split traceTASK_NOTIFY_WAIT into _EXT and _FAILED hooks.

    The old traceTASK_NOTIFY_WAIT hook was always called (no matter the
    success or failure of the action) and did not hygienically expose
    enough information for the tracer to determine the state of the task
    notification after it has been taken.
    
    The new traceTASK_NOTIFY_WAIT_EXT hook is called only if
    the notification was taken successfully and hygienically expose
    ulBitsToClearOnExit.
    
    The new traceTASK_NOTIFY_WAIT_FAILED hook is called if the notification
    could not be taken.
    
    This matches how the tracing hooks for all other APIs that attempt to
    receive/take a resource and my block function: First, if the task blocks,
    a BLOCK or BLOCKING trace hook is called. Then, either a normal or
    FAILED trace hook is called, indicating if the operation timed out or
    succeeded.
    
    Both hooks fall back on the old traceTASK_NOTIFY_WAIT, preserving its
    functionality for backwards compatibility.
    
    Not that there is a very slight breaking change in this commit:
    traceTASK_NOTIFY_WAIT is now called after the out-var pulNotificationValue
    is set. Because this pointer was in an unknown/user-set state when the
    tracing hook was previously called, it is highly unlikely that there are
    any tracers that rely on this.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    8c87469 View commit details
    Browse the repository at this point in the history
  8. Add traceSTREAM_BUFFER_SET_TRIGGER_LEVEL and traceSTREAM_BUFFER_SET_N…

    …OTIFICATION_INDEX hooks.
    
    This enables tracers to track both the trigger level and notification
    index of a stream buffer if they are changed during operation.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    d39654e View commit details
    Browse the repository at this point in the history
  9. Add extended traceTASK_DELAY hook, clarified traceTASK_DELAY_UNTIL.

    Adds an extended version of traceTASK_DELAY that also exposes the number
    of ticks to delay.
    schilkp committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    19e901e View commit details
    Browse the repository at this point in the history