Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168524546
D57440.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D57440.diff
View Options
diff --git a/sys/dev/aq/aq_dbg.h b/sys/dev/aq/aq_dbg.h
--- a/sys/dev/aq/aq_dbg.h
+++ b/sys/dev/aq/aq_dbg.h
@@ -109,16 +109,12 @@
#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
-extern const enum aq_debug_level dbg_level_;
-extern const uint32_t dbg_categories_;
+extern int dbg_level_;
+extern uint32_t dbg_categories_;
#define log_base_(_lvl, _fmt, args...) printf( "atlantic: " _fmt "\n", ##args)
-#if AQ_CFG_DEBUG_LVL > 0
-#define trace_base_(_lvl, _cat, _fmt, args...) do { if (dbg_level_ >= _lvl && (_cat & dbg_categories_)) { printf( "atlantic: " _fmt " @%s,%d\n", ##args, __FILENAME__, __LINE__); }} while (0)
-#else
-#define trace_base_(_lvl, _cat, _fmt, ...) do {} while (0)
-#endif // AQ_CFG_DEBUG_LVL > 0
+#define trace_base_(_lvl, _cat, _fmt, args...) do { if (dbg_level_ >= (_lvl) && ((_cat) & dbg_categories_)) { printf( "atlantic: " _fmt " @%s,%d\n", ##args, __FILENAME__, __LINE__); }} while (0)
#define aq_log_warn(_fmt, args...) log_base_(lvl_warn, "/!\\ " _fmt, ##args)
#define aq_log(_fmt, args...) log_base_(lvl_trace, _fmt, ##args)
diff --git a/sys/dev/aq/aq_dbg.c b/sys/dev/aq/aq_dbg.c
--- a/sys/dev/aq/aq_dbg.c
+++ b/sys/dev/aq/aq_dbg.c
@@ -45,8 +45,8 @@
#include "aq_dbg.h"
-const enum aq_debug_level dbg_level_ = lvl_detail;
-const uint32_t dbg_categories_ = dbg_init | dbg_config | dbg_fw;
+int dbg_level_ = 0;
+uint32_t dbg_categories_ = dbg_init | dbg_config | dbg_tx | dbg_rx | dbg_intr | dbg_fw;
diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c
--- a/sys/dev/aq/aq_main.c
+++ b/sys/dev/aq/aq_main.c
@@ -1311,6 +1311,14 @@
CTLTYPE_STRING | CTLFLAG_RD, softc, 0,
aq_sysctl_print_rss_config, "A", "Prints RSS Configuration");
+ /* Runtime trace controls (global) */
+ SYSCTL_ADD_INT(ctx, child, OID_AUTO, "debug",
+ CTLFLAG_RW, &dbg_level_, 0,
+ "Trace verbosity: 0=off, 3=err, 4=+warn, 5=+trace, 6=+detail");
+ SYSCTL_ADD_U32(ctx, child, OID_AUTO, "debug_categories",
+ CTLFLAG_RW, &dbg_categories_, 0,
+ "Trace category mask: init=1 config=2 tx=4 rx=8 intr=16 fw=32");
+
/* Driver Statistics */
for (int i = 0; i < softc->tx_rings_count; i++) {
struct aq_ring *ring = softc->tx_rings[i];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 29, 8:24 PM (4 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37539042
Default Alt Text
D57440.diff (2 KB)
Attached To
Mode
D57440: aq(4): add a runtime dev.aq.N.debug trace control
Attached
Detach File
Event Timeline
Log In to Comment