Message ID | 20220713204623.5443-1-wsa+renesas@sang-engineering.com |
---|---|
Headers | show |
Series | selftests: timers: fixes and improvements | expand |
On Wed, Jul 13, 2022 at 1:46 PM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > > So the user can decide how long the test should run. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > --- > tools/testing/selftests/timers/clocksource-switch.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c > index 5256e6215980..a1d0d33738b6 100644 > --- a/tools/testing/selftests/timers/clocksource-switch.c > +++ b/tools/testing/selftests/timers/clocksource-switch.c > @@ -124,14 +124,18 @@ int main(int argc, char **argv) > char orig_clk[512]; > int count, i, status, opt; > int do_sanity_check = 1; > + int runtime = 60; > pid_t pid; > > /* Process arguments */ > - while ((opt = getopt(argc, argv, "s")) != -1) { > + while ((opt = getopt(argc, argv, "st:")) != -1) { > switch (opt) { > case 's': > do_sanity_check = 0; > break; > + case 't': > + runtime = atoi(optarg); > + break; > default: > printf("Usage: %s [-s]\n", argv[0]); > printf(" -s: skip sanity checks\n"); Ah, one minor nit: Should the -t option get documented here in the usage output? thanks again! -john
On 7/13/22 3:02 PM, John Stultz wrote: > On Wed, Jul 13, 2022 at 1:46 PM Wolfram Sang > <wsa+renesas@sang-engineering.com> wrote: >> >> The timer selftests are quite useful for me when enabling timers on new >> SoCs, e.g. like now with the CMT timer on a Renesas R-Car S4-8. During >> development, I needed these fixes and additions to make full use of >> the tests. I think they make all sense upstream, so here they are. >> >> Patches are based on v5.19-rc1. Looking forward to comments. >> > > Hey! > Thanks so much I really appreciate the effort to make and send out > these cleanups. From the initial skim it all looks great (though, some > are slightly embarrassing :), and I think some of the extra config > args will be quite nice for others to use as well. > > Acked-by: John Stultz <jstultz@google.com> > > Thanks so much for submitting these. > -john > Thank you both. I can queue these for 5.20-rc1 Wolfram, are you going to send v2 to address John's comment on 8/9? thanks, -- Shuah
Hello! On 7/13/22 11:46 PM, Wolfram Sang wrote: > So the user can decide how long the test should run. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > --- > tools/testing/selftests/timers/clocksource-switch.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c > index 5256e6215980..a1d0d33738b6 100644 > --- a/tools/testing/selftests/timers/clocksource-switch.c > +++ b/tools/testing/selftests/timers/clocksource-switch.c [...] > - while ((opt = getopt(argc, argv, "s")) != -1) { > + while ((opt = getopt(argc, argv, "st:")) != -1) { > switch (opt) { > case 's': > do_sanity_check = 0; > break; > + case 't': > + runtime = atoi(optarg); > + break; > default: > printf("Usage: %s [-s]\n", argv[0]); > printf(" -s: skip sanity checks\n"); Hm, you probably forgot to update the usage msg? [...] MBR, Sergey
> > default: > > printf("Usage: %s [-s]\n", argv[0]); > > printf(" -s: skip sanity checks\n"); > > Hm, you probably forgot to update the usage msg? Yup, thanks!
> Wolfram, are you going to send v2 to address John's comment on > 8/9? Yes, will do!