python / python/cpython

`_remote_debugging`: `RemoteUnwinder(..., jit=True)`

未关闭
#149,762 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

extension-modules topic-JIT topic-profiling type-feature
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Feature or enhancement

Proposal:

:)

The idea here is to expose JIT internals a bit more in the Tachyon profiler.

The questions that could be answered trivially:

  • Is JIT actually used? How often?
  • Which executor is hot?
  • What change made the largest difference (diff_flamegraph), in terms of % spent in JIT? Per line?

A bit harder:

  • Which UOPs actually eat time?
  • Which stensils are good?
  • What guards or deopts are bad?
  • What is the trace shape?

The very minimal change that I'm thinking about here is just adding --jit flag (active for --jsonl and maybe for --live but it's a catnip), and adding JitInfo to ThreadInfo.

That's how it could look:

JitInfo(
  executor_id,
  flags
)

This will requires extending debug offsets, obviously.

We could potentially expose native_pc, native_offset, uop_index, exit_index etc. The question would be how to expose metadata for it without balooning JitInfo, and how far we can get without blocking and native unwinding. :)

I'm pretty much open to any other ideas.

There will be definitely some performance impact (more VM reads), but hidden behind the --enable-experimental-jit flag should be bearable, and we could be more playful, going back and forth.

If you think it makes sense, I'd be willing to take a shot, but this will take multiple PRs.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪 _remote_debuggingRemoteUnwinder(..., jit=True) 以及现有的 ThreadInfo 流程。比较针对 --jsonl 以及可能的 --live 所提议的 --jit 行为,然后检查调试偏移量的处理方式。完成的要求是确定在 --enable-experimental-jit 后面公开 JitInfo 及其元数据的范围,同时考虑性能影响。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
devtools, performance
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。