linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CLOCK_MONOTONIC issue
@ 2015-06-22 11:06 Giuliano Colla
  2015-06-22 11:40 ` Richard Cochran
  0 siblings, 1 reply; 3+ messages in thread
From: Giuliano Colla @ 2015-06-22 11:06 UTC (permalink / raw)
  To: linux-rt-users

Hi all,

in order both to profile the performance of my rt threads, and to 
perform timed operations (such as sem_timedwait), I'm using the 
clock_gettime() function.

Using as a parameter CLOCK_REALTIME everything appears to work as 
expected, but if I attempt to use CLOCK_MONOTONIC (which should be a 
more reliable timing source, from what I read), I get bogus times.

This occurs on different platforms, and with different kernel 
versions/rt patch. (3.10.10-rt7 - 3.10.67-rt71 - 3.12.31-rt45).

Am I missing something obvious, such as a kernel misconfiguration, or 
this is something to be expected?

Any hint will be appreciated.

Thanks in advance,

Giuliano

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CLOCK_MONOTONIC issue
  2015-06-22 11:06 CLOCK_MONOTONIC issue Giuliano Colla
@ 2015-06-22 11:40 ` Richard Cochran
  2015-06-22 12:42   ` Giuliano Colla
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Cochran @ 2015-06-22 11:40 UTC (permalink / raw)
  To: Giuliano Colla; +Cc: linux-rt-users

On Mon, Jun 22, 2015 at 01:06:28PM +0200, Giuliano Colla wrote:
> Using as a parameter CLOCK_REALTIME everything appears to work as expected,
> but if I attempt to use CLOCK_MONOTONIC (which should be a more reliable
> timing source, from what I read), I get bogus times.

What do you mean by "bogus times"?

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CLOCK_MONOTONIC issue
  2015-06-22 11:40 ` Richard Cochran
@ 2015-06-22 12:42   ` Giuliano Colla
  0 siblings, 0 replies; 3+ messages in thread
From: Giuliano Colla @ 2015-06-22 12:42 UTC (permalink / raw)
  To: linux-rt-users

Il 22/06/2015 13:40, Richard Cochran ha scritto:
> On Mon, Jun 22, 2015 at 01:06:28PM +0200, Giuliano Colla wrote:
>> Using as a parameter CLOCK_REALTIME everything appears to work as expected,
>> but if I attempt to use CLOCK_MONOTONIC (which should be a more reliable
>> timing source, from what I read), I get bogus times.
> What do you mean by "bogus times"?

I mean that the timing of sem_timedwait() appears to be inconsistent 
with the requested values.
But I believe I've found the reason in the meantime.
According the documentation, sem_timedwait() uses CLOCK_REALTIME, and it 
would appear that it can't be configured differently.
If I supply an absolute time value calculated from a different clock 
source, of course I'm bound to find inconsistencies!

Thanks however.

Giuliano


--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-22 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22 11:06 CLOCK_MONOTONIC issue Giuliano Colla
2015-06-22 11:40 ` Richard Cochran
2015-06-22 12:42   ` Giuliano Colla

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).