Skip to content

Support function tracing (-finstrument-functions)#764

Open
erhankur wants to merge 1 commit into
espressif:masterfrom
erhankur:enable_instrument_functions
Open

Support function tracing (-finstrument-functions)#764
erhankur wants to merge 1 commit into
espressif:masterfrom
erhankur:enable_instrument_functions

Conversation

@erhankur

@erhankur erhankur commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Implement the esp_trace function trace encoder callbacks so compiler-instrumented function entry/exit is recorded through SystemView.

@erhankur erhankur marked this pull request as draft June 23, 2026 22:34
@erhankur erhankur force-pushed the enable_instrument_functions branch 3 times, most recently from 8b255f7 to 5427464 Compare June 24, 2026 21:41
@erhankur erhankur marked this pull request as ready for review June 24, 2026 22:56
@erhankur erhankur requested a review from Copilot June 24, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds SystemView support for ESP-IDF’s compiler-instrumented function tracing (-finstrument-functions) by implementing esp_trace encoder callbacks and ensuring SystemView host-driven start/stop propagates to the trace runtime.

Changes:

  • Implemented SystemView encoder callbacks for function enter/exit and registered a dedicated SystemView module (ESP_FunctionTrace).
  • Propagated SystemView Start/Stop state to esp_trace via esp_trace_notify_recording_state().
  • Wired the new source into the build (conditional on CONFIG_ESP_TRACE_FUNCTION_TRACE) and documented the feature; bumped component version to 1.1.0.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
esp_sysview/src/SEGGER/SEGGER_SYSVIEW.c Calls into esp_trace on SystemView Start/Stop to propagate recording state.
esp_sysview/src/esp/function_trace_sysview.c New SystemView backend emitting function enter/exit events via a dedicated module.
esp_sysview/src/esp/adapter_encoder_sysview.h Exposes function-trace callback prototypes (and encoder fwd-decl).
esp_sysview/src/esp/adapter_encoder_sysview.c Registers function-trace module and wires callbacks into encoder vtable.
esp_sysview/CMakeLists.txt Conditionally builds the new function trace backend.
esp_sysview/README.md Documents function tracing behavior and symbol mapping workflow.
esp_sysview/idf_component.yml Version bump to 1.1.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread esp_sysview/src/SEGGER/SEGGER_SYSVIEW.c Outdated
Comment thread esp_sysview/src/SEGGER/SEGGER_SYSVIEW.c Outdated
Comment thread esp_sysview/src/SEGGER/SEGGER_SYSVIEW.c Outdated
Comment thread esp_sysview/src/esp/adapter_encoder_sysview.c
Comment thread esp_sysview/src/esp/function_trace_sysview.c Outdated
Comment thread esp_sysview/src/esp/function_trace_sysview.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread esp_sysview/src/esp/adapter_encoder_sysview.h Outdated
Comment thread esp_sysview/src/esp/adapter_encoder_sysview.h
Comment thread esp_sysview/src/esp/adapter_encoder_sysview.h
Comment thread esp_sysview/src/esp/function_trace_sysview.c Outdated
Comment thread esp_sysview/src/esp/function_trace_sysview.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread esp_sysview/src/SEGGER/SEGGER_SYSVIEW.c
Comment thread esp_sysview/src/esp/function_trace_sysview.c Outdated
@erhankur erhankur force-pushed the enable_instrument_functions branch 7 times, most recently from 5892a12 to 5c3e8f2 Compare June 26, 2026 09:46
@erhankur erhankur force-pushed the enable_instrument_functions branch from 5c3e8f2 to 35139f1 Compare June 26, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants