From: Stephen Hemminger <stephen@networkplumber.org>
To: Roman Mashak <mrv@mojatatu.com>
Cc: David Ahern <dsahern@gmail.com>,
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: Tue, 19 May 2020 11:08:35 -0700 [thread overview]
Message-ID: <20200519110835.2cac3bda@hermes.lan> (raw)
In-Reply-To: <85pnb1mc0p.fsf@mojatatu.com>
On Mon, 18 May 2020 12:41:10 -0400
Roman Mashak <mrv@mojatatu.com> wrote:
> 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.
iproute commands are not supposed to expose the jiffies version of
times in input or output.
next prev parent reply other threads:[~2020-05-19 18:08 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
2020-05-19 18:08 ` Stephen Hemminger [this message]
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=20200519110835.2cac3bda@hermes.lan \
--to=stephen@networkplumber.org \
--cc=dsahern@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=mrv@mojatatu.com \
--cc=netdev@vger.kernel.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).