Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 2019 19:27:45 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345757 - head/sys/arm/broadcom/bcm2835
Message-ID:  <201903311927.x2VJRj1u051050@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Sun Mar 31 19:27:44 2019
New Revision: 345757
URL: https://svnweb.freebsd.org/changeset/base/345757

Log:
  Improve debugging options in bcm2835_sdhci.c
  
  Similar to bcm2835_sdhost.c add a TUNABLE and SYSCTL to selectively
  turn on debugging printfs if debugging is turned on at compile time.
  
  MFC after:		2 weeks
  Sponsored by:		The FreeBSD Foundation
  Reviewed by:		gonzo, andrew
  Differential Revision:	https://reviews.freebsd.org/D19745

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Sun Mar 31 17:27:28 2019	(r345756)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Sun Mar 31 19:27:44 2019	(r345757)
@@ -66,8 +66,17 @@ __FBSDID("$FreeBSD$");
 #define	NUM_DMA_SEGS			2
 
 #ifdef DEBUG
-#define dprintf(fmt, args...) do { printf("%s(): ", __func__);   \
-    printf(fmt,##args); } while (0)
+static int bcm2835_sdhci_debug = 0;
+
+TUNABLE_INT("hw.bcm2835.sdhci.debug", &bcm2835_sdhci_debug);
+SYSCTL_INT(_hw_sdhci, OID_AUTO, bcm2835_sdhci_debug, CTLFLAG_RWTUN,
+    &bcm2835_sdhci_debug, 0, "bcm2835 SDHCI debug level");
+
+#define	dprintf(fmt, args...)					\
+	do {							\
+		if (bcm2835_sdhci_debug)			\
+			printf("%s: " fmt, __func__, ##args);	\
+	}  while (0)
 #else
 #define dprintf(fmt, args...)
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903311927.x2VJRj1u051050>