skills/ohos-issue-graphics-sysfreeze-analysis/SKILL.md
Use when analyzing OpenHarmony sysfreeze/appfreeze logs to diagnose process freeze and thread blocking issues. Triggers on SERVICE_BLOCK, THREAD_BLOCK_6S, IPC deadlock, task queue blocking, or when user requests sysfreeze/process stuck analysis.
npx skillsauth add openharmonyinsight/openharmony-skills ohos-issue-graphics-sysfreeze-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
分析 OpenHarmony 图形相关模块的 Sysfreeze 日志,诊断进程冻结和线程阻塞问题的根本原因。
用户环境提供 llvm 工具(llvm-readelf/llvm-addr2line/llvm-objdump 等)。
确认日志完整性
确认符号表可用
llvm-addr2line -Cfpie path/to/so offsetld-musl-xxx.so 即 libc.so确认故障类型
Reason 字段,确认是 SERVICE_BLOCK 还是 THREAD_BLOCK记录关键信息
TIMESTAMP:故障发生时刻,用于在 hilog 日志中锁定时间范围TID:发生问题的线程 ID,问题分析从此线程开始查看整机资源状态
ReclaimAvailBuffer:整机剩余可用内存,判断是否低内存问题
ThermalLevel info:热等级 ≥ 5 时,系统可能受热限频影响性能分析当前任务
查看两次检测(SERVICE_WARNING/SERVICE_BLOCK,或 THREAD_BLOCK_3S/THREAD_BLOCK_6S)的 Current Running 任务:
验证时间合理性
假设最后一个 watchdog 任务在 T 时刻提交:
分析任务队列
检查各优先级任务队列(VIP、Immediate、High、Low、Idle),重点关注:
分析前先问自己三个问题:
根据两次抓取的调用栈分析线程阻塞关系,分析时必须解栈。
重要:分析从基本信息中的 Tid:<TID> 线程开始。
对比两次抓栈
分析线程状态(如果有)
state、utime、stime、priority、nice、clkutime/stime 和抓栈时间间隔,确定线程在用户态和内核态的执行时长分析堆栈阻塞模式
识别栈顶的阻塞函数,参考 常见阻塞模式
识别阻塞类型
查找阻塞源头
递归分析阻塞
如果是IPC 阻塞处理
BinderCatcher 信息,获取源为 当前进程号:当前线程号 的同步调用对端进程号:对端线程号 信息,查找 PeerBinder Stacktrace 中对应的进程抓栈获取流水日志
hilog 和 hilog_kmsg 文件分析流水日志
TIMESTAMP 问题发生时间附近的日志确定根本原因
绘制阻塞路径
分析业务信息
生成分析报告
重要:完成分析后生成报告并保存到文档。
不要跳过解栈步骤
不要忽略整机资源状态
不要孤立分析单个线程
不要在信息不足时强行下结论
不要忽略时间信息
信息不足时的处理
| 缺失信息 | 处理方式 | |----------|----------| | 符号表不存在 | 指出需要哪些 so 的符号表,无法精确定位代码行号 | | 只有一次抓栈 | 说明缺少对比信息,无法判断是否同一任务阻塞 | | hilog 缺失 | 仅依赖堆栈和任务队列分析,报告中标注日志缺失 | | BinderCatcher 缺失 | IPC 阻塞分析受限,尝试从堆栈推断对端 |
解栈失败时的处理
llvm-readelf 验证 so 是否包含符号表阻塞链无法闭合时的处理
整机问题优先级判断
当同时存在业务问题和整机问题时:
何时读取:
何时不要读取:
testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common