[LTP] [PATCH v3 3/4] tst_timer: Create interface for using multiple timers

Cyril Hrubis chrubis@suse.cz
Thu Aug 16 14:59:53 CEST 2018


Hi!
> Well if the clock is not supported and the call fails, then the user
> will have to deal with that at the call site of tst_timer_start which is
> not very convenient for tst_fuzzy_sync. I would rather have a seperate
> initialisation function for the tst_timer struct which can be called in
> the setup function. e.g. tst_timer_init[_st](clock_id, timeout, ...).
> 
> >
> > And lastly but not least, we were also discussion special timer id,
> > something as TST_TIMER_DEFAULT that would select appropriate timer,
> > althoug I guess that CLOCK_MONOTONIC is supporoted on anything that we
> > care for these days.
> 
> Yeah, fuzzy_sync just defines CLOCK_MONOTIC to CLOCK_MONOTONIC_RAW if
> possible and uses that. Not had any reports of CLOCK_MONOTONIC being
> unavailabe.

Maybe we can just do:

#ifdef CLOCK_MONOTONIC_RAW
# define TST_CLOCK_DEFAULT CLOCK_MONOTONIC_RAW
#else
# define TST_CLOCK_DEFAULT CLOCK_MONOTONIC
#endif

And be done with it.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list