Add always-on ring-buffer logging for all Qcom kernel drivers (Phase 1)#29
Open
hangzqcom wants to merge 1 commit intoqualcomm:mainfrom
Open
Add always-on ring-buffer logging for all Qcom kernel drivers (Phase 1)#29hangzqcom wants to merge 1 commit intoqualcomm:mainfrom
hangzqcom wants to merge 1 commit intoqualcomm:mainfrom
Conversation
Implements Phase 1 of docs/always-on-logging-plan.md: every Qcom kernel driver is paired with an always-on, bounded ring-buffer trace session plus a one-command Save Log action. No driver source code changes; all risk is contained in user-mode scripts and config. Windows (tools/logging/windows/): - QcomTraceProviders.psd1: single source of truth for WPP GUIDs and AutoLogger session parameters (64 MB circular ETL, INFO level, keyword mask with chatty data flags off by default). - Install-QcomLogging.ps1 / Uninstall-QcomLogging.ps1: provision or tear down the HKLM AutoLogger registry tree and the equivalent live ETW session via logman, so logging begins on first install without a reboot. - Save-QcomDriverLog.ps1: flush/stop/rotate/restart the circular ETL into C:\Users\Public\\Documents\\QcomLogs\\QcomDrivers-<timestamp>.etl; emits manifest.json and can optionally zip setupapi.dev.log + pnputil output for RMA. - QcomDrivers.wprp: Windows Performance Recorder profile mirroring the same providers for on-demand WPR/xperf captures. Linux (tools/logging/linux/): - qcomlog: bash CLI (install | save | status | uninstall) that provisions /sys/kernel/tracing/instances/qcom_drivers with a bounded overwrite-mode ring and per-CPU buffer_size_kb=4096, then snapshots into timestamped tarballs. - qcomlogd.service: systemd oneshot unit that provisions the instance at boot. - qcom-diag.rules: udev rule granting the qcom-diag group snapshot access. - qcomlog.conf: tunables (buffer size, retention, event globs, outdir). Docs: docs/always-on-logging-plan.md + tools/logging/README.md cover design, phasing, performance targets (<= 0.5%% CPU, <= 32 MB RAM, <= 1 s save latency, <= 200 ms Windows / <= 50 ms Linux logging gap), and open risks (S-mode AutoLogger, LOCKDOWN_TRACEFS, etc). Verified: PowerShell parses clean, WPRP XML well-formed, psd1 loads, qcomlog passes bash -n.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 1 of
docs/always-on-logging-plan.md: every Qcom kernel driver gets an always-on, bounded ring-buffer trace session plus a one-command "Save Log" action. No driver source code changes — all risk is contained in user-mode scripts and config.Problem: today WPP (Windows) and
printk/QC_LOG_*(Linux) are opt-in. By the time a customer reports an issue, the useful history is already gone, and each driver has its own enable workflow.Solution: provision an OS-native circular ring buffer at boot (ETW AutoLogger on Windows, ftrace instance on Linux) and expose a single
SaveSnapshot()action that stops/rotates/restarts the session in under a second with < 200 ms (Windows) / < 50 ms (Linux) logging gap.What's in this PR
Windows (
tools/logging/windows/)QcomTraceProviders.psd1Install-QcomLogging.ps1logmansession immediately (no reboot needed for first install).Uninstall-QcomLogging.ps1Save-QcomDriverLog.ps1.etl→ restart; emitsmanifest.json; optional-Bundlezipssetupapi.dev.log+pnputiloutput.QcomDrivers.wprpLinux (
tools/logging/linux/)qcomloginstall|save|status|uninstall. Uses a dedicated/sys/kernel/tracing/instances/qcom_driverswithbuffer_size_kb=4096per CPU (~32 MB total) and overwrite mode.qcomlogd.serviceqcom-diag.rulesqcom-diaggroup snapshot access.qcomlog.confDocs
docs/always-on-logging-plan.md— full design, phasing, performance targets, risks.tools/logging/README.md— quick start for each platform.README.md— pointer added.Phase coverage
AddRegintegrationtrace_qcom_logtracepointQcomLogSvcC++ serviceBuild / verification
Install-QcomLogging.ps1,Uninstall-QcomLogging.ps1,Save-QcomDriverLog.ps1— PowerShell tokenizer OKQcomDrivers.wprp— XML well-formed OKQcomTraceProviders.psd1—Import-PowerShellDataFileOKqcomlog—bash -nOK.gitattributesenforces LF line endings on Linux artifacts.Quick start
Windows (as Administrator):
Linux:
Open questions / risks (discussed in plan doc §8)
LOCKDOWN_TRACEFS(fallback: dmesg + kfifo degraded mode).QC_LOG_DATA/WPP_DRV_MASK_RDATApayloads — gated behind non-default keyword.