Skip to content

feat(starry): add qperf runtime and app wrappers#1151

Open
cg24-THU wants to merge 1 commit into
rcore-os:devfrom
cg24-THU:feat/qperf-runtime-apps-combined
Open

feat(starry): add qperf runtime and app wrappers#1151
cg24-THU wants to merge 1 commit into
rcore-os:devfrom
cg24-THU:feat/qperf-runtime-apps-combined

Conversation

@cg24-THU

@cg24-THU cg24-THU commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add apps/qperf and apps/OScope-harness as thin TGOSKits app entrypoints that fetch the fixed external harness kit commit in prebuild.sh
  • wire the Starry qperf runtime into cargo xtask starry perf, including --case, shell-init/workload marker options, report postprocess validation, qperf report outputs, callchain/flamegraph options, and read-only TGOSKIT_HARNESS_KIT_DIR validation
  • keep the harness/qperf implementation source out of this repository; the managed checkout lives under target/tgoskit-harness-kit/<commit>
  • keep the riscv64-only FUTEX_PRIVATE_FLAG subtest skip for the known Starry SMP QEMU hang

Relationship to existing PRs

This is the combined runtime+app version requested after review of #1093/#1095. It folds the app wrapper scope from #1093 and the runtime scope from #1095 into one PR so perf-profile and qperf-smoke.sh boot no longer depend on a separate companion PR.

Validation

  • bash -n apps/OScope-harness/prebuild.sh apps/qperf/prebuild.sh apps/OScope-harness/scripts/qperf-smoke.sh apps/common/prebuild-harness-kit.sh
  • python3 -m py_compile apps/OScope-harness/harness.py apps/OScope-harness/mcp_server.py
  • git diff --check
  • git diff --cached --check
  • RUSTUP_TOOLCHAIN=stable rustfmt --edition 2024 --check scripts/axbuild/src/starry/mod.rs scripts/axbuild/src/starry/perf.rs
  • RUSTUP_TOOLCHAIN=stable cargo check --manifest-path scripts/axbuild/Cargo.toml
  • RUSTUP_TOOLCHAIN=stable cargo xtask starry perf --help

Note: stable rustfmt reports warnings for nightly-only rustfmt.toml options, but the formatting check exits successfully.

@mai-team-app mai-team-app Bot 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.

PR #1151 审查报告

概述

