Since we have counters in __u64 format we have to print them with %llu macros.
PATCH 1/1 Since we have counters in __u64 format we have to print them with %llu macros.
Small fix for documentation.
---
Documentation/accounting/getdelays.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/accounting/getdelays.c +1 -1
@@ -208,7 +208,7 @@ void print_delayacct(struct taskstats *t)void task_context_switch_counts (struct taskstats *t) {printf ("\n\nTask %15s%15s\n" -" %15lu%15lu\n" , +" %15llu%15llu\n" ,"voluntary" ,"nonvoluntary" , t->nvcsw, t->nivcsw); }
Re: [PATCH] Since we have counters in __u64 format we have to print themwith %llu macros.
Quoted 15 lines · Maxim Uvarov
Small fix for documentation.
---
Documentation/accounting/getdelays.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)Documentation/accounting/getdelays.c +0
-0
Documentation/accounting/getdelays.c void print_delayacct(struct taskstats *t) · line 214
Quoted 8 lines
Documentation/accounting/getdelays.c +1
-1@@ -208,7 +208,7 @@ void print_delayacct(struct taskstats *t)void task_context_switch_counts (struct taskstats *t) {printf ("\n\nTask %15s%15s\n" -" %15lu%15lu\n" , +" %15llu%15llu\n" ,"voluntary" ,"nonvoluntary" , t->nvcsw, t->nivcsw); }
Looks good!
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Documentation/accounting/getdelays.c void print_delayacct(struct taskstats *t) · line 213
Quoted 12 lines · Maxim Uvarov
Documentation/accounting/getdelays.c +1
-1@@ -208,7 +208,7 @@ void print_delayacct(struct taskstats *t)void task_context_switch_counts (struct taskstats *t) {printf ("\n\nTask %15s%15s\n" -" %15lu%15lu\n" , +" %15llu%15llu\n" ,"voluntary" ,"nonvoluntary" , t->nvcsw, t->nivcsw);
__u64 is not always long long.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 16 lines · Andreas Schwab
Documentation/accounting/getdelays.c void print_delayacct(struct taskstats *t) · line 213
Quoted 12 lines · Maxim Uvarov
Documentation/accounting/getdelays.c +1
-1@@ -208,7 +208,7 @@ void print_delayacct(struct taskstats *t)void task_context_switch_counts (struct taskstats *t) {printf ("\n\nTask %15s%15s\n" -" %15lu%15lu\n" , +" %15llu%15llu\n" ,"voluntary" ,"nonvoluntary" , t->nvcsw, t->nivcsw);
__u64is not always long long.
What is the maximum size of long long across all architectures? How does one format __u64 for printing?
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL
Quoted 17 lines · Balbir Singh
Quoted 15 lines · Andreas Schwab
Documentation/accounting/getdelays.c void print_delayacct(struct taskstats *t) · line 213
Quoted 12 lines · Maxim Uvarov
Documentation/accounting/getdelays.c +1
-1@@ -208,7 +208,7 @@ void print_delayacct(struct taskstats *t)void task_context_switch_counts (struct taskstats *t) {printf ("\n\nTask %15s%15s\n" -" %15lu%15lu\n" , +" %15llu%15llu\n" ,"voluntary" ,"nonvoluntary" , t->nvcsw, t->nivcsw);
__u64is not always long long.
Quoted 3 lines
What is the maximum size of long long across all architectures? How does one format
__u64for printing?
In user space, use the macro PRIu64 (or PRIx64 etc) from <inttypes.h>.
-hpa
Quoted 17 lines · H. Peter Anvin
Quoted 16 lines · Balbir Singh
Quoted 15 lines · Andreas Schwab
Documentation/accounting/getdelays.c void print_delayacct(struct taskstats *t) · line 213
Quoted 12 lines · Maxim Uvarov
Documentation/accounting/getdelays.c +1
-1@@ -208,7 +208,7 @@ void print_delayacct(struct taskstats *t)void task_context_switch_counts (struct taskstats *t) {printf ("\n\nTask %15s%15s\n" -" %15lu%15lu\n" , +" %15llu%15llu\n" ,"voluntary" ,"nonvoluntary" , t->nvcsw, t->nivcsw);
__u64is not always long long.
Quoted 7 lines
Quoted 3 lines
What is the maximum size of long long across all architectures? How does one format
__u64for printing?In user space, use the macro PRIu64 (or PRIx64 etc) from <
inttypes.h>.-hpa
Thanks, I'll look into it
Signature · 4 lines
Warm Regards, Balbir Singh Linux Technology Center IBM, ISTL