Skip to content

Add C API to notify when tracing/profiling is enabled or disabled #144690

@SubbaraoGarlapati

Description

@SubbaraoGarlapati

Feature or enhancement

Proposal:

There is currently no way to be notified when tracing/profiling is enabled or disabled. This forces tools that want different behavior based on tracing/profiling enablement (e.g., JIT compilers) to poll on every function call, adding significant overhead.
PEP-523 established frame evaluation hooks as an officially supported extension point for JITs. However, JITs using this API have no efficient way to know when tracing/profiling is enabled and fall back to the interpreter.
I propose adding a small C API enhancement allowing callbacks to be registered when trace/profile functions are set or cleared.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions