Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
To: cake@lists.bufferbloat.net
Cc: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Subject: [Cake] [PATCH 2/2] tc print_uint format fixes
Date: Sun, 11 Mar 2018 09:19:30 +0000	[thread overview]
Message-ID: <20180311091930.86264-3-ldir@darbyshire-bryant.me.uk> (raw)
In-Reply-To: <20180311091930.86264-1-ldir@darbyshire-bryant.me.uk>

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
---
 tc/tc_qdisc.c |  3 ++-
 tc/tc_util.c  | 24 ++++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index 70279b9d..3ec74a1c 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <math.h>
 #include <malloc.h>
+#include <inttypes.h>
 
 #include "utils.h"
 #include "tc_util.h"
@@ -264,7 +265,7 @@ int print_qdisc(const struct sockaddr_nl *who,
 	}
 
 	if (t->tcm_info != 1)
-		print_uint(PRINT_ANY, "refcnt", "refcnt %u ", t->tcm_info);
+		print_uint(PRINT_ANY, "refcnt", "refcnt %" PRIu64 " ", t->tcm_info);
 
 	if (tb[TCA_HW_OFFLOAD] &&
 	    (rta_getattr_u8(tb[TCA_HW_OFFLOAD])))
diff --git a/tc/tc_util.c b/tc/tc_util.c
index aceb0d94..1b4501d8 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -714,10 +714,10 @@ void print_action_control(FILE *f, const char *prefix,
 	open_json_object("control_action");
 	print_string(PRINT_ANY, "type", "%s", action_n2a(action));
 	if (TC_ACT_EXT_CMP(action, TC_ACT_GOTO_CHAIN))
-		print_uint(PRINT_ANY, "chain", " chain %u",
+		print_uint(PRINT_ANY, "chain", " chain %" PRIu64 ,
 			   action & TC_ACT_EXT_VAL_MASK);
 	if (TC_ACT_EXT_CMP(action, TC_ACT_JUMP))
-		print_uint(PRINT_ANY, "jump", " %u",
+		print_uint(PRINT_ANY, "jump", " %" PRIu64 ,
 			   action & TC_ACT_EXT_VAL_MASK);
 	close_json_object();
 	print_string(PRINT_FP, NULL, "%s", suffix);
@@ -770,17 +770,17 @@ void print_tm(FILE *f, const struct tcf_t *tm)
 
 	if (tm->install != 0) {
 		print_uint(PRINT_JSON, "installed", NULL, tm->install);
-		print_uint(PRINT_FP, NULL, " installed %u sec",
+		print_uint(PRINT_FP, NULL, " installed %" PRIu64 " sec",
 			   (unsigned int)(tm->install/hz));
 	}
 	if (tm->lastuse != 0) {
 		print_uint(PRINT_JSON, "last_used", NULL, tm->lastuse);
-		print_uint(PRINT_FP, NULL, " used %u sec",
+		print_uint(PRINT_FP, NULL, " used %" PRIu64 " sec",
 			   (unsigned int)(tm->lastuse/hz));
 	}
 	if (tm->expires != 0) {
 		print_uint(PRINT_JSON, "expires", NULL, tm->expires);
-		print_uint(PRINT_FP, NULL, " expires %u sec",
+		print_uint(PRINT_FP, NULL, " expires %" PRIu64 " sec",
 			   (unsigned int)(tm->expires/hz));
 	}
 }
@@ -798,17 +798,17 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat
 		memcpy(&bs, RTA_DATA(tbs[TCA_STATS_BASIC]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_BASIC]), sizeof(bs)));
 		print_string(PRINT_FP, NULL, "%s", prefix);
 		print_lluint(PRINT_ANY, "bytes", "Sent %llu bytes", bs.bytes);
-		print_uint(PRINT_ANY, "packets", " %u pkt", bs.packets);
+		print_uint(PRINT_ANY, "packets", " %" PRIu64 " pkt", bs.packets);
 	}
 
 	if (tbs[TCA_STATS_QUEUE]) {
 		struct gnet_stats_queue q = {0};
 
 		memcpy(&q, RTA_DATA(tbs[TCA_STATS_QUEUE]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_QUEUE]), sizeof(q)));
-		print_uint(PRINT_ANY, "drops", " (dropped %u", q.drops);
-		print_uint(PRINT_ANY, "overlimits", ", overlimits %u",
+		print_uint(PRINT_ANY, "drops", " (dropped %" PRIu64, q.drops);
+		print_uint(PRINT_ANY, "overlimits", ", overlimits %" PRIu64,
 			   q.overlimits);
-		print_uint(PRINT_ANY, "requeues", " requeues %u) ", q.requeues);
+		print_uint(PRINT_ANY, "requeues", " requeues %" PRIu64 ") ", q.requeues);
 	}
 
 	if (tbs[TCA_STATS_RATE_EST64]) {
@@ -833,7 +833,7 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat
 		print_uint(PRINT_JSON, "rate", NULL, re.bps);
 		print_string(PRINT_FP, NULL, "rate %s",
 			     sprint_rate(re.bps, b1));
-		print_uint(PRINT_ANY, "pps", " %upps", re.pps);
+		print_uint(PRINT_ANY, "pps", " %" PRIu64 "pps", re.pps);
 	}
 
 	if (tbs[TCA_STATS_QUEUE]) {
@@ -845,8 +845,8 @@ void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtat
 		print_uint(PRINT_JSON, "backlog", NULL, q.backlog);
 		print_string(PRINT_FP, NULL, "backlog %s",
 			     sprint_size(q.backlog, b1));
-		print_uint(PRINT_ANY, "qlen", " %up", q.qlen);
-		print_uint(PRINT_FP, NULL, " requeues %u", q.requeues);
+		print_uint(PRINT_ANY, "qlen", " %" PRIu64 "p", q.qlen);
+		print_uint(PRINT_FP, NULL, " requeues %" PRIu64, q.requeues);
 	}
 
 	if (xstats)
-- 
2.14.3 (Apple Git-98)


  parent reply	other threads:[~2018-03-11  9:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11  9:19 [Cake] fixing tc cake output since json-ification Kevin Darbyshire-Bryant
2018-03-11  9:19 ` [Cake] [PATCH 1/2] cake: print_uint format fixes Kevin Darbyshire-Bryant
2018-03-11 20:49   ` Toke Høiland-Jørgensen
2018-03-11 22:10     ` Kevin Darbyshire-Bryant
2018-03-11 23:34       ` Stephen Hemminger
2018-03-12  9:28         ` Kevin Darbyshire-Bryant
2018-03-12  9:56           ` Toke Høiland-Jørgensen
2018-03-12 15:11             ` Stephen Hemminger
2018-03-12 15:38               ` Toke Høiland-Jørgensen
2018-03-12 21:44                 ` Kevin Darbyshire-Bryant
2018-03-16  8:02               ` Kevin Darbyshire-Bryant
2018-03-17 14:33                 ` Toke Høiland-Jørgensen
2018-03-11  9:19 ` Kevin Darbyshire-Bryant [this message]
2018-03-11 20:50   ` [Cake] [PATCH 2/2] tc " Toke Høiland-Jørgensen
2018-03-11 20:57     ` Kevin Darbyshire-Bryant
2018-03-11 21:22       ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180311091930.86264-3-ldir@darbyshire-bryant.me.uk \
    --to=ldir@darbyshire-bryant.me.uk \
    --cc=cake@lists.bufferbloat.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox