Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe convert non-config-handled "DEBUG_ROOT" to...



details:   https://anonhg.NetBSD.org/src/rev/ecc3109495fe
branches:  trunk
changeset: 363416:ecc3109495fe
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Mar 11 01:59:33 2022 +0000

description:
convert non-config-handled "DEBUG_ROOT" to aprint_debug().

now it's possible to get boot-time info about raidframe root
device selection with simple "boot -x".

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diffs (79 lines):

diff -r ad74e2a9566f -r ecc3109495fe sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Thu Mar 10 23:39:12 2022 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Fri Mar 11 01:59:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.402 2022/03/09 10:04:06 mrg Exp $ */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.403 2022/03/11 01:59:33 mrg Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.402 2022/03/09 10:04:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.403 2022/03/11 01:59:33 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -158,12 +158,6 @@
 #define db1_printf(a) { }
 #endif                         /* DEBUG */
 
-#ifdef DEBUG_ROOT
-#define DPRINTF(a, ...) printf(a, __VA_ARGS__)
-#else
-#define DPRINTF(a, ...)
-#endif
-
 #if (RF_INCLUDE_PARITY_DECLUSTERING_DS > 0)
 static rf_declare_mutex2(rf_sparet_wait_mutex);
 static rf_declare_cond2(rf_sparet_wait_cv);
@@ -588,7 +582,7 @@
           then we don't touch booted_device or boothowto... */
 
        if (rootspec != NULL) {
-               DPRINTF("%s: rootspec %s\n", __func__, rootspec);
+               aprint_debug("%s: rootspec %s\n", __func__, rootspec);
                return;
        }
 
@@ -614,7 +608,7 @@
                        snprintf(cname, sizeof(cname), "%s%c",
                            device_xname(dksc->sc_dev), 'a');
                        candidate_root = dkwedge_find_by_wname(cname);
-                       DPRINTF("%s: candidate wedge root=%s\n", __func__,
+                       aprint_debug("%s: candidate wedge root=%s\n", __func__,
                            cname);
                        if (candidate_root == NULL) {
                                /*
@@ -627,12 +621,12 @@
                                candidate_root = dkwedge_find_by_parent(
                                    device_xname(dksc->sc_dev), &i);
                        }
-                       DPRINTF("%s: candidate wedge root=%p\n", __func__,
+                       aprint_debug("%s: candidate wedge root=%p\n", __func__,
                            candidate_root);
                } else
                        candidate_root = dksc->sc_dev;
-               DPRINTF("%s: candidate root=%p booted_device=%p "
-                       "root_partition=%d contains_boot=%d\n",
+               aprint_debug("%s: candidate root=%p booted_device=%p "
+                            "root_partition=%d contains_boot=%d\n",
                    __func__, candidate_root, booted_device,
                    rsc->sc_r.root_partition,
                    rf_containsboot(&rsc->sc_r, booted_device));
@@ -645,11 +639,11 @@
                        booted_device = candidate_root;
                        booted_method = "raidframe/single";
                        booted_partition = 0;   /* XXX assume 'a' */
-                       DPRINTF("%s: set booted_device=%s(%p)\n", __func__,
+                       aprint_debug("%s: set booted_device=%s(%p)\n", __func__,
                            device_xname(booted_device), booted_device);
                }
        } else if (num_root > 1) {
-               DPRINTF("%s: many roots=%d, %p\n", __func__, num_root,
+               aprint_debug("%s: many roots=%d, %p\n", __func__, num_root,
                    booted_device);
 
                /*



Home | Main Index | Thread Index | Old Index