Commit 9dbacce2 authored by Kornel Dulęba's avatar Kornel Dulęba
Browse files

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
parent 1cf8e633
...@@ -606,14 +606,14 @@ predicate_add(char **pred, char *what, char *cmp, uintptr_t value) ...@@ -606,14 +606,14 @@ predicate_add(char **pred, char *what, char *cmp, uintptr_t value)
if (*pred[0] != '\0') { if (*pred[0] != '\0') {
if (cmp != NULL) { if (cmp != NULL) {
(void) sprintf(new, "(%s) && (%s %s 0x%p)", (void) sprintf(new, "(%s) && (%s %s %p)",
*pred, what, cmp, (void *)value); *pred, what, cmp, (void *)value);
} else { } else {
(void) sprintf(new, "(%s) && (%s)", *pred, what); (void) sprintf(new, "(%s) && (%s)", *pred, what);
} }
} else { } else {
if (cmp != NULL) { if (cmp != NULL) {
(void) sprintf(new, "%s %s 0x%p", (void) sprintf(new, "%s %s %p",
what, cmp, (void *)value); what, cmp, (void *)value);
} else { } else {
(void) sprintf(new, "%s", what); (void) sprintf(new, "%s", what);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment