Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2019 15:53:31 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r346396 - stable/12/sys/arm/broadcom/bcm2835
Message-ID:  <201904191553.x3JFrVJT081606@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri Apr 19 15:53:30 2019
New Revision: 346396
URL: https://svnweb.freebsd.org/changeset/base/346396

Log:
  MFC r345757:
  
    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.

Modified:
  stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==============================================================================
--- stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Fri Apr 19 15:52:09 2019	(r346395)
+++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Fri Apr 19 15:53:30 2019	(r346396)
@@ -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?201904191553.x3JFrVJT081606>