[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <85lflnmva5.fsf@mojatatu.com>
Date: Tue, 19 May 2020 18:09:38 -0400
From: Roman Mashak <mrv@...atatu.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: dsahern@...il.com, netdev@...r.kernel.org, kernel@...atatu.com,
jhs@...atatu.com, xiyou.wangcong@...il.com, jiri@...nulli.us,
Jiri Pirko <jiri@...lanox.com>
Subject: Re: [PATCH iproute2 1/1] tc: action: fix time values output in JSON format
Stephen Hemminger <stephen@...workplumber.org> writes:
> On Mon, 18 May 2020 13:29:18 -0400
> Roman Mashak <mrv@...atatu.com> wrote:
>
>> 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 <jiri@...lanox.com>
>> Signed-off-by: Roman Mashak <mrv@...atatu.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));
>> }
>
> Please use PRINT_ANY, drop the useless casts and fix the style.
>
Thanks Stephen. I will send v2.
> diff --git a/tc/tc_util.c b/tc/tc_util.c
> index 12f865cc71bf..fd5fcb242b64 100644
> --- a/tc/tc_util.c
> +++ b/tc/tc_util.c
> @@ -750,21 +750,17 @@ void print_tm(FILE *f, const struct tcf_t *tm)
> {
> int hz = get_user_hz();
[...]
Powered by blists - more mailing lists