rdk-log-forensics
Skill5 starsChanged 3 months agoApache-2.0View on GitHub
Read-only crash and log forensics for D-Robotics RDK devices — extract kernel errors from dmesg, list failed systemd units, detect coredumps and abnormal reboots, and summarize evidence for root-cause analysis. Use when a program crashed, the board rebooted or froze unexpectedly, a service will not start, or the user pastes an error asking what the logs say. Triggers include 崩溃, 死机, 自动重启, 突然重启, 段错误, Segmentation fault, coredump, 内核报错, dmesg 报错, journalctl, 服务起不来, 起不来了, 开机失败, oops. Do not use for live performance snapshots (rdk-diagnostic), memory measurement (rdk-memory-audit), or apt/disk maintenance (rdk-system-maintain).
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- D-Robotics/rdk-device-skillsword for word, first seen Oct 15, 2026
- D-Robotics/dsh-plugin-rdkedited, first seen Aug 28, 2026
Other versions2 projects use a version of this.
Word for word · 1
- D-Robotics/rdk-device-skills★ 4100% same
Edited · 1
- D-Robotics/dsh-plugin-rdk★ 196% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- bsp-bootloader-buildSkill
- bsp-deb-buildSkill
- bsp-env-setupSkill
- bsp-image-buildSkill
- bsp-kernel-buildSkill
- bsp-rootfs-customSkill
- bsp-source-syncSkill
- bsp-s-seriesSkill
- cmos-sensor-bringupSkill
- rdk-accessoriesSkill
- rdk-board-delegateSkill
- rdk-board-knowledgeSkill
- rdk-camera-setupSkill
- rdk-command-manualSkill
- rdk-diagnosticSkill
- rdk-docs-referenceSkill
- rdk-ecosystemSkill
- rdk-embodied-lerobotSkill
- rdk-gpio-40pinSkill
- rdk-hardwareSkill
- rdk-headless-modeSkill
- rdk-llm-deploymentSkill
- rdk-memory-auditSkill
- rdk-model-benchmarkSkill
- rdk-model-deploySkill
- rdk-model-zoo-developSkill
- rdk-model-zoo-integrateSkill
- rdk-model-zoo-releaseSkill
- rdk-model-zoo-repoSkill
- rdk-model-zoo-reviewSkill
- rdk-model-zooSkill
- rdk-model-zoo-validateSkill
- rdk-multimediaSkill
- rdk-network-remoteSkill
- rdk-pack-installerSkill
- rdk-peripheral-cookbookSkill
- rdk-skill-finderSkill
- rdk-source-mapSkill
- rdk-system-configSkill
- rdk-system-maintainSkill
- rdk-tros-setupSkill
- rdk-vision-pipelineSkill
The file
Files
RDK Log Forensics
崩溃 / 死机 / 服务起不来类问题的只读日志取证:从 dmesg、systemd、coredump
中提取结构化异常证据,替代"把整段日志贴给我看看"的低效循环。官方全量报告命令
rdkos_info 与 rdk-diagnostic 中的用法一致。
Purpose
把散落在 dmesg / journalctl / /var/crash 里的异常信号收敛成一份结构化清单 (错误计数、失败单元、最近异常原文摘录),让 Agent 基于证据归因, 并为上层诊断编排提供第四类证据源(前三类:快照、 内存审计、模型基准)。
When to use
当用户提出以下问题时激活:
- "程序跑着跑着崩溃了 / 段错误。"
- "板子突然自动重启 / 死机了,看看日志?"
- "某个服务起不来了。"
- "dmesg / journalctl 里这些报错是什么意思?"
- "帮我收集一下崩溃现场的日志证据。"
不要用本技能做实时性能快照(交接 rdk-diagnostic)、内存测量(交接 rdk-memory-audit)或 apt/磁盘维护(交接 rdk-system-maintain)。
Prerequisites
- 完整 dmesg 与 journalctl 历史通常需要 root;非特权运行时对应字段报
readable: false。
Available Scripts
| Script | Purpose | Arguments |
scripts/collect_logs.sh | 只读收集:内核 err+ 级消息计数与最近条目、systemd 失败单元、coredump/crash 文件、上次启动是否异常,输出 JSON。 | --json(默认)、--human、--lines N |
Instructions
- 运行
scripts/collect_logs.sh获取结构化异常清单。 - 服务起不来:以
failed_units为入口,对具体单元运行systemctl status <unit>与journalctl -u <unit> -n 50摘取首个 ERROR 原文。 - 突然重启/死机:看
last_boot.clean与kernel.recent_errors;存在 thermal/oops/OOM 关键字时分别交接——温度类 → rdk-diagnostic;OOM/CMA 类 → rdk-memory-audit;模型推理崩溃 → rdk-model-deploy。 - 用户粘贴报错:先在脚本输出的
kernel.recent_errors中确认板端是否有 同源记录,再用 rdk-docs-reference 检索官方 FAQ 中的同类报错。 - 需要官方全量系统报告(软硬件版本、驱动、日志打包)时运行
sudo rdkos_info并总结,与 rdk-diagnostic 的用法一致。
Reporting guidance
- 每条结论必须引用脚本输出的具体字段(如
failed_units[0].unit、kernel.err_count);无证据时说"日志中未见相关记录",不推断。 - 摘录内核消息时保留原文(含时间戳),不改写、不翻译报错本身。
- 崩溃归因给出"证据 → 假设 → 验证方法"三段,不直接下结论。
Limitations
- 只读取证:不清理日志、不重启服务、不修改 core_pattern。
- 内核 ring buffer 有限,久远的崩溃现场可能已被覆盖;如实报告观察窗口。
- 不做应用级 core 文件的 gdb 解析(超出板端技能范围,指引用户在开发机分析)。
Error handling
dmesg无权限:报告kernel.readable: false并给出 sudo 提示,不用空结果 冒充"没有错误"。journalctl/coredumpctl缺失:对应字段报 null 并说明信号受限。- 脚本报 not-an-rdk-host 时如实报告环境不可见。
Output contract for collect_logs.sh
{
"board": "rdk-x5",
"kernel": {
"readable": true,
"err_count": 3,
"recent_errors": [ "[12034.5] mipi_host0: rx timeout" ]
},
"failed_units": [ { "unit": "myapp.service", "active": "failed" } ],
"coredumps": { "coredumpctl": null, "var_crash_files": 1 },
"last_boot": { "clean": false, "previous_boot_available": true }
}Safety
全部操作只读;不执行任何清理、重启、内核参数修改。取证输出可能包含路径与 进程名,不包含凭据文件内容——本技能绝不读取 /etc/shadow、密钥或用户隐私文件。
Cross-platform behavior
全系 RDK 板卡适用;dmesg 权限策略、journald 持久化配置随 RDK OS 版本不同, 脚本对缺失工具逐项降级并如实报告 null / false。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

