Fix printf format specifier
cover Fix printf format specifier
A couple of fallouts from the JSON patches.
Daniel Wagner (2):
cyclictest: Fix printf format specifier
cyclicdeadline.c: Fix printf format specifier
src/cyclictest/cyclictest.c | 8 ++++---- src/sched_deadline/cyclicdeadline.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.30.0
PATCH 1/2 cyclictest: Fix printf format specifier
The fields are not uint64 just longs, update the printf format specifiers.
--- src/cyclictest/cyclictest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
src/cyclictest/cyclictest.c +4 -4
@@ -1732,15 +1732,15 @@ static void write_stats(FILE *f, void *data)if (s->hist_array[j] ==0 )continue ;fprintf (f,"%s" , comma ?",\n" :"\n" ); -fprintf (f," \"%u\": %" PRIu64, j, s->hist_array[j]); +fprintf (f," \"%u\": %ld" , j, s->hist_array[j]); comma =1 ; }if (comma)fprintf (f,"\n" );fprintf (f," },\n" ); -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," \"cpu\": %d,\n" , par[i]->cpu);fprintf (f," \"node\": %d\n" , par[i]->node);
Signature · 1 line
2.30.0
Re: [PATCH rt-tests v1 1/2] cyclictest: Fix printf format specifier
Quoted 36 lines · Daniel Wagner
The fields are not uint64 just longs, update the printf format specifiers.
Signed-off-by Daniel Wagner <[email protected]>--- src/cyclictest/cyclictest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)src/cyclictest/cyclictest.c +4
-4@@ -1732,15 +1732,15 @@ static void write_stats(FILE *f, void *data)if (s->hist_array[j] ==0 )continue ;fprintf (f,"%s" , comma ?",\n" :"\n" ); -fprintf (f," \"%u\": %" PRIu64, j, s->hist_array[j]); +fprintf (f," \"%u\": %ld" , j, s->hist_array[j]); comma =1 ; }if (comma)fprintf (f,"\n" );fprintf (f," },\n" ); -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," \"cpu\": %d,\n" , par[i]->cpu);fprintf (f," \"node\": %d\n" , par[i]->node);Signature · 1 line
2.30.0
Also Reported-by: Signed-off-by: Christian Eggers <[email protected]>
PATCH 2/2 cyclicdeadline.c: Fix printf format specifier
In reply to Daniel WagnerThe fields are not uint64 just longs, update the printf format specifiers.
--- src/sched_deadline/cyclicdeadline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
src/sched_deadline/cyclicdeadline.c +3 -3
@@ -978,9 +978,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 ?"" :"," ); }
Signature · 1 line
2.30.0
Re: [PATCH rt-tests v1 2/2] cyclicdeadline.c: Fix printf format specifier
Quoted 29 lines · Daniel Wagner
The fields are not uint64 just longs, update the printf format specifiers.
Signed-off-by Daniel Wagner <[email protected]>--- src/sched_deadline/cyclicdeadline.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)src/sched_deadline/cyclicdeadline.c +3
-3@@ -978,9 +978,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 ?"" :"," ); }Signature · 1 line
2.30.0
Also Reported-by: Signed-off-by: Christian Eggers <[email protected]>