Thread (27 messages) 27 messages, 2 authors, 2021-03-15

Re: [PATCH rt-tests v2 02/14] cyclicdeadline.c: Fix printf format specifier

From: John Kacur <jkacur@redhat.com>
Date: 2021-03-14 22:46:38


On Fri, 5 Mar 2021, Daniel Wagner wrote:
quoted hunk ↗ jump to hunk
The fields are not uint64 just longs, update the printf format
specifiers.

Signed-off-by: Daniel Wagner <redacted>
---
 src/sched_deadline/cyclicdeadline.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
index 33bac8cda898..d7aa9bb5d269 100644
--- a/src/sched_deadline/cyclicdeadline.c
+++ b/src/sched_deadline/cyclicdeadline.c
@@ -18,7 +18,6 @@
 #include <errno.h>
 #include <signal.h>
 #include <getopt.h>
-#include <inttypes.h>
 
 #include <sys/syscall.h>
 #include <sys/types.h>
@@ -976,9 +975,9 @@ static void write_stats(FILE *f, void *data)
 	for (i = 0; i < nr_threads; i++) {
 		s = &sd[i].stat;
 		fprintf(f, "    \"%u\": {\n", i);
-		fprintf(f, "	 \"cycles\": %" PRIu64 ",\n", s->cycles);
-		fprintf(f, "	 \"min\": %" PRIu64 ",\n", s->min);
-		fprintf(f, "	 \"max\": %" PRIu64 ",\n", s->max);
+		fprintf(f, "	 \"cycles\": %ld,\n", s->cycles);
+		fprintf(f, "	 \"min\": %ld,\n", s->min);
+		fprintf(f, "	 \"max\": %ld\n", s->max);
 		fprintf(f, "	 \"avg\": %.2f\n", s->avg/s->cycles);
 		fprintf(f, "    }%s\n", i == nr_threads - 1 ? "" : ",");
 	}
-- 
2.30.1
This has also already been added before.

John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help