Skip to content

feat(datasource):通过Python暴露文本Ftrace解码能力 - #239

Merged
ohfei merged 11 commits into
mainfrom
codex/issue-230-ftrace-converter-pr
Sep 1, 2026
Merged

feat(datasource):通过Python暴露文本Ftrace解码能力#239
ohfei merged 11 commits into
mainfrom
codex/issue-230-ftrace-converter-pr

Conversation

@qiqingzhixin

@qiqingzhixin qiqingzhixin commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

问题

PR #232 同时包含文本 ftrace 转换内核与 PACK Provider,超过仓库可 review 门禁。本 PR 先独立交付来源解码能力,使解析、类型合同、Parquet 发布和 Python 调用边界能够单独验收。

最小切片

  • 将文本 ftrace 解码内核放入现有 kat/platform/datasource Rust crate,不再新增独立二进制或 wheel。
  • 通过现有 kat-datasource 原生 wheel 暴露 kat_datasource.text_ftrace.decode(source, destination, clock_domain)
  • 首批解析 sched_switchsched_wakeupsched_wakeup_newtracing_mark_write
  • 严格校验标准头部、buffer 计数、CPU 数、flags 图例和列标题。
  • 由 KAT 自有 Proto 表达事件语义,按固定批次写入类型化 Parquet 关系;完成 close/footer 校验后原子发布目录。
  • PyO3 调用转换期间释放 Python 解释器,解码失败映射为 kat_datasource.text_ftrace.DecodeError
  • Windows/Linux payload CI 构建原生 wheel 后实际执行新增 Python API 合同测试。

非目标

  • 不提供独立可执行文件、KAT 子命令、PACK Provider 或查询接口。
  • 不决定 Provider 的缓存位置、复用和清理策略。
  • 不解释其余 tracefs 事件。

验证

  • cargo +stable test --locked -p kat-datasource:通过,文本 ftrace 转换合同 7 passed。
  • cargo +stable clippy --locked -p kat-datasource --all-targets -- -D warnings:通过。
  • PYO3_PYTHON=D:\\soft\\Python310\\python.exe cargo +stable clippy --locked -p kat-datasource --features python-extension --all-targets -- -D warnings:通过。
  • cargo +stable fmt --all -- --check:通过。
  • 使用 maturin 1.15.0 构建本机 CPython 3.10 wheel,隔离安装后执行 test_text_ftrace_api.py:4 passed;实际生成 4 张类型化 Parquet 关系。
  • build/tests/test_wheel_artifacts.py:10 passed。
  • build/tests/test_payload_ci_workflows.py:11 passed。
  • git diff --check:通过。

仓库锁定的 Rust 1.95.0 当前镜像返回 404;本地验证使用已安装的 stable,未修改 rust-toolchain.toml。正式 CPython 3.14 Windows/Linux wheel 由 PR payload CI 验证。

Closes #230
Refs #219
Split from #232

@qiqingzhixin qiqingzhixin changed the title feat-ftrace2parquet-独立文本Ftrace转换器 feat(ftrace2parquet): 提供独立文本 Ftrace 转换器 Aug 31, 2026
@qiqingzhixin qiqingzhixin changed the title feat(ftrace2parquet): 提供独立文本 Ftrace 转换器 feat(datasource):通过Python暴露文本Ftrace解码能力 Sep 1, 2026
@qiqingzhixin qiqingzhixin added approved-large-change full-ci 运行双平台完整 CI labels Sep 1, 2026
@qiqingzhixin
qiqingzhixin force-pushed the codex/issue-230-ftrace-converter-pr branch 2 times, most recently from 882d0f5 to a0e65e0 Compare September 1, 2026 08:48
@ohfei
ohfei merged commit 7119690 into main Sep 1, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-large-change full-ci 运行双平台完整 CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[slice]校验并保留文本ftrace头部信息

2 participants