Report tcf_t values in seconds, not jiffies, in JSON format as it is now
for stdout.

Fixes: 2704bd625583 ("tc: jsonify actions core")
Cc: Jiri Pirko <j...@mellanox.com>
Signed-off-by: Roman Mashak <m...@mojatatu.com>
---
 tc/tc_util.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 12f865cc71bf..118e19da35bb 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -751,17 +751,20 @@ void print_tm(FILE *f, const struct tcf_t *tm)
        int hz = get_user_hz();
 
        if (tm->install != 0) {
-               print_uint(PRINT_JSON, "installed", NULL, tm->install);
+               print_uint(PRINT_JSON, "installed", NULL,
+                          (unsigned int)(tm->install/hz));
                print_uint(PRINT_FP, NULL, " installed %u sec",
                           (unsigned int)(tm->install/hz));
        }
        if (tm->lastuse != 0) {
-               print_uint(PRINT_JSON, "last_used", NULL, tm->lastuse);
+               print_uint(PRINT_JSON, "last_used", NULL,
+                          (unsigned int)(tm->lastuse/hz));
                print_uint(PRINT_FP, NULL, " used %u sec",
                           (unsigned int)(tm->lastuse/hz));
        }
        if (tm->expires != 0) {
-               print_uint(PRINT_JSON, "expires", NULL, tm->expires);
+               print_uint(PRINT_JSON, "expires", NULL,
+                          (unsigned int)(tm->expires/hz));
                print_uint(PRINT_FP, NULL, " expires %u sec",
                           (unsigned int)(tm->expires/hz));
        }
-- 
2.7.4

Reply via email to