All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xenomai-help] Timing calculation
@ 2010-08-18 15:46 Prakash A S
  2010-08-18 15:51 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: Prakash A S @ 2010-08-18 15:46 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 2552 bytes --]

>
> prakash srinivasan wrote:
> >>>>> printf(TOTAL LOOP TIMING=%ld us\n",
> >>>>> (long)((rt_timer_ticks2ns(end-start))/1000);
> >>>> What does: printf(TOTAL LOOP TIMING=%lld us\n",
> >>>> rt_timer_ticks2ns(end-start)/1000); report.
> >>> TOTAL LOOP TIMING = 5377070 us In this case, the (unsigned)
> >>> (long) (long)tart returns 1069623206 and (unsigned) (long)
> >>> (long)end returns 2151726697
> >> Are you happy with that result? Did really pass approx. 5 seconds
> > between start and end?
>
> Could you format your mails correctly to make them readable? Use text,
> not HTML, truncate at 72 characters, and use > as a quotation mark,
> meaning that one '>' is the sign that you quote someone, two '>' is you
> quoting someone who quoted someone else, etc... I am really sorry to
> have to tell you about this, this is really basic knowledge of the
> netiquette, we should not have to tell you about it.
>
> > Definitely not and I am not confident about this output. Coz in this
> > loop period I am sending datas from client to the server. Visibly
> > noted that the server is getting all the datas within a second. So I
> > am not sure the 5 sec is the right output. I just like to know all
> > the above conversions are correct? and is it ok that the start ticks
> > can be more than the end ticks?
>
> The result of rt_timer_read is a long long, so, if you cast it to an
> unsigned, you loose the most significant bits. So, the result is totally
> meaningless. This again, is basic knowledge of the C language, we should
> not have to explain.
>
> Your bug report is quite insufficient, we do not even know what version
> of Xenomai you use, maybe you are reporting a bug which has been solved
> a long time ago. Neither do we know what version of Linux and of the
> Adoes patch you use, or the contents of your .config file. We do not
> have a self-contained example that we can run to try and reproduce your
> issue.
>
> So if you want some answers, please give us the means to answer you.
>

As an community person I AGREED with what you pointed out. My main
mistake was I subscribed the
mailing list with an useless mailID. Now I changed my mail ID. Surely
you will get the proper
quote in future. In between the mail change, I lost the continuation
for this topic and did not
get this reply mail to my new mail ID. Simply copy and pasted the last
mail from the archive.

Obviously I should improve my C language skills.

I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3

-Prakash

[-- Attachment #2: Type: text/html, Size: 3096 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-18 15:46 [Xenomai-help] Timing calculation Prakash A S
@ 2010-08-18 15:51 ` Gilles Chanteperdrix
  2010-08-19  7:51   ` Prakash A S
  2010-08-23  8:44   ` Gilles Chanteperdrix
  0 siblings, 2 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2010-08-18 15:51 UTC (permalink / raw)
  To: Prakash A S; +Cc: xenomai

Prakash A S wrote:
>     prakash srinivasan wrote:
>     >>>>> printf(TOTAL LOOP TIMING=%ld us\n",
>     >>>>> (long)((rt_timer_ticks2ns(end-start))/1000);
>     >>>> What does: printf(TOTAL LOOP TIMING=%lld us\n",
>     >>>> rt_timer_ticks2ns(end-start)/1000); report.
>     >>> TOTAL LOOP TIMING = 5377070 us In this case, the (unsigned)
>     >>> (long) (long)tart returns 1069623206 and (unsigned) (long)
>     >>> (long)end returns 2151726697
>     >> Are you happy with that result? Did really pass approx. 5 seconds
>     > between start and end?
> 
>     Could you format your mails correctly to make them readable? Use text,
>     not HTML, truncate at 72 characters, and use > as a quotation mark,
>     meaning that one '>' is the sign that you quote someone, two '>' is you
>     quoting someone who quoted someone else, etc... I am really sorry to
>     have to tell you about this, this is really basic knowledge of the
>     netiquette, we should not have to tell you about it.
> 
>     > Definitely not and I am not confident about this output. Coz in this
>     > loop period I am sending datas from client to the server. Visibly
>     > noted that the server is getting all the datas within a second. So I
>     > am not sure the 5 sec is the right output. I just like to know all
>     > the above conversions are correct? and is it ok that the start ticks
>     > can be more than the end ticks?
> 
>     The result of rt_timer_read is a long long, so, if you cast it to an
>     unsigned, you loose the most significant bits. So, the result is totally
>     meaningless. This again, is basic knowledge of the C language, we should
>     not have to explain.
> 
>     Your bug report is quite insufficient, we do not even know what version
>     of Xenomai you use, maybe you are reporting a bug which has been solved
>     a long time ago. Neither do we know what version of Linux and of the
>     Adoes patch you use, or the contents of your .config file. We do not
>     have a self-contained example that we can run to try and reproduce your
>     issue.
> 
>     So if you want some answers, please give us the means to answer you.
> 
> 
> As an community person I AGREED with what you pointed out. My main mistake was I subscribed the
> 
> mailing list with an useless mailID. Now I changed my mail ID. Surely you will get the proper 
> quote in future. In between the mail change, I lost the continuation for this topic and did not
> get this reply mail to my new mail ID. Simply copy and pasted the last mail from the archive.  

We still receive HTML.

> 
> Obviously I should improve my C language skills.
> 
> I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
> Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3

What about the kernel configuration and self-contained test exhibiting
the behaviour you do not understand?

-- 
					    Gilles.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-18 15:51 ` Gilles Chanteperdrix
@ 2010-08-19  7:51   ` Prakash A S
  2010-08-19  8:01     ` Gilles Chanteperdrix
  2010-08-23  8:44   ` Gilles Chanteperdrix
  1 sibling, 1 reply; 18+ messages in thread
From: Prakash A S @ 2010-08-19  7:51 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 3987 bytes --]

On Wed, Aug 18, 2010 at 9:21 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Prakash A S wrote:
> >     prakash srinivasan wrote:
> >     >>>>> printf(TOTAL LOOP TIMING=%ld us\n",
> >     >>>>> (long)((rt_timer_ticks2ns(end-start))/1000);
> >     >>>> What does: printf(TOTAL LOOP TIMING=%lld us\n",
> >     >>>> rt_timer_ticks2ns(end-start)/1000); report.
> >     >>> TOTAL LOOP TIMING = 5377070 us In this case, the (unsigned)
> >     >>> (long) (long)tart returns 1069623206 and (unsigned) (long)
> >     >>> (long)end returns 2151726697
> >     >> Are you happy with that result? Did really pass approx. 5 seconds
> >     > between start and end?
> >
> >     Could you format your mails correctly to make them readable? Use
> text,
> >     not HTML, truncate at 72 characters, and use > as a quotation mark,
> >     meaning that one '>' is the sign that you quote someone, two '>' is
> you
> >     quoting someone who quoted someone else, etc... I am really sorry to
> >     have to tell you about this, this is really basic knowledge of the
> >     netiquette, we should not have to tell you about it.
> >
> >     > Definitely not and I am not confident about this output. Coz in
> this
> >     > loop period I am sending datas from client to the server. Visibly
> >     > noted that the server is getting all the datas within a second. So
> I
> >     > am not sure the 5 sec is the right output. I just like to know all
> >     > the above conversions are correct? and is it ok that the start
> ticks
> >     > can be more than the end ticks?
> >
> >     The result of rt_timer_read is a long long, so, if you cast it to an
> >     unsigned, you loose the most significant bits. So, the result is
> totally
> >     meaningless. This again, is basic knowledge of the C language, we
> should
> >     not have to explain.
> >
> >     Your bug report is quite insufficient, we do not even know what
> version
> >     of Xenomai you use, maybe you are reporting a bug which has been
> solved
> >     a long time ago. Neither do we know what version of Linux and of the
> >     Adoes patch you use, or the contents of your .config file. We do not
> >     have a self-contained example that we can run to try and reproduce
> your
> >     issue.
> >
> >     So if you want some answers, please give us the means to answer you.
> >
> >
> > As an community person I AGREED with what you pointed out. My main
> mistake was I subscribed the
> >
> > mailing list with an useless mailID. Now I changed my mail ID. Surely you
> will get the proper
> > quote in future. In between the mail change, I lost the continuation for
> this topic and did not
> > get this reply mail to my new mail ID. Simply copy and pasted the last
> mail from the archive.
>
> We still receive HTML.
>

May be because of simply copy and pasted the old content in the last thread.

How about the scenario now?.


>
> >
> > Obviously I should improve my C language skills.
> >
> > I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
> > Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3
>
> What about the kernel configuration and self-contained test exhibiting
> the behaviour you do not understand?
>

My .config file is here, http://pastebin.ca/1919917
I tested and understand few test cases below.
switchtest : I am using Intel Dual core processor. ~5731 context switches
happening in a second
cyclictest : Tested with 10 threads. Maximum timer latency is 38us and
minimum is 1us
clocktest : Simply prints the time offset, drift value and wraps compare
with normal linux's gettimeofday(). Not much understand from this test.
latency : user mode latency test provides maximum latency time is 15us.
latency : kernel mode latency test provides maximum latency time is 3.6 us
latency : timer mode latency test provides maximum latency time is 3 us

Not much understand about the clocktest.
More helpful if we have any documentations for the all tests rather than how
to use the tests.

-Prakash

[-- Attachment #2: Type: text/html, Size: 5044 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-19  7:51   ` Prakash A S
@ 2010-08-19  8:01     ` Gilles Chanteperdrix
  2010-08-19 10:41       ` Prakash A S
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2010-08-19  8:01 UTC (permalink / raw)
  To: Prakash A S; +Cc: xenomai

Prakash A S wrote:
> On Wed, Aug 18, 2010 at 9:21 PM, Gilles Chanteperdrix <
>> We still receive HTML.
>>
> 
> May be because of simply copy and pasted the old content in the last thread.
> 
> How about the scenario now?.

Nope. Still multipart/alternative with HTML.

> 
> 
>>> Obviously I should improve my C language skills.
>>>
>>> I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
>>> Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3
>> What about the kernel configuration and self-contained test exhibiting
>> the behaviour you do not understand?
>>
> 
> My .config file is here, http://pastebin.ca/1919917

This .config is wrong: it has ACPI disabled.

> I tested and understand few test cases below.
> switchtest : I am using Intel Dual core processor. ~5731 context switches
> happening in a second
> cyclictest : Tested with 10 threads. Maximum timer latency is 38us and
> minimum is 1us
> clocktest : Simply prints the time offset, drift value and wraps compare
> with normal linux's gettimeofday(). Not much understand from this test.
> latency : user mode latency test provides maximum latency time is 15us.
> latency : kernel mode latency test provides maximum latency time is 3.6 us
> latency : timer mode latency test provides maximum latency time is 3 us

So, timing works correctly. If there was something wrong with time
keeping, you would have seen latency and switchtest drifting, and
printing infinitely increasing or decreasing latencies.

> 
> Not much understand about the clocktest.
> More helpful if we have any documentations for the all tests rather than how
> to use the tests.

The fact that ACPI must be enabled is documented, though you disabled
it, which proves that you do not read the documentation.

What I would like you is to do is to write a self-contained as simple as
possible test which exhibits the behaviour you find suspicious, and
publish it here so that I can try and reproduce this behaviour.

-- 
					    Gilles.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-19  8:01     ` Gilles Chanteperdrix
@ 2010-08-19 10:41       ` Prakash A S
  2010-08-19 11:14         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: Prakash A S @ 2010-08-19 10:41 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 3482 bytes --]

On Thu, Aug 19, 2010 at 1:31 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Prakash A S wrote:
> > On Wed, Aug 18, 2010 at 9:21 PM, Gilles Chanteperdrix <
> >> We still receive HTML.
> >>
> >
> > May be because of simply copy and pasted the old content in the last
> thread.
> >
> > How about the scenario now?.
>
> Nope. Still multipart/alternative with HTML.
>

Sorry, I have no clue why its happening.



>
> >
> >
> >>> Obviously I should improve my C language skills.
> >>>
> >>> I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
> >>> Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3
> >> What about the kernel configuration and self-contained test exhibiting
> >> the behaviour you do not understand?
> >>
> >
> > My .config file is here, http://pastebin.ca/1919917
>
> This .config is wrong: it has ACPI disabled.
>
>
I will enabled the ACPI, recompile the kernel and get back to you later.


> > I tested and understand few test cases below.
> > switchtest : I am using Intel Dual core processor. ~5731 context switches
> > happening in a second
> > cyclictest : Tested with 10 threads. Maximum timer latency is 38us and
> > minimum is 1us
> > clocktest : Simply prints the time offset, drift value and wraps compare
> > with normal linux's gettimeofday(). Not much understand from this test.
> > latency : user mode latency test provides maximum latency time is 15us.
> > latency : kernel mode latency test provides maximum latency time is 3.6
> us
> > latency : timer mode latency test provides maximum latency time is 3 us
>
> So, timing works correctly. If there was something wrong with time
> keeping, you would have seen latency and switchtest drifting, and
> printing infinitely increasing or decreasing latencies.
>

Valuable information.


>
> >
> > Not much understand about the clocktest.
> > More helpful if we have any documentations for the all tests rather than
> how
> > to use the tests.
>
> The fact that ACPI must be enabled is documented, though you disabled
> it, which proves that you do not read the documentation.
>

Let me know which document you are talking about?.
>From the beginners point of view, he/she is trying to install a software
successfully first and not to worry about the performance scale at initial
stage. In the kernel compilation part disabling power management option is
one of the usual step followed by the beginners. I did the same and later,
forgot that its an important factor.

Hope you remember that the issue was posted by another community person
regarding the booting issue after he compiled the kernel. I suggested to use
"noacpi" "nolapci" in boot argument.  Though the system was booted properly,
your suggestion was, not to use this option. Bcoz the kernel unable to use
ACPI. So we have two scenarios here.
[1]If we disable the ACPI in BIOS level then the kernel is booting properly.
But, the real time system can not use ACPI
[2] ACPI enabled. But system will not boot properly.

So how to resolve the above issue and please share if you have any specific
documents/guidelines/howto/articles on how this ACPI affects the normal
Linux and real time systems & why it is mandatory for xenomai.


>
> What I would like you is to do is to write a self-contained as simple as
> possible test which exhibits the behaviour you find suspicious, and
> publish it here so that I can try and reproduce this behaviour.
>
>
I will try such an simple example and get back to you later.

-Prakash

[-- Attachment #2: Type: text/html, Size: 4944 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-19 10:41       ` Prakash A S
@ 2010-08-19 11:14         ` Gilles Chanteperdrix
  0 siblings, 0 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2010-08-19 11:14 UTC (permalink / raw)
  To: Prakash A S; +Cc: xenomai

Prakash A S wrote:
> On Thu, Aug 19, 2010 at 1:31 PM, Gilles Chanteperdrix <
> gilles.chanteperdrix@xenomai.org> wrote:
> 
>> Prakash A S wrote:
>>> On Wed, Aug 18, 2010 at 9:21 PM, Gilles Chanteperdrix <
>>>> We still receive HTML.
>>>>
>>> May be because of simply copy and pasted the old content in the last
>> thread.
>>> How about the scenario now?.
>> Nope. Still multipart/alternative with HTML.
>>
> 
> Sorry, I have no clue why its happening.
> 
> 
> 
>>>
>>>>> Obviously I should improve my C language skills.
>>>>>
>>>>> I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
>>>>> Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3
>>>> What about the kernel configuration and self-contained test exhibiting
>>>> the behaviour you do not understand?
>>>>
>>> My .config file is here, http://pastebin.ca/1919917
>> This .config is wrong: it has ACPI disabled.
>>
>>
> I will enabled the ACPI, recompile the kernel and get back to you later.
> 
> 
>>> I tested and understand few test cases below.
>>> switchtest : I am using Intel Dual core processor. ~5731 context switches
>>> happening in a second
>>> cyclictest : Tested with 10 threads. Maximum timer latency is 38us and
>>> minimum is 1us
>>> clocktest : Simply prints the time offset, drift value and wraps compare
>>> with normal linux's gettimeofday(). Not much understand from this test.
>>> latency : user mode latency test provides maximum latency time is 15us.
>>> latency : kernel mode latency test provides maximum latency time is 3.6
>> us
>>> latency : timer mode latency test provides maximum latency time is 3 us
>> So, timing works correctly. If there was something wrong with time
>> keeping, you would have seen latency and switchtest drifting, and
>> printing infinitely increasing or decreasing latencies.
>>
> 
> Valuable information.

Well, not really, just common sense.

>>> Not much understand about the clocktest.
>>> More helpful if we have any documentations for the all tests rather than
>> how
>>> to use the tests.
>> The fact that ACPI must be enabled is documented, though you disabled
>> it, which proves that you do not read the documentation.
>>
> 
> Let me know which document you are talking about?.

It was repeated many times on this mailing list. Every time someone asks
about how to configure Xenomai on x86. Because a lot of people are doing
this error.

The document is:
http://www.xenomai.org/index.php/FAQs#Which_kernel_settings_should_be_avoided.3F

Which says to disable ACPI_PROCESSOR, not ACPI.

> From the beginners point of view, he/she is trying to install a software
> successfully first and not to worry about the performance scale at initial
> stage. In the kernel compilation part disabling power management option is
> one of the usual step followed by the beginners. I did the same and later,
> forgot that its an important factor.

If the beginner is not worried about performances, then it does not have
to disable power management.

Anyway, that is exactly my point: you did not read the documentations.
Because the documentations do not say to disable power management, they
say to disable CONFIG_APM and CONFIG_ACPI_PROCESSOR.
http://www.xenomai.org/index.php/FAQs#Which_kernel_settings_should_be_avoided.3F

And you did not read the mailing lists archives either.

> 
> Hope you remember that the issue was posted by another community person
> regarding the booting issue after he compiled the kernel. I suggested to use
> "noacpi" "nolapci" in boot argument.  Though the system was booted properly,
> your suggestion was, not to use this option. Bcoz the kernel unable to use
> ACPI. So we have two scenarios here.
> [1]If we disable the ACPI in BIOS level then the kernel is booting properly.
> But, the real time system can not use ACPI
> [2] ACPI enabled. But system will not boot properly.

No, it was noapic nolapic, you are confusing APIC and ACPI. And you can
get the system to boot without APIC, you simply have to disable it in
the kernel configuration. Disabling it at run-time will not work with
Xenomai. This too has been repeated many times on this mailing list. But
it is not advised, as written here:

http://www.xenomai.org/index.php/Embedded_Device_Support#x86

using APIC leads to better performances.

> 
> So how to resolve the above issue and please share if you have any specific
> documents/guidelines/howto/articles on how this ACPI affects the normal
> Linux and real time systems & why it is mandatory for xenomai.
> 

Keeping the ACPI enabled is not only about performances (one of its
sides effects is to disable the BIOS "legacy" power management, so some
SMIs sources), it is also a way to get the kernel to properly configure
some hardware details by reading them in the ACPI tables. When it fails
to do that, unexpected effect may be expected, ranging from interrupt
storms to boot failures. We experienced this in the past, you may find
traces in the mailing list archives.

-- 
					    Gilles.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-18 15:51 ` Gilles Chanteperdrix
  2010-08-19  7:51   ` Prakash A S
@ 2010-08-23  8:44   ` Gilles Chanteperdrix
  1 sibling, 0 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2010-08-23  8:44 UTC (permalink / raw)
  To: Prakash A S; +Cc: xenomai

Gilles Chanteperdrix wrote:
> Prakash A S wrote:
>>     prakash srinivasan wrote:
>>     >>>>> printf(TOTAL LOOP TIMING=%ld us\n",
>>     >>>>> (long)((rt_timer_ticks2ns(end-start))/1000);
>>     >>>> What does: printf(TOTAL LOOP TIMING=%lld us\n",
>>     >>>> rt_timer_ticks2ns(end-start)/1000); report.
>>     >>> TOTAL LOOP TIMING = 5377070 us In this case, the (unsigned)
>>     >>> (long) (long)tart returns 1069623206 and (unsigned) (long)
>>     >>> (long)end returns 2151726697
>>     >> Are you happy with that result? Did really pass approx. 5 seconds
>>     > between start and end?
>>
>>     Could you format your mails correctly to make them readable? Use text,
>>     not HTML, truncate at 72 characters, and use > as a quotation mark,
>>     meaning that one '>' is the sign that you quote someone, two '>' is you
>>     quoting someone who quoted someone else, etc... I am really sorry to
>>     have to tell you about this, this is really basic knowledge of the
>>     netiquette, we should not have to tell you about it.
>>
>>     > Definitely not and I am not confident about this output. Coz in this
>>     > loop period I am sending datas from client to the server. Visibly
>>     > noted that the server is getting all the datas within a second. So I
>>     > am not sure the 5 sec is the right output. I just like to know all
>>     > the above conversions are correct? and is it ok that the start ticks
>>     > can be more than the end ticks?
>>
>>     The result of rt_timer_read is a long long, so, if you cast it to an
>>     unsigned, you loose the most significant bits. So, the result is totally
>>     meaningless. This again, is basic knowledge of the C language, we should
>>     not have to explain.
>>
>>     Your bug report is quite insufficient, we do not even know what version
>>     of Xenomai you use, maybe you are reporting a bug which has been solved
>>     a long time ago. Neither do we know what version of Linux and of the
>>     Adoes patch you use, or the contents of your .config file. We do not
>>     have a self-contained example that we can run to try and reproduce your
>>     issue.
>>
>>     So if you want some answers, please give us the means to answer you.
>>
>>
>> As an community person I AGREED with what you pointed out. My main mistake was I subscribed the
>>
>> mailing list with an useless mailID. Now I changed my mail ID. Surely you will get the proper 
>> quote in future. In between the mail change, I lost the continuation for this topic and did not
>> get this reply mail to my new mail ID. Simply copy and pasted the last mail from the archive.  
> 
> We still receive HTML.
> 
>> Obviously I should improve my C language skills.
>>
>> I am using linux kernel 2.6.30.8 on Ubuntu 8.04,
>> Adeos-ipipe-2.6.30.8-x86-2.4-09.patch and Xenomai-2.5.3
> 
> What about the kernel configuration and self-contained test exhibiting
> the behaviour you do not understand?

Prakash, ping?

-- 
					    Gilles.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-13  4:19       ` prakash srinivasan
@ 2010-08-14 18:33         ` Gilles Chanteperdrix
  0 siblings, 0 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2010-08-14 18:33 UTC (permalink / raw)
  To: prakash srinivasan; +Cc: xenomai

prakash srinivasan wrote:
>>>>> printf(TOTAL LOOP TIMING=%ld us\n",
>>>>> (long)((rt_timer_ticks2ns(end-start))/1000);
>>>> What does: printf(TOTAL LOOP TIMING=%lld us\n",
>>>> rt_timer_ticks2ns(end-start)/1000); report.
>>> TOTAL LOOP TIMING = 5377070 us In this case, the (unsigned)
>>> (long) (long)tart returns 1069623206 and (unsigned) (long)
>>> (long)end returns 2151726697
>> Are you happy with that result? Did really pass approx. 5 seconds
> between start and end?

Could you format your mails correctly to make them readable? Use text,
not HTML, truncate at 72 characters, and use > as a quotation mark,
meaning that one '>' is the sign that you quote someone, two '>' is you
quoting someone who quoted someone else, etc... I am really sorry to
have to tell you about this, this is really basic knowledge of the
netiquette, we should not have to tell you about it.

> Definitely not and I am not confident about this output. Coz in this
> loop period I am sending datas from client to the server. Visibly
> noted that the server is getting all the datas within a second. So I
> am not sure the 5 sec is the right output. I just like to know all
> the above conversions are correct? and is it ok that the start ticks
> can be more than the end ticks?

The result of rt_timer_read is a long long, so, if you cast it to an
unsigned, you loose the most significant bits. So, the result is totally
meaningless. This again, is basic knowledge of the C language, we should
not have to explain.

Your bug report is quite insufficient, we do not even know what version
of Xenomai you use, maybe you are reporting a bug which has been solved
a long time ago. Neither do we know what version of Linux and of the
Adoes patch you use, or the contents of your .config file. We do not
have a self-contained example that we can run to try and reproduce your
issue.

So if you want some answers, please give us the means to answer you.

-- 
					    Gilles.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 19:13     ` Wolfgang Grandegger
@ 2010-08-13  4:19       ` prakash srinivasan
  2010-08-14 18:33         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: prakash srinivasan @ 2010-08-13  4:19 UTC (permalink / raw)
  To: wg; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

>>>> printf(TOTAL LOOP TIMING=%ld us\n", (long)((rt_timer_ticks2ns(end-start))/1000);



>>> What does:



>>> printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);



>>> report.





>> TOTAL LOOP TIMING = 5377070 us 



>> In this case, the (unsigned) (long) (long)tart returns 1069623206



>> and (unsigned) (long) (long)end returns 2151726697



>Are you happy with that result? Did really pass approx. 5 seconds



between start and end?



Definitely not and I am not confident about this output. Coz in this loop period I am sending datas from client to the server. Visibly noted that the server is getting all the datas within a second. So I am not sure the 5 sec is the right output. I just like to know all the above conversions are correct? and is it ok that the start ticks can be more than the end ticks?



-Prakash

[-- Attachment #2: Type: text/html, Size: 1374 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 15:38   ` asprakash_83
@ 2010-08-12 19:13     ` Wolfgang Grandegger
  2010-08-13  4:19       ` prakash srinivasan
  0 siblings, 1 reply; 18+ messages in thread
From: Wolfgang Grandegger @ 2010-08-12 19:13 UTC (permalink / raw)
  To: asprakash_83; +Cc: xenomai

On 08/12/2010 05:38 PM, asprakash_83 wrote:
> 
>>> printf(TOTAL LOOP TIMING=%ld us\n", (long)((rt_timer_ticks2ns(end-start))/1000);
> 
>> What does:
> 
>> printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);
> 
>> report.
> 
> TOTAL LOOP TIMING = 5377070 us 
> In this case, the (unsigned) (long) (long)tart returns 1069623206
> and (unsigned) (long) (long)end returns 2151726697

Are you happy with that result? Did really pass approx. 5 seconds
between start and end?

Wolfgang.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 12:04   ` Eric Noulard
@ 2010-08-12 16:00     ` prakash srinivasan
  0 siblings, 0 replies; 18+ messages in thread
From: prakash srinivasan @ 2010-08-12 16:00 UTC (permalink / raw)
  To: eric.noulard; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]



>I was trying to check the exact type of RTIME (return type of rt_timer_read()) and SRTIME (expectted argument type and return type of rt_timer_ticks2ns) and RTIME unsigned long long

>

>

>so theoretically you would need the "%lld" (long long) format for



rt_timer_ticks2ns returned value.



>whereas you would need "%llu" for rt_timer_read() value.



>If you try to print unsigned value with a signed format you'll get



signed "print out" interpretation of the unsigned value, as you said:



"Early I gave (long)(start). The output was negative."

>

>

>

>May be it would be worth having some RTIME_FORMAT and STRIME_FORMAT macros in order to avoid that?



Now I modified (unsigned)(long)(long) as return format for start and end. The output is,

Starting Time : 4295048924899

End time : 4297258900362

(long)(long)rt_timer_ticks2ns(end-start)= -1790994340162556031 





-Prakash

[-- Attachment #2: Type: text/html, Size: 1452 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 11:56 ` Wolfgang Grandegger
  2010-08-12 12:04   ` Eric Noulard
  2010-08-12 15:38   ` asprakash_83
@ 2010-08-12 15:46   ` prakash srinivasan
  2 siblings, 0 replies; 18+ messages in thread
From: prakash srinivasan @ 2010-08-12 15:46 UTC (permalink / raw)
  To: wg; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

>What does:

>printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);



>report.



TOTAL LOOP TIMING= 5377070 us

In this case (unsigned)(long)(long)start returns 1069623206 and (unsigned)(long)(long)end returns 2151726697



-Prakash

[-- Attachment #2: Type: text/html, Size: 700 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 11:56 ` Wolfgang Grandegger
  2010-08-12 12:04   ` Eric Noulard
@ 2010-08-12 15:38   ` asprakash_83
  2010-08-12 19:13     ` Wolfgang Grandegger
  2010-08-12 15:46   ` prakash srinivasan
  2 siblings, 1 reply; 18+ messages in thread
From: asprakash_83 @ 2010-08-12 15:38 UTC (permalink / raw)
  To: wg; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]



>> printf(TOTAL LOOP TIMING=%ld us\n", (long)((rt_timer_ticks2ns(end-start))/1000);



>What does:



>printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);



>report.



TOTAL LOOP TIMING = 5377070 us 

In this case, the (unsigned) (long) (long)tart returns 1069623206

and (unsigned) (long) (long)end returns 2151726697



-Prakash








[-- Attachment #2: Type: text/html, Size: 863 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 11:56 ` Wolfgang Grandegger
@ 2010-08-12 12:04   ` Eric Noulard
  2010-08-12 16:00     ` prakash srinivasan
  2010-08-12 15:38   ` asprakash_83
  2010-08-12 15:46   ` prakash srinivasan
  2 siblings, 1 reply; 18+ messages in thread
From: Eric Noulard @ 2010-08-12 12:04 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: Xenomai help

2010/8/12 Wolfgang Grandegger <wg@domain.hid>:
> On 08/12/2010 11:39 AM, prakash srinivasan wrote:

>>
>> start=rt_timer_read();
>>
>> for()
>>
>> {}
>>
>> end=rt_timer_read();
>>
>> printf(TOTAL LOOP TIMING=%ld us\n", (long)((rt_timer_ticks2ns(end-start))/1000);
>
> What does:
>
>  printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);

I was trying to check the exact type of
 RTIME (return type of rt_timer_read())
and
SRTIME (expectted argument type and return type of rt_timer_ticks2ns)
and
RTIME unsigned long long

so theoretically you would need the "%lld" (long long) format for
rt_timer_ticks2ns returned value.

whereas you would need "%llu" for rt_timer_read() value.

If you try to print unsigned value with a signed format you'll get
signed "print out" interpretation of the unsigned value,
as you said:
"Early I gave (long)(start). The output was negative."

May be it would be worth having some RTIME_FORMAT
and STRIME_FORMAT macros in order to avoid that?
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


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

* Re: [Xenomai-help] Timing calculation
  2010-08-12  9:39 prakash srinivasan
  2010-08-12 10:11 ` Eric Noulard
@ 2010-08-12 11:56 ` Wolfgang Grandegger
  2010-08-12 12:04   ` Eric Noulard
                     ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: Wolfgang Grandegger @ 2010-08-12 11:56 UTC (permalink / raw)
  To: prakash srinivasan; +Cc: xenomai

On 08/12/2010 11:39 AM, prakash srinivasan wrote:
> Deal All,
> 
>        I am executing a simple for() loop and like to calculate the time period for this loop. I used rt_timer_read(). As per the document, it mentioned that rt_timer_read() returns the current time expressed in clock ticks. I could not able to get an clear idea about it. Suppose if i convert it by using rt_timer_ticks2ns(), I am not getting the proper output. My code is,
> 
> 
> 
> RTIME start, end;
> 
> ...
> 
> ...
> 
> start=rt_timer_read();
> 
> for()
> 
> {}
> 
> end=rt_timer_read();
> 
> printf(TOTAL LOOP TIMING=%ld us\n", (long)((rt_timer_ticks2ns(end-start))/1000);

What does:

  printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);

report.

Wolfgang.


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

* Re: [Xenomai-help] Timing calculation
  2010-08-12 10:11 ` Eric Noulard
@ 2010-08-12 11:32   ` prakash srinivasan
  0 siblings, 0 replies; 18+ messages in thread
From: prakash srinivasan @ 2010-08-12 11:32 UTC (permalink / raw)
  To: eric.noulard; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]





On Thu, 12 Aug 2010 15:46:51 +0530  wrote

>>2010/8/12 prakash srinivasan 

>>

>> Deal All,

>> I am executing a simple for() loop and like to calculate the time period for this loop. I used rt_timer_read(). As per the document, it mentioned that rt_timer_read() returns the current time expressed in clock ticks. I could not able to get an clear idea about it. Suppose if i convert it by using rt_timer_ticks2ns(), I am not getting the proper output. My code is,



>> RTIME start, end;

>> ...

>> ...

>> start=rt_timer_read();

>> for()

>> {}

>> end=rt_timer_read();

>> printf(TOTAL LOOP TIMING=%ld usn", (long)((rt_timer_ticks2ns(end-start))/1000);

>>

>> I would like to convert the ticks into nano seconds first and then into micro seconds. The final result is irrelevant. I am not sure, where is the issue. Help me to find the timings details properly.



>Irrelevant how? Not repeatable?



Early I gave (long)(start). The output was in negative.



>What are the printed values?

>Did you try without rt_timer_ticks2ns first?



Output without rt_time_ticks2ns()::



printf("Starting time: %ld\n",(long)start);

Starting time: 445465374

printf("End time: %ld\n",(long)end);

End time: 927680697

printf (Difference time:%ld\n",(long)(end-start))

Difference time: 482215323



Output with rt_timer_ticks2ns()::



printf("Starting time: %ld\n",(long)rt_timer_ticks2ns(start));

Starting time: -2090279950

printf("End time: %ld\n",(long)rt_timer_ticks2ns(end));

End time: -1168915612

printf (Difference time:%ld\n",(long)rt_timer_ticks2ns(end-start))

Difference time: 921364338



whether my call is correct, (long) rt_timerticks2ns(end-start)?



-Prakash

[-- Attachment #2: Type: text/html, Size: 2375 bytes --]

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

* Re: [Xenomai-help] Timing calculation
  2010-08-12  9:39 prakash srinivasan
@ 2010-08-12 10:11 ` Eric Noulard
  2010-08-12 11:32   ` prakash srinivasan
  2010-08-12 11:56 ` Wolfgang Grandegger
  1 sibling, 1 reply; 18+ messages in thread
From: Eric Noulard @ 2010-08-12 10:11 UTC (permalink / raw)
  To: prakash srinivasan; +Cc: Xenomai help

2010/8/12 prakash srinivasan <asprakash_83@domain.hid>
>
> Deal All,
> I am executing a simple for() loop and like to calculate the time period for this loop. I used rt_timer_read(). As per the document, it mentioned that rt_timer_read() returns the current time expressed in clock ticks. I could not able to get an clear idea about it. Suppose if i convert it by using rt_timer_ticks2ns(), I am not getting the proper output. My code is,
>
> RTIME start, end;
> ...
> ...
> start=rt_timer_read();
> for()
> {}
> end=rt_timer_read();
> printf(TOTAL LOOP TIMING=%ld usn", (long)((rt_timer_ticks2ns(end-start))/1000);
>
> I would like to convert the ticks into nano seconds first and then into micro seconds. The final result is irrelevant. I am not sure, where is the issue. Help me to find the timings details properly.

Irrelevant how? Not repeatable?
What are the printed values?

Did you try without rt_timer_ticks2ns first?

Did you see the note on rt_timer_read() ?
http://www.xenomai.org/documentation/xenomai-2.5/html/api/group__native__timer.html#g9665d6947e29d1a19dafb5401b0f6285
Note:
    The value returned will represent a count of jiffies if the native
skin is bound to a periodic time base (see
CONFIG_XENO_OPT_NATIVE_PERIOD), or nanoseconds otherwise.

> In the example program trivial-periodic.c, they mentioned
>
> "NOTE: printf may have unexpected impact on the timing of your program. It is used here in the critical loop only for demonstration purposes."
> Why?

Because printf is a complicated function ending up with syscalls which
would make you switch to secondar mode etc.... (you can search the ML
for answers on this subject).

Note that in your case the printf is after the loop (and timer read) so this
must not be the problem.

--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


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

* [Xenomai-help] Timing calculation
@ 2010-08-12  9:39 prakash srinivasan
  2010-08-12 10:11 ` Eric Noulard
  2010-08-12 11:56 ` Wolfgang Grandegger
  0 siblings, 2 replies; 18+ messages in thread
From: prakash srinivasan @ 2010-08-12  9:39 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

Deal All,

       I am executing a simple for() loop and like to calculate the time period for this loop. I used rt_timer_read(). As per the document, it mentioned that rt_timer_read() returns the current time expressed in clock ticks. I could not able to get an clear idea about it. Suppose if i convert it by using rt_timer_ticks2ns(), I am not getting the proper output. My code is,



RTIME start, end;

...

...

start=rt_timer_read();

for()

{}

end=rt_timer_read();

printf(TOTAL LOOP TIMING=%ld us\n", (long)((rt_timer_ticks2ns(end-start))/1000);



I would like to convert the ticks into nano seconds first and then into micro seconds. The final result is irrelevant. I am not sure, where is the issue. Help me to find the timings details properly.



In the example program trivial-periodic.c, they mentioned 



"NOTE: printf may have unexpected impact on the timing of your program. It is used here in the critical loop only for demonstration purposes."



Why?

 



-Prakash 



  

[-- Attachment #2: Type: text/html, Size: 1533 bytes --]

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

end of thread, other threads:[~2010-08-23  8:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-18 15:46 [Xenomai-help] Timing calculation Prakash A S
2010-08-18 15:51 ` Gilles Chanteperdrix
2010-08-19  7:51   ` Prakash A S
2010-08-19  8:01     ` Gilles Chanteperdrix
2010-08-19 10:41       ` Prakash A S
2010-08-19 11:14         ` Gilles Chanteperdrix
2010-08-23  8:44   ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2010-08-12  9:39 prakash srinivasan
2010-08-12 10:11 ` Eric Noulard
2010-08-12 11:32   ` prakash srinivasan
2010-08-12 11:56 ` Wolfgang Grandegger
2010-08-12 12:04   ` Eric Noulard
2010-08-12 16:00     ` prakash srinivasan
2010-08-12 15:38   ` asprakash_83
2010-08-12 19:13     ` Wolfgang Grandegger
2010-08-13  4:19       ` prakash srinivasan
2010-08-14 18:33         ` Gilles Chanteperdrix
2010-08-12 15:46   ` prakash srinivasan

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.