netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Mashak <mrv@mojatatu.com>
To: David Ahern <dsahern@gmail.com>
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
	kernel@mojatatu.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
	jiri@resnulli.us
Subject: Re: [PATCH iproute2-next 1/1] tc: report time an action was first used
Date: Mon, 18 May 2020 12:41:10 -0400	[thread overview]
Message-ID: <85pnb1mc0p.fsf@mojatatu.com> (raw)
In-Reply-To: <8f9898bf-3396-a8c4-b8a1-a0d72d5ebc2c@gmail.com> (David Ahern's message of "Mon, 18 May 2020 09:36:15 -0600")

David Ahern <dsahern@gmail.com> writes:

> On 5/17/20 7:28 AM, Roman Mashak wrote:
>> Have print_tm() dump firstuse value along with install, lastuse
>> and expires.
>> 
>> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
>> ---
>>  tc/tc_util.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/tc/tc_util.c b/tc/tc_util.c
>> index 12f865cc71bf..f6aa2ed552a9 100644
>> --- a/tc/tc_util.c
>> +++ b/tc/tc_util.c
>> @@ -760,6 +760,11 @@ void print_tm(FILE *f, const struct tcf_t *tm)
>>  		print_uint(PRINT_FP, NULL, " used %u sec",
>>  			   (unsigned int)(tm->lastuse/hz));
>>  	}
>> +	if (tm->firstuse != 0) {
>> +		print_uint(PRINT_JSON, "first_used", NULL, tm->firstuse);
>> +		print_uint(PRINT_FP, NULL, " firstused %u sec",
>> +			   (unsigned int)(tm->firstuse/hz));
>> +	}
>>  	if (tm->expires != 0) {
>>  		print_uint(PRINT_JSON, "expires", NULL, tm->expires);
>>  		print_uint(PRINT_FP, NULL, " expires %u sec",
>> 
>
> why does this function print different values for json and stdout?

It prints times in jiffies for json mode, and in seconds otherwise. This
inconsistency is likely a bug, and a subject for another fix.

Last time this function was touched in commit
2704bd62558391c00bc1c3e7f8706de8332d8ba0 where json was added.

  reply	other threads:[~2020-05-18 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 13:28 [PATCH iproute2-next 1/1] tc: report time an action was first used Roman Mashak
2020-05-18 13:10 ` Jamal Hadi Salim
2020-05-18 15:38   ` David Ahern
2020-05-19  9:09     ` Jamal Hadi Salim
2020-05-18 15:36 ` David Ahern
2020-05-18 16:41   ` Roman Mashak [this message]
2020-05-19 18:08     ` Stephen Hemminger
2020-05-19 18:09       ` David Ahern
2020-05-19 18:06 ` Stephen Hemminger
2020-05-19 18:11 ` David Ahern
2020-05-24 12:36   ` Roman Mashak

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

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

  git send-email \
    --in-reply-to=85pnb1mc0p.fsf@mojatatu.com \
    --to=mrv@mojatatu.com \
    --cc=dsahern@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kernel@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).