Page MenuHomeFreeBSD

aq(4): add a runtime dev.aq.N.debug trace control
ClosedPublic

Authored by nick_spun.io on Jun 4 2026, 11:25 AM.
Referenced Files
Unknown Object (File)
Tue, Jul 7, 10:44 AM
Unknown Object (File)
Mon, Jul 6, 11:57 PM
Unknown Object (File)
Mon, Jul 6, 3:56 AM
Unknown Object (File)
Sun, Jul 5, 6:34 AM
Unknown Object (File)
Sun, Jul 5, 3:35 AM
Unknown Object (File)
Sat, Jun 20, 11:20 PM
Unknown Object (File)
Sat, Jun 20, 11:15 PM
Unknown Object (File)
Fri, Jun 19, 1:42 AM
Subscribers

Details

Summary

The trace_* family (trace/trace_error/trace_warn/trace_detail, used in the
F/W and init/config paths) was gated behind the compile-time
AQ_CFG_DEBUG_LVL, which is 0, so the dbg_level_/dbg_categories_ runtime
variables were dead and tracing could only be enabled by recompiling.

Decouple trace_base_ from AQ_CFG_DEBUG_LVL so it is always compiled and
gated purely at runtime on dbg_level_/dbg_categories_, make those two
variables writable (no longer const, default level 0 = off), and expose
them as dev.aq.N.debug (verbosity) and dev.aq.N.debug_categories
(subsystem mask) sysctls.

The datapath-heavy AQ_DBG_ENTER/PRINT/DUMP macros and the trace_aq_*_descr
descriptor dumps stay behind AQ_CFG_DEBUG_LVL (still 0), so the per-packet
paths are untouched -- trace_* is only used off the datapath. The two
variables are global (the trace macros reference them directly), so the
per-device sysctls share one backing store, which is fine for a debug
knob.

Validated on AQC107: dev.aq.0.debug defaults to 0 with no trace output;
setting it to 6 emits the F/W init/reset/capabilities traces on the next
F/W operation; setting it back to 0 silences them; traffic unaffected at
line rate, rx_err=0.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

nick_spun.io changed the visibility from "Public (No Login Required)" to "No One".Sun, Jun 14, 4:02 PM
nick_spun.io changed the visibility from "No One" to "Public (No Login Required)".Mon, Jun 15, 1:44 AM
adrian added a subscriber: adrian.

this is fine; we can update this after it lands to configure it as a bitmask and per-softc.

This revision is now accepted and ready to land.Wed, Jun 17, 8:02 PM
This revision was automatically updated to reflect the committed changes.