python / python/cpython

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

オープン
#144,690 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

interpreter-core topic-C-API topic-profiling type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

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
  • gh-144691

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

PEP-523、フレーム評価フック、および既存の trace/profile 関数の設定・クリアのパスを確認してください。この issue では具体的なファイルやテストは指定されていません。ツールがポーリングなしで tracing/profiling の有効化の変更に対するコールバックを登録できる C API が提供され、動作がリンク先の PR gh-144691 に沿うようになれば、作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, python
領域
api, backend-api-design
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。