* [Xenomai-help] RTDM timing problems
@ 2006-01-30 18:11 Rodrigo Rosenfeld Rosas
2006-01-30 18:42 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Rodrigo Rosenfeld Rosas @ 2006-01-30 18:11 UTC (permalink / raw)
To: xenomai
Hi,
I just can't understand what is happening.
The above code on my driver initialization gives the following results.
start_time = rtdm_clock_read();
rtdm_task_busy_sleep(43000);
temp_time = rtdm_clock_read();
rtdm_printk(KERN_INFO "%u - %u = %u\n",(unsigned int) temp_time, (unsigned
int) start_time, (unsigned int) (temp_time-start_time));
rtdm_printk(KERN_INFO "%u - %u = %u\n",(unsigned int)
(temp_time&0xffffffff), (unsigned int) start_time&0xffffffff, (unsigned int)
((temp_time-start_time)&0xffffffff));
As I expected, both printk gave the same (wrong?) result:
3175950208 - 2800623168 = 375327040
I was waiting something near to 43000, shouldn't I?
Please, can someone explain me what is going on...
Thanks,
Rodrigo.
_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [Xenomai-help] RTDM timing problems
2006-01-30 18:11 [Xenomai-help] RTDM timing problems Rodrigo Rosenfeld Rosas
@ 2006-01-30 18:42 ` Jan Kiszka
2006-01-30 23:17 ` Jeroen Van den Keybus
2006-02-02 12:46 ` Rodrigo Rosenfeld Rosas
0 siblings, 2 replies; 8+ messages in thread
From: Jan Kiszka @ 2006-01-30 18:42 UTC (permalink / raw)
To: Rodrigo Rosenfeld Rosas; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]
Rodrigo Rosenfeld Rosas wrote:
> Hi,
>
> I just can't understand what is happening.
>
> The above code on my driver initialization gives the following results.
>
> start_time = rtdm_clock_read();
> rtdm_task_busy_sleep(43000);
> temp_time = rtdm_clock_read();
> rtdm_printk(KERN_INFO "%u - %u = %u\n",(unsigned int) temp_time, (unsigned
> int) start_time, (unsigned int) (temp_time-start_time));
>
> rtdm_printk(KERN_INFO "%u - %u = %u\n",(unsigned int)
> (temp_time&0xffffffff), (unsigned int) start_time&0xffffffff, (unsigned int)
> ((temp_time-start_time)&0xffffffff));
>
>
> As I expected, both printk gave the same (wrong?) result:
> 3175950208 - 2800623168 = 375327040
>
> I was waiting something near to 43000, shouldn't I?
>
> Please, can someone explain me what is going on...
>
Basically confirmed:
I-pipe: Domain Xenomai registered.
Xenomai: hal/x86 started.
Xenomai: real-time nucleus v2.1-rc2 (Champagne) loaded.
Xenomai: starting RTDM services.
4194262080 - 2680902336 = 1513359744
But when I additionally load xeno_posix to get the system timer started:
Xenomai: starting POSIX services.
3899754503 - 3899706087 = 48416
The point is that rtdm_clock_read() relies on the nucleus timer being
started. Otherwise, it just returns plain wrong numbers.
This makes me scream again for that damn timer being started
AUTOMATICALLY! I guess Philippe knows what I'm talking about... ;)
Meanwhile, we should state this in the docs. At least for 2.0.x, this
will remain true anyway.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] RTDM timing problems
2006-01-30 18:42 ` Jan Kiszka
@ 2006-01-30 23:17 ` Jeroen Van den Keybus
2006-01-31 9:46 ` Jan Kiszka
2006-02-02 12:46 ` Rodrigo Rosenfeld Rosas
1 sibling, 1 reply; 8+ messages in thread
From: Jeroen Van den Keybus @ 2006-01-30 23:17 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
Jan,
Can't you start it with a short Linux user-space app upon startup ? Doesn't
even need to go realtime.
I'm planning to try this as I want to start two unrelated Xenomai processes
which need the timer for timeouts (obviously in a perpetual effort to test
the Xenomai kernel ;-))
Jeroen.
This makes me scream again for that damn timer being started
> AUTOMATICALLY! I guess Philippe knows what I'm talking about... ;)
> Meanwhile, we should state this in the docs. At least for 2.0.x, this
> will remain true anyway.
>
[-- Attachment #2: Type: text/html, Size: 812 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] RTDM timing problems
2006-01-30 18:42 ` Jan Kiszka
2006-01-30 23:17 ` Jeroen Van den Keybus
@ 2006-02-02 12:46 ` Rodrigo Rosenfeld Rosas
2006-02-02 12:48 ` Jan Kiszka
1 sibling, 1 reply; 8+ messages in thread
From: Rodrigo Rosenfeld Rosas @ 2006-02-02 12:46 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
Em Segunda 30 Janeiro 2006 16:42, Jan Kiszka escreveu:
>The point is that rtdm_clock_read() relies on the nucleus timer being
>started. Otherwise, it just returns plain wrong numbers.
>
>This makes me scream again for that damn timer being started
>AUTOMATICALLY! I guess Philippe knows what I'm talking about... ;)
>Meanwhile, we should state this in the docs. At least for 2.0.x, this
>will remain true anyway.
What can I do for now? What is the relation between the system time and the
timer?
Thank you Jan,
Rodrigo.
_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] RTDM timing problems
2006-02-02 12:46 ` Rodrigo Rosenfeld Rosas
@ 2006-02-02 12:48 ` Jan Kiszka
2006-02-02 15:23 ` Rodrigo Rosenfeld Rosas
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2006-02-02 12:48 UTC (permalink / raw)
To: Rodrigo Rosenfeld Rosas; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 669 bytes --]
Rodrigo Rosenfeld Rosas wrote:
> Em Segunda 30 Janeiro 2006 16:42, Jan Kiszka escreveu:
>
>> The point is that rtdm_clock_read() relies on the nucleus timer being
>> started. Otherwise, it just returns plain wrong numbers.
>>
>> This makes me scream again for that damn timer being started
>> AUTOMATICALLY! I guess Philippe knows what I'm talking about... ;)
>> Meanwhile, we should state this in the docs. At least for 2.0.x, this
>> will remain true anyway.
>
> What can I do for now? What is the relation between the system time and the
> timer?
Just start the timer before using rtdm_clock_read(). This is now also
stated in the docs.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] RTDM timing problems
2006-02-02 12:48 ` Jan Kiszka
@ 2006-02-02 15:23 ` Rodrigo Rosenfeld Rosas
2006-02-02 16:26 ` Jan Kiszka
0 siblings, 1 reply; 8+ messages in thread
From: Rodrigo Rosenfeld Rosas @ 2006-02-02 15:23 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
Em Quinta 02 Fevereiro 2006 10:48, voc=EA escreveu:
>Rodrigo Rosenfeld Rosas wrote:
>> Em Segunda 30 Janeiro 2006 16:42, Jan Kiszka escreveu:
>>> The point is that rtdm_clock_read() relies on the nucleus timer being
>>> started. Otherwise, it just returns plain wrong numbers.
>>>
>>> This makes me scream again for that damn timer being started
>>> AUTOMATICALLY! I guess Philippe knows what I'm talking about... ;)
>>> Meanwhile, we should state this in the docs. At least for 2.0.x, this
>>> will remain true anyway.
>>
>> What can I do for now? What is the relation between the system time and
>> the timer?
>
>Just start the timer before using rtdm_clock_read().
Sorry, It is not clear to me how can I do that.
Regards,
Rodrigo.
_______________________________________________________
Yahoo! doce lar. Faça do Yahoo! sua homepage.
http://br.yahoo.com/homepageset.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] RTDM timing problems
2006-02-02 15:23 ` Rodrigo Rosenfeld Rosas
@ 2006-02-02 16:26 ` Jan Kiszka
0 siblings, 0 replies; 8+ messages in thread
From: Jan Kiszka @ 2006-02-02 16:26 UTC (permalink / raw)
To: Rodrigo Rosenfeld Rosas; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]
Rodrigo Rosenfeld Rosas wrote:
> Em Quinta 02 Fevereiro 2006 10:48, você escreveu:
>
>> Rodrigo Rosenfeld Rosas wrote:
>>> Em Segunda 30 Janeiro 2006 16:42, Jan Kiszka escreveu:
>>>> The point is that rtdm_clock_read() relies on the nucleus timer being
>>>> started. Otherwise, it just returns plain wrong numbers.
>>>>
>>>> This makes me scream again for that damn timer being started
>>>> AUTOMATICALLY! I guess Philippe knows what I'm talking about... ;)
>>>> Meanwhile, we should state this in the docs. At least for 2.0.x, this
>>>> will remain true anyway.
>>> What can I do for now? What is the relation between the system time and
>>> the timer?
>> Just start the timer before using rtdm_clock_read().
>
> Sorry, It is not clear to me how can I do that.
rt_timer_start() if you use the native API in your application. But I
would suggest to maintain a simple helper tool just for starting /
stopping the timer for native apps as long as this is explicitly needed.
As I indicated, plans exist to overcome this in 2.1.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-02-02 16:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 18:11 [Xenomai-help] RTDM timing problems Rodrigo Rosenfeld Rosas
2006-01-30 18:42 ` Jan Kiszka
2006-01-30 23:17 ` Jeroen Van den Keybus
2006-01-31 9:46 ` Jan Kiszka
2006-02-02 12:46 ` Rodrigo Rosenfeld Rosas
2006-02-02 12:48 ` Jan Kiszka
2006-02-02 15:23 ` Rodrigo Rosenfeld Rosas
2006-02-02 16:26 ` Jan Kiszka
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.