本 PR 将 #1093(app wrapper)和 #1095(perf runtime)合并为一个 PR。主要修改:

  1. App wrappers: apps/OScope-harness/apps/qperf/apps/common/prebuild-harness-kit.sh — thin entrypoint,prebuild.sh 固定 clone 外部 harness kit(commit 762c2272)
  2. Perf CLI 扩展 (mod.rs): 30+ 新 ArgsPerf 字段(case, markers, callchain, flamegraph, host-metrics 等),强类型枚举
  3. Perf runtime 重写 (perf.rs, +2206/-138): workload windowing、QMP 优雅关机、zig cross-cc fallback、分阶段 flamegraph、report postprocess、host 指标采集
  4. Futex 测试: riscv64 跳过 T6 FUTEX_PRIVATE_FLAG(已知 SMP QEMU 挂起,见 #1093

实现分析

代码结构良好,错误处理完善。ScopedEnvVar RAII 正确恢复环境变量。unsafe 块均有 SAFETY 注释。外部依赖通过 git commit pin + 校验。无 [patch.crates-io]。

本地验证

  • bash -n shell 语法 ✅
  • python3 -m py_compile ✅
  • git diff --check ✅
  • rustfmt --edition 2024 --check mod.rs ✅
  • rustfmt --edition 2024 --check perf.rs ✅
  • cargo check (axbuild) ✅

CI 分析

CI run #5393 总状态 failure。成功: formatting、sync-lint、starry loongarch64/aarch64 qemu、axvisor boards、axvisor aarch64/x86_64。Cancelled: arceos tests (3)、starry riscv64 qemu、axvisor riscv64 qemu。所有 cancelled job 在 10:08 同时被终止 — workflow 级级联超时,非 PR 相关失败

⚠️ 阻塞:与 dev 合并冲突(3 个文件)

  1. apps/OScope-harness/README.md — add/add 冲突。dev 已合并 app-only README,本 PR 是合并版应保留 PR 版本
  2. apps/OScope-harness/scripts/qperf-smoke.sh — 同理
  3. test-suit/starryos/normal/qemu-smp4/test-futex-clone-thread/c/src/main.c — 两边都有 riscv64 T6 skip,dev 多了 #1093 引用,保留 dev 版本

已本地完成冲突 dry-run 验证(无标记残留、shell 语法 OK、diff check OK),但无法 push 到 fork(环境无凭据)。

请 merge 最新 dev 解决冲突后 push。 解决后无其他阻塞问题。

重复/重叠分析

  • PR #1160 (Wayland): 无关表面
  • PR #1159 (CI split): 无关 CI 重构
  • #1093/#1095 已被本 PR 替代

Powered by mimo-v2.5-pro

## CLI

From the TGOSKits repository root:

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.

此文件与 dev 存在 add/add 冲突。dev 已合并 app-only 版本 README。本 PR 是合并版,应保留本 PR 版本。请 merge 最新 dev 解决。

if ! grep -q "pub case:" "$workspace/scripts/axbuild/src/starry/mod.rs" 2>/dev/null; then
cat >&2 <<'EOF'
error: qperf smoke requires the enhanced Starry qperf runtime.

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.

此文件与 dev 存在 add/add 冲突。dev 的错误信息引用 runtime companion,本 PR 是合并版应保留。请 merge 最新 dev 时取 PR 版本。

{
#if defined(__riscv)
/*
* The explicit FUTEX_PRIVATE_FLAG subtest currently hangs on Starry

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.

dev 在此处已补充 Follow-up context: #1093 引用。合并时请保留 dev 版本以保留 issue 追溯。

@mai-team-app
mai-team-app Bot requested review from ZCShou and ZR233 June 5, 2026 18:33

@ZR233 ZR233 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这次 PR 把 qperf/OScope-harness 作为薄 app wrapper 接入,并把 Starry qperf runtime 扩展到 cargo xtask starry perf,包括 --case、shell workload、marker/window、report postprocess 和外部 harness kit 固定 commit 管理。整体方向是在仓库内保留入口与 xtask 集成,把 qperf/harness 实现放在 pinned external checkout。

当前 head f5bc5f69827d074cd7ed91bb2037181a909b8535 还不能合入,主要有两个阻塞点:

  1. PR 文档明确要求 apps/OScope-harness/scripts/qperf-smoke.sh boot 可作为 qperf smoke,但我在当前 head 本地运行该命令时,外部 harness checkout 成功拉到 762c22725024a065e85b26e0b01121eccea651c0 后,执行 cargo xtask starry perf --timeout 20 --case boot 直接失败:StarryOS qperf riscv64 build requires riscv64-linux-musl-gcc in PATH; install a riscv64 musl C compiler or install zig...。这说明新增 app/tool workflow 还缺少可复现的准备说明、preflight,或默认可运行路径。按项目 review 规则,app/tool wrapper 不能只靠 --help/语法检查证明可用,文档中的 runtime smoke 需要在当前 head 上跑到成功 marker 或给出受控 fallback。
  2. 当前 PR mergeStateStatus=DIRTY,和最新 dev 已有冲突。因为上面的 runtime smoke 仍阻塞,我没有做冲突修复;请先 rebase/merge 最新 dev 后再重新验证。

本地验证:

  • cargo fmt --check:通过
  • git diff --check origin/dev...HEAD:通过
  • bash -n apps/OScope-harness/prebuild.sh apps/qperf/prebuild.sh apps/OScope-harness/scripts/qperf-smoke.sh apps/common/prebuild-harness-kit.sh:通过
  • python3 -m py_compile apps/OScope-harness/harness.py apps/OScope-harness/mcp_server.py:通过
  • cargo xtask starry perf --help:通过,能看到新增 --case/marker/workload 参数
  • apps/OScope-harness/scripts/qperf-smoke.sh boot:失败,缺少 riscv64-linux-musl-gcc 且本机没有 zig fallback,未进入 QEMU/未生成 qperf report

CI 状态:当前 head formatting、sync-lint、clippy 已通过;Starry x86_64 QEMU 失败在 test-mt-execve pending-signal exec case,和本 PR 的 qperf runtime/app wrapper 没有直接文件或语义关联;riscv Starry QEMU 日志显示 context canceled,看起来是 fail-fast 级联。因为 PR 自身文档 smoke 已本地失败,本次 request changes 不依赖这些广义 CI 失败。

重复/重叠检查:PR body 说明本 PR 合并了 #1093/#1095 的 app wrapper 和 runtime scope;open PR 检索中 #1039/#990 是较早 qperf/harness 相关工作,当前 #1151 是合并版/替代方向,不是 dev 上已有功能。请在后续更新中继续保持和这些旧 PR 的关系说明清晰。

## qperf Smoke

```bash
apps/OScope-harness/scripts/qperf-smoke.sh boot

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个文档化 smoke 在当前 head 上还不能作为可复现验证。我本地运行 apps/OScope-harness/scripts/qperf-smoke.sh boot 时,pinned harness checkout 成功后进入 cargo xtask starry perf --timeout 20 --case boot,但立即失败于缺少 riscv64-linux-musl-gcc,且本机没有 zig fallback:StarryOS qperf riscv64 build requires ...。新增 app/tool workflow 需要把必需 host 依赖写进文档并提供 preflight,或调整默认 smoke 到 CI/普通开发环境可运行的路径;否则这个 PR 只证明了 wrapper 存在,不能证明 qperf smoke 可用。

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