Kernel Struct GraphExplore C structures while reading Linux kernel and driver code. Right-click a structure name, variable or member expression and choose View Struct Map to open an interactive graph in VS Code's secondary sidebar. First public preview · MIT licensed · VS Code 1.106+
The example shows a Linux kernel PCI driver model. Sizes and offsets depend on the selected architecture, generated headers and kernel configuration. Features
Graph controls currently use Chinese labels; editor and command palette entries use English command names. Install and open your first map
Open Demo Graph provides a clearly labeled, simplified sample without local parsing dependencies. Local source parsing requires a trusted workspace. Platform packages
Linux packages target glibc distributions. Windows users can use WSL or a Linux workspace through Remote SSH. When connecting from a Mac or Windows PC to Linux, install the extension in the Linux workspace. A native Windows or Alpine/musl package is not included in this preview. On Ubuntu / Debian / WSL, install Public platform packages are gated on native CI and packaged-worker checks. An archive or library-format check alone is not evidence of native execution. Reading Linux kernel sourceUse a configured kernel tree with generated headers and a current
For a header, select a C translation unit and build configuration that includes it. Kbuild dependency records narrow the choices when available. The selected translation unit and CONFIG fingerprint are shown in the graph. Set An explicit target, cross-compiler name or unambiguous x86 / ARM64 Kbuild context
determines the kernel target ABI. If it cannot be determined, set a suitable
Analysis and layout boundariesCompiler errors stop the analysis; warnings remain visible. Incomplete types keep unknown sizes. A layout belongs to its recorded architecture and build configuration, rather than every kernel version or CONFIG. Relationship reports retain source positions and confidence labels. Callback bindings describe static assignments. Composed argument-flow paths are candidates, limited to direct forwarding and at most eight levels. General pointer aliasing, arbitrary macro internals and complete path-sensitive analysis are outside this preview's coverage. An empty query is not proof of no accesses. Verify Layout with DWARF or BTF optionally uses Image export and copying preserve the current expansion, filtering, pagination and folded views, including nodes outside the viewport. Other pages and unopened types are not automatically included. Reports and contributionsFor an issue, include the extension version, extension-host OS / CPU, the environment check result, relevant diagnostics and a minimal reproducer where possible. Remove private source and machine-specific information before posting. See the development guide for commands, settings and local tests, and the changelog for release notes. LicenseProject code is licensed under MIT. Bundled dependencies retain their licenses; see third-party notices, including libclang's Apache 2.0 license with LLVM Exceptions. |
