Skip to contentSkip to conversation

random run-time configurable debugging

PATCH In review Matt Mackall 1 participant 1 message Jan 13, 2005 Random number driver

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 random run-time configurable debugging

Add run-time switchable entropy debugging. Entire debug infrastructure remains compiled out by default.

drivers/char/random.c +5 -2
Index: rnd/drivers/char/random.c
===================================================================
@@ -473,12 +473,15 @@
 #endif
 
 #if 0
-#define DEBUG_ENT(fmt, arg...) printk(KERN_DEBUG "random %04d %04d %04d: " \
+static int debug = 0;
+module_param(debug, bool, 0644);
+#define DEBUG_ENT(fmt, arg...) do { if (debug) \
+	printk(KERN_DEBUG "random %04d %04d %04d: " \
 	fmt,\
 	random_state->entropy_count,\
 	sec_random_state->entropy_count,\
 	urandom_state->entropy_count,\
-	## arg)
+	## arg); } while (0)
 #else
 #define DEBUG_ENT(fmt, arg...) do {} while (0)
 #endif
Signature · 1 line
Mathematics is the supreme nostalgia of our time.