All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] native rt_timer questions
@ 2008-09-03  9:39 Fillod Stephane
  2008-09-03 10:16 ` Gilles Chanteperdrix
  2008-09-21 18:10 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 3+ messages in thread
From: Fillod Stephane @ 2008-09-03  9:39 UTC (permalink / raw)
  To: xenomai-core

Hi!

Why rt_timer functions, esp. rt_timer_tsc(), are not inlined in
user-space 
(with CONFIG_XENO_HW_DIRECT_TSC) ? Is it because some policy insists 
that every library function must have an overridable symbol?
Even a branch is worrisome when doing repetitive micro-measurements.
What about a patch along the following? or an extern inline?

--- include/native/timer.h     15 May 2008 07:40:30 -0000
+++ include/native/timer.h     3 Sep 2008 09:10:31 -0000
@@ -46,7 +52,7 @@
 extern "C" {
 #endif
-#if (defined(__KERNEL__)  || defined(__XENO_SIM__)) &&
!defined(DOXYGEN_CPP)
+#if (defined(__KERNEL__)  || defined(__XENO_SIM__) ||
defined(__NATIVE_INLINE)) && !defined(DOXYGEN_CPP)
 static inline SRTIME rt_timer_ns2tsc(SRTIME ns)
 {
        return xnarch_ns_to_tsc(ns);

BTW, I had the bad surprise of rt_timer_read() doing a syscall, which
is costly when doing fine measurement. Should it be documented?


The native rt_timer functions are documented in two locations:
http://www.xenomai.org/documentation/branches/v2.4.x/html/api/include_2n
ative_2timer_8h.html
http://www.xenomai.org/documentation/branches/v2.4.x/html/api/group__nat
ive__timer.html

Could they be gathered, maybe with the here below patch (untested, no
doxy expert):

--- include/native/timer.h     15 May 2008 07:40:30 -0000
+++ include/native/timer.h     3 Sep 2008 09:10:31 -0000
@@ -17,6 +17,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
+ *
+ * \ingroup native_timer
  */

 #ifndef _XENO_TIMER_H
@@ -26,6 +28,10 @@

 #define TM_ONESHOT XN_APERIODIC_TICK

+/** Structure containing timer-information useful to users.
+ *
+ *  @see rt_timer_inquire()
+ */
 typedef struct rt_timer_info {

     RTIME period;      /* !< Current status (unset, aperiodic, period).
*/

-- 
Stephane


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

end of thread, other threads:[~2008-09-21 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03  9:39 [Xenomai-core] native rt_timer questions Fillod Stephane
2008-09-03 10:16 ` Gilles Chanteperdrix
2008-09-21 18:10 ` Gilles Chanteperdrix

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.