Hi Richard, On Fri, 2022-03-04 at 12:35 +0100, Richard Weinberger via Xenomai wrote: > Hello, > > I'm investigating into a cyclictest issue where it reports negative values > just like this commit states: > https://source.denx.de/Xenomai/xenomai/-/commit/3069a7bbc48559f4d2a6184d6159b771f193a4e9
Ipipe or Dovetail? Does running "autotune" help? > > Since I'm on Xenomai 3.1.2 the said commit is already included. > But I have a hard time to understand what problem the commit actually fixes. > Why is the old calculation wrong? old code: In case the second wrapped we have ts1.nsec = <small> (we consider t1 to be the later point in time) ts2.nsec = <big> diff += t1 - t2 is now negative. Right? > > PREEMPT_RT's rt-test does it the same way: > https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/tree/src/include/rt-utils.h#n60 > > Except that it casts tv_secs/tv_nsecs to int first, which shouldn't make a > difference. > > Thanks, > //richard >
