diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caa92d8a..30989b63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -296,11 +296,14 @@ jobs: - name: Build debug run: cargo build --all-features - - name: Verify embedded script help matches docs + - name: Verify embedded help matches docs run: | tmpfile="$(mktemp)" + trap 'rm -f "$tmpfile"' EXIT target/debug/ghostscope --script-help > "$tmpfile" diff -u docs/scripting.md "$tmpfile" + target/debug/ghostscope --value-diagnostics-help > "$tmpfile" + diff -u docs/value-diagnostics.md "$tmpfile" - name: Build release run: cargo build --release --all-features diff --git a/README-zh.md b/README-zh.md index 9885a298..45a86e6d 100644 --- a/README-zh.md +++ b/README-zh.md @@ -221,6 +221,10 @@ GhostScope 把编译后的二进制重新变成“可观测系统”。在 TUI - [**使用限制**](docs/zh/limitations.md) 已知的限制和约束 +- [**值诊断**](docs/zh/value-diagnostics.md) + 理解值不可用、内存读取失败、展示降级和采集限制; + 使用 `ghostscope --value-diagnostics-help` 离线查看 + @@ -237,7 +241,7 @@ GhostScope 把编译后的二进制重新变成“可观测系统”。在 TUI 输入模式所有可用命令 - [**脚本语言**](docs/zh/scripting.md) - 编写强大的追踪脚本 + 编写追踪脚本;使用 `ghostscope --script-help` 离线查看 diff --git a/README.md b/README.md index 4cc37796..b90dcd4a 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,10 @@ See [Limitations](docs/limitations.md) for unsupported and explicitly degraded s - [**Limitations**](docs/limitations.md) Known limitations and constraints +- [**Value Diagnostics**](docs/value-diagnostics.md) + Understand unavailable values, read failures, display fallbacks, and capture limits; + read offline with `ghostscope --value-diagnostics-help` + @@ -242,7 +246,7 @@ See [Limitations](docs/limitations.md) for unsupported and explicitly degraded s All available commands for Input Mode - [**Script Language**](docs/scripting.md) - Write powerful trace scripts + Write trace scripts; read offline with `ghostscope --script-help` diff --git a/docs/architecture.md b/docs/architecture.md index d220fb97..498efb20 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -39,6 +39,36 @@ validated protocol record or explicit failure state | Event transport | `LOSS-1` | RingBuf or PerfEventArray carries events; output-helper failures increment per-trace loss counters. | | Protocol and rendering | `IDENT-1`, `FAIL-1` | Trace/PID/TID metadata and structured unavailable, expression-error, and backtrace states remain visible to consumers. | +## Value Display Diagnostics + +Static display limits and runtime read statuses travel separately. The DWARF +layer resolves a `ValueReadPlanResolution` containing an optional capture plan, +path-qualified static notes, and any rejected root adapter report. Notes survive +even when no semantic capture is selected; ordinary DWARF reads retain their +runtime address checks. The compiler adds limits discovered during bounded +capture lowering and finalizes notes for both memory-backed and register-backed +arguments, binding them to expression/type indices in `TraceContext`. Setup messages deduplicate +resolved expressions, types, and reasons even when internal indices differ. + +CLI, TUI creation results, and trace snapshots consume the same structured +notes. Snapshots retain them for `info trace`, independently of logs and loader +actor ownership. Runtime read failures retain `VariableStatus` and individual +nested-child statuses; the formatter never parses logs to infer failures. +Diagnostic metadata adds no eBPF memory reads and does not change the binary +status layout. Optional sequence-width metadata identifies proven element-limit +truncation; legacy metadata retains a general capture-limit explanation. + +At semantic depth boundaries, bounded type-only lookahead avoids diagnosing +plain field-only structs as failed adapters. It does not traverse runtime +pointer graphs. Static enum-path notes describe possible branches, not observed +read failures. User-facing explanations and next steps are in +[value diagnostics](value-diagnostics.md). + +The CLI embeds that same Markdown file for `--value-diagnostics-help`, using the same +early-exit path as `--script-help`. CI compares both outputs with their source +documents. Skills route to the installed binary's reference instead of +maintaining a separate copy of the guide. + ## System Overview ``` diff --git a/docs/configuration.md b/docs/configuration.md index 4bb344ea..52ca4f93 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -68,6 +68,9 @@ ghostscope --script-file trace.gs # Print the embedded script language reference and exit ghostscope --script-help +# Explain value failures, display fallbacks, and capture limits offline +ghostscope --value-diagnostics-help + # Choose script-mode event stdout rendering ghostscope --script-output pretty # default: formatted stdout ghostscope --script-output plain # payload-only stdout @@ -290,6 +293,7 @@ index is reported in CLI/TUI startup status before falling back. | `--script