Re: [Xenomai-help] Timing calculation

2010-08-23 Thread Gilles Chanteperdrix
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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-19 Thread Prakash A S
On Wed, Aug 18, 2010 at 9:21 PM, Gilles Chanteperdrix 
gilles.chanteperd...@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
___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-19 Thread Gilles Chanteperdrix
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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-19 Thread Prakash A S
On Thu, Aug 19, 2010 at 1:31 PM, Gilles Chanteperdrix 
gilles.chanteperd...@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
___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-19 Thread Gilles Chanteperdrix
Prakash A S wrote:
 On Thu, Aug 19, 2010 at 1:31 PM, Gilles Chanteperdrix 
 gilles.chanteperd...@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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-18 Thread Prakash A S

 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
___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-18 Thread Gilles Chanteperdrix
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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-14 Thread Gilles Chanteperdrix
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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread Eric Noulard
2010/8/12 prakash srinivasan asprakash...@rediffmail.com

 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

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread prakash srinivasan




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___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread Wolfgang Grandegger
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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread asprakash_83


 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







___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread prakash srinivasan
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___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread prakash srinivasan


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___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread Wolfgang Grandegger
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.

___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help


Re: [Xenomai-help] Timing calculation

2010-08-12 Thread prakash srinivasan
 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___
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help