git: f470bff421ff - stable/13 - lockstat: Fix construction of comparision predicates

From: Kornel Dulęba <kd_at_FreeBSD.org>
Date: Tue, 19 Jul 2022 09:57:51 UTC
The branch stable/13 has been updated by kd:

URL: https://cgit.FreeBSD.org/src/commit/?id=f470bff421ffc5f0055086148740f4f564bf5fd6

commit f470bff421ffc5f0055086148740f4f564bf5fd6
Author:     Kornel Dulęba <kd@FreeBSD.org>
AuthorDate: 2022-07-04 06:48:52 +0000
Commit:     Kornel Dulęba <kd@FreeBSD.org>
CommitDate: 2022-07-19 09:37:03 +0000

    lockstat: Fix construction of comparision predicates
    
    Passing "0x%p" to sprintf results in double "0x" being printed.
    This causes a dtrace script compilation failure when "-d" flag
    is specified.
    Fix that by removing the extraneous "0x".
    
    Reviewed by:    markj
    Approved by:    mw(mentor)
    Obtained from:  Semihalf
    Sponsored by:   Alstom
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D35690
    
    (cherry picked from commit 9dbacce2d48abf04b4d65d2994586e1ff44b08fb)
---
 cddl/contrib/opensolaris/cmd/lockstat/lockstat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
index a7378980bc56..2fd29843b8ce 100644
--- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
+++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
@@ -606,14 +606,14 @@ predicate_add(char **pred, char *what, char *cmp, uintptr_t value)
 
 	if (*pred[0] != '\0') {
 		if (cmp != NULL) {
-			(void) sprintf(new, "(%s) && (%s %s 0x%p)",
+			(void) sprintf(new, "(%s) && (%s %s %p)",
 			    *pred, what, cmp, (void *)value);
 		} else {
 			(void) sprintf(new, "(%s) && (%s)", *pred, what);
 		}
 	} else {
 		if (cmp != NULL) {
-			(void) sprintf(new, "%s %s 0x%p",
+			(void) sprintf(new, "%s %s %p",
 			    what, cmp, (void *)value);
 		} else {
 			(void) sprintf(new, "%s", what);