NetBSD-Bugs archive

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

kern/55068: string format in kernhist



>Number:         55068
>Category:       kern
>Synopsis:       string format in kernhist
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 13 01:50:00 +0000 2020
>Originator:     sc.dying%gmail.com@localhost
>Release:        NetBSD-current 20200310
>Organization:
>Environment:
>Description:

As mentioned in man of kernhist(9), KERNHIST_LOG strings won't work
in vmstat.
These patches replaces such expressions.

>How-To-Repeat:

>Fix:

Attached diffs provide fixes.

--------------1515D7106EB60E99E37A64F0
Content-Type: text/plain; charset=UTF-8;
 name="aue.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="aue.diff"

--- src/sys/dev/usb/if_aue.c.orig	2020-01-29 06:26:12.577923974 +0000
+++ src/sys/dev/usb/if_aue.c	2020-03-09 12:25:32.962025757 +0000
@@ -394,7 +394,7 @@ aue_csr_write_2(struct aue_softc *sc, in
 
 	if (err) {
 		AUEHIST_FUNC();
-		AUEHIST_CALLARGS("%s: aue_csr_write_2: reg=%#x err=%d",
+		AUEHIST_CALLARGS("aue%jd: aue_csr_write_2: reg=%#jx err=%jd",
 		    device_unit(un->un_dev), reg, err, 0);
 		return -1;
 	}

--------------1515D7106EB60E99E37A64F0
Content-Type: text/plain; charset=UTF-8;
 name="usbdi2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="usbdi2.diff"

--- src/sys/dev/usb/usbdi.c.orig	2020-02-19 22:47:11.374371239 +0000
+++ src/sys/dev/usb/usbdi.c	2020-03-07 12:45:38.601937331 +0000
@@ -396,7 +396,7 @@ usbd_transfer(struct usbd_xfer *xfer)
 		 * accepted by the HCD for some reason.  It needs removing
 		 * from the pipe queue.
 		 */
-		USBHIST_LOG(usbdebug, "xfer failed: %s, reinserting",
+		USBHIST_LOG(usbdebug, "xfer failed: %jd, reinserting",
 		    err, 0, 0, 0);
 		usbd_lock_pipe(pipe);
 		SDT_PROBE1(usb, device, xfer, preabort,  xfer);
@@ -1006,7 +1006,7 @@ usb_transfer_complete(struct usbd_xfer *
 	    xfer->ux_status == USBD_TIMEOUT &&
 	    !usbd_xfer_isread(xfer)) {
 		USBHIST_LOG(usbdebug, "Possible output ack miss for xfer %#jx: "
-		    "hiding write timeout to %d.%s for %d bytes written",
+		    "hiding write timeout to %jd.%jd for %ju bytes written",
 		    (uintptr_t)xfer, curlwp->l_proc->p_pid, curlwp->l_lid,
 		    xfer->ux_length);
 

--------------1515D7106EB60E99E37A64F0
Content-Type: text/plain; charset=UTF-8;
 name="xhci2.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="xhci2.diff"

--- src/sys/dev/usb/xhci.c.orig	2020-02-15 13:33:57.694031242 +0000
+++ xhci.c	2020-03-09 13:09:45.235825958 +0000
@@ -1307,8 +1307,8 @@ xhci_intr1(struct xhci_softc * const sc)
 	XHCIHIST_CALLARGS("USBSTS %08jx", usbsts, 0, 0, 0);
 	if ((usbsts & (XHCI_STS_HSE | XHCI_STS_EINT | XHCI_STS_PCD |
 	    XHCI_STS_HCE)) == 0) {
-		DPRINTFN(16, "ignored intr not for %s",
-		    (uintptr_t)device_xname(sc->sc_dev), 0, 0, 0);
+		DPRINTFN(16, "ignored intr not for xhci%jd",
+		    device_unit(sc->sc_dev), 0, 0, 0);
 		return 0;
 	}
 

--------------1515D7106EB60E99E37A64F0--

>Unformatted:
 This is a multi-part message in MIME format.
 --------------1515D7106EB60E99E37A64F0
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: 7bit
 


Home | Main Index | Thread Index | Old Index