From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCh v2] clock_gettime04: print more info to help debugging
Date: Wed, 10 Mar 2021 11:11:10 +0100 [thread overview]
Message-ID: <YEibPvXnSpGceN/e@pevik> (raw)
In-Reply-To: <20210310084304.d6b626clzj5rafvh@vireshk-i7>
Hi Li, Viresh, Cyril,
> On 10-03-21, 16:34, Li Wang wrote:
> > But we can put the printing behind the 'gettimeofday+CLOCK_REALTIME'
> > checking.
> > Just similar to what I did in patch V1, is that your mean, Petr?
> > --- a/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
> > +++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime04.c
> > @@ -108,6 +108,9 @@ static void run(unsigned int i)
> > if (tv->clock_gettime == my_gettimeofday && clks[i]
> > != CLOCK_REALTIME)
> > continue;
> > + if (count == 10000)
> > + tst_res(TINFO, "\t- %s", tv->desc);
> > +
> > ret = tv->clock_gettime(clks[i], tst_ts_get(&ts));
> > if (ret) {
> > /*
> > @@ -139,8 +142,8 @@ static void run(unsigned int i)
> > diff = end + slack - start;
> > if (diff < 0) {
> > - tst_res(TFAIL, "%s: Time travelled
> > backwards (%d): %lld ns",
> > - tst_clock_name(clks[i]), j, diff);
> > + tst_res(TFAIL, "%s(%s): Time travelled
> > backwards (%d): %lld ns",
> > + tst_clock_name(clks[i]), tv->desc,
> > j, diff);
> > return;
> > }
> I think it would be worth keeping it simple then and just print all
> variants only once from setup(). Leave the special case of REALTIME
> clock.
+1.
From a long term, I'd like some easy solution when printing would be handled in
the library. Some time ago I posted a patch which turned .test_variants from int
into array of string description [1]. Cyril didn't see much value at it and
didn't like that it introduced more ifdefs (together with Viresh).
But now we have docparse, could we reconsider this approach? Maybe we could keep
.test_variants and introduce .test_variants_desc for tests which are simple enough.
Or, maybe there is a cleaner solution for clock_adjtime0* tests which I don't
see.
Kind regards,
Petr
[1] https://patchwork.ozlabs.org/project/ltp/patch/20200519120725.25750-1-pvorel@suse.cz/
next prev parent reply other threads:[~2021-03-10 10:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 8:00 [LTP] [PATCh v2] clock_gettime04: print more info to help debugging Li Wang
2021-03-09 9:45 ` Viresh Kumar
2021-03-09 11:52 ` Petr Vorel
2021-03-09 11:56 ` Viresh Kumar
2021-03-10 8:34 ` Li Wang
2021-03-10 8:43 ` Viresh Kumar
2021-03-10 10:11 ` Petr Vorel [this message]
2021-03-10 12:12 ` Li Wang
2021-03-10 13:11 ` Petr Vorel
2021-03-10 13:32 ` Li Wang
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=YEibPvXnSpGceN/e@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.