* [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface
@ 2006-06-22 10:54 Jan Kiszka
2006-06-23 7:03 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2006-06-22 10:54 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 786 bytes --]
Hi,
having to load xeno_timerbench and to open its device just for
triggering the I-pipe tracer was not a smart decision of mine. This
patch makes is more comfortable to call the tracer from user space.
The latency test still traces fine, but cyclic suffers from some likely
unrelated problem on my box (doesn't run at all, no xeno-thread except
the main one) - needs a closer look later.
Jan
PS: I realised that rttesting.h and the related devices are not yet
cleanly structured with respect to the RTDM profile idea (timer
benchmark and switch test devices have no interface in common). I'm
currently considering to merge all tests into a single device (maybe
using multiple source files), also reducing the complexity for the test
user. Comments are welcome.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: xn_sys_ipipe_trace.patch --]
[-- Type: text/x-patch; name="xn_sys_ipipe_trace.patch", Size: 13338 bytes --]
Index: include/asm-generic/syscall.h
===================================================================
--- include/asm-generic/syscall.h (Revision 1252)
+++ include/asm-generic/syscall.h (Arbeitskopie)
@@ -30,6 +30,13 @@
#define __xn_sys_info 4 /* xnshadow_get_info(muxid,&info) */
#define __xn_sys_arch 5 /* r = xnarch_local_syscall(args) */
+#define __xn_sys_trace_begin 6 /* ipipe_trace_begin(v) */
+#define __xn_sys_trace_end 7 /* ipipe_trace_end(v) */
+#define __xn_sys_trace_freeze 8 /* ipipe_trace_freeze(v) */
+#define __xn_sys_trace_specl 9 /* ipipe_trace_special(special_id, v) */
+#define __xn_sys_trace_mreset 10 /* ipipe_trace_max_reset() */
+#define __xn_sys_trace_freset 11 /* ipipe_trace_frozen_reset() */
+
#define XENOMAI_LINUX_DOMAIN 0
#define XENOMAI_XENO_DOMAIN 1
Index: include/rtdm/rttesting.h
===================================================================
--- include/rtdm/rttesting.h (Revision 1252)
+++ include/rtdm/rttesting.h (Arbeitskopie)
@@ -1,6 +1,6 @@
/**
* @file
- * Real-Time Driver Model for Xenomai, benchmark device profile header
+ * Real-Time Driver Model for Xenomai, testing device profile header
*
* @note Copyright (C) 2005 Jan Kiszka <jan.kiszka@domain.hid>
*
@@ -18,16 +18,16 @@
* along with Xenomai; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * @ingroup rtbenchmark
+ * @ingroup rttesting
*/
/*!
* @ingroup profiles
- * @defgroup rtbenchmark Timer benchmark Device
+ * @defgroup rttesting Testing Device
*
- * This group of devices is intended to provide in-kernel benchmark results.
+ * This group of devices is intended to provide in-kernel testing results.
* Feel free to comment on this profile via the Xenomai mailing list
- * (Xenomai-help@domain.hid) or directly to the author (jan.kiszka@domain.hid). @n
+ * (xenomai@xenomai.org) or directly to the author (jan.kiszka@domain.hid). @n
* @n
*
* @par Device Characteristics
@@ -91,11 +91,6 @@ typedef struct rtbnch_overall_result {
long *histogram_max;
} rtbnch_overall_result_t;
-typedef struct rtbnch_trace_special {
- unsigned char id;
- long v;
-} rtbnch_trace_special_t;
-
#define RTIOC_TYPE_BENCHMARK RTDM_CLASS_TESTING
@@ -120,24 +115,6 @@ typedef struct rtbnch_trace_special {
#define RTBNCH_RTIOC_STOP_TMTEST \
_IOWR(RTIOC_TYPE_BENCHMARK, 0x11, struct rtbnch_overall_result)
-
-#define RTBNCH_RTIOC_BEGIN_TRACE \
- _IOW(RTIOC_TYPE_BENCHMARK, 0x20, long)
-
-#define RTBNCH_RTIOC_END_TRACE \
- _IOW(RTIOC_TYPE_BENCHMARK, 0x21, long)
-
-#define RTBNCH_RTIOC_FREEZE_TRACE \
- _IOW(RTIOC_TYPE_BENCHMARK, 0x22, long)
-
-#define RTBNCH_RTIOC_REFREEZE_TRACE \
- _IOW(RTIOC_TYPE_BENCHMARK, 0x23, long)
-
-#define RTBNCH_RTIOC_SPECIAL_TRACE \
- _IOW(RTIOC_TYPE_BENCHMARK, 0x24, unsigned char)
-
-#define RTBNCH_RTIOC_SPECIAL_TRACE_EX \
- _IOW(RTIOC_TYPE_BENCHMARK, 0x25, struct rtbnch_trace_special)
/** @} */
Index: include/nucleus/ipipe_trace.h
===================================================================
--- include/nucleus/ipipe_trace.h (Revision 0)
+++ include/nucleus/ipipe_trace.h (Revision 0)
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2006 Jan Kiszka <jan.kiszka@domain.hid>.
+ *
+ * Xenomai is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * Xenomai is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Xenomai; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * User space interface to the I-pipe tracer.
+ */
+
+#ifndef _XENO_NUCLEUS_IPIPE_TRACE_H
+#define _XENO_NUCLEUS_IPIPE_TRACE_H
+
+#ifndef __XENO_SIM__
+#include <asm/xenomai/syscall.h>
+#endif /* __XENO_SIM__ */
+
+#ifdef __KERNEL__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef CONFIG_IPIPE_TRACE
+#include <linux/ipipe_trace.h>
+#endif /* CONFIG_IPIPE_TRACE */
+
+#ifdef __cplusplus
+}
+#endif
+
+#elif !defined(__XENO_SIM__)
+
+static inline void ipipe_trace_begin(unsigned long v)
+{
+ XENOMAI_SYSCALL1(__xn_sys_trace_begin, v);
+}
+
+static inline void ipipe_trace_end(unsigned long v)
+{
+ XENOMAI_SYSCALL1(__xn_sys_trace_end, v);
+}
+
+static inline void ipipe_trace_freeze(unsigned long v)
+{
+ XENOMAI_SYSCALL1(__xn_sys_trace_freeze, v);
+}
+
+static inline void ipipe_trace_special(unsigned char special_id, unsigned long v)
+{
+ XENOMAI_SYSCALL2(__xn_sys_trace_specl, special_id, v);
+}
+
+static inline int ipipe_trace_max_reset(void)
+{
+ return XENOMAI_SYSCALL0(__xn_sys_trace_mreset);
+}
+
+static inline int ipipe_trace_frozen_reset(void)
+{
+ return XENOMAI_SYSCALL0(__xn_sys_trace_freset);
+}
+
+#endif /* __KERNEL__ */
+
+#define ipipe_trace_refreeze(v) do { \
+ ipipe_trace_frozen_reset(); \
+ ipipe_trace_freeze(v); \
+} while (0)
+
+#endif /* !_XENO_NUCLEUS_IPIPE_TRACE_H */
Index: src/testsuite/latency/latency.c
===================================================================
--- src/testsuite/latency/latency.c (Revision 1252)
+++ src/testsuite/latency/latency.c (Arbeitskopie)
@@ -12,6 +12,7 @@
#include <native/timer.h>
#include <native/sem.h>
#include <rtdm/rttesting.h>
+#include <nucleus/ipipe_trace.h>
RT_TASK latency_task, display_task;
@@ -130,8 +131,7 @@ void latency (void *cookie)
if (freeze_max && (dt > gmaxjitter) && !(finished || warmup))
{
- rt_dev_ioctl(benchdev, RTBNCH_RTIOC_REFREEZE_TRACE,
- rt_timer_tsc2ns(dt));
+ ipipe_trace_refreeze(rt_timer_tsc2ns(dt));
gmaxjitter = dt;
}
@@ -545,7 +545,7 @@ int main (int argc, char **argv)
mlockall(MCL_CURRENT|MCL_FUTURE);
- if ((test_mode != USER_TASK) || freeze_max)
+ if (test_mode != USER_TASK)
{
char devname[RTDM_MAX_DEVNAME_LEN];
Index: src/testsuite/cyclic/cyclictest.c
===================================================================
--- src/testsuite/cyclic/cyclictest.c (Revision 1252)
+++ src/testsuite/cyclic/cyclictest.c (Arbeitskopie)
@@ -36,7 +36,7 @@
#include <sys/mman.h>
#if IPIPE_TRACE
-#include <rtdm/rttesting.h>
+#include <nucleus/ipipe_trace.h>
#endif
/* Ugly, but .... */
@@ -93,11 +93,6 @@ struct thread_stat {
static int test_shutdown;
static int tracelimit = 100000;
static struct timespec start;
-#if IPIPE_TRACE
-static int benchdev = -1;
-#else
-#define benchdev -1
-#endif
static inline void tsnorm(struct timespec *ts)
{
@@ -266,7 +261,7 @@ void *timerthread(void *param)
stat->max = diff;
#if IPIPE_TRACE
if (stat->traced)
- ioctl(benchdev, RTBNCH_RTIOC_REFREEZE_TRACE, diff);
+ ipipe_trace_refreeze(diff);
#endif
}
@@ -411,9 +406,6 @@ static void process_options (int argc, c
static void sighand(int sig)
{
-#if IPIPE_TRACE
- close(benchdev);
-#endif
test_shutdown = 1;
}
@@ -469,10 +461,6 @@ int main(int argc, char **argv)
if (!stat)
goto outpar;
-#if IPIPE_TRACE
- benchdev = open("rtbenchmark0", O_RDWR);
-#endif
-
clock_gettime(clocksources[clocksel], &start);
for (i = 0; i < num_threads; i++) {
@@ -500,7 +488,7 @@ int main(int argc, char **argv)
pthread_attr_setstacksize(&thattr, 131072);
pthread_create(&stat[i].thread, &thattr, timerthread, &par[i]);
stat[i].threadstarted = 1;
- stat[i].traced = (i == 0 && benchdev >= 0);
+ stat[i].traced = (i == 0 && IPIPE_TRACE > 0);
}
while (!test_shutdown) {
Index: ksrc/drivers/testing/timerbench.c
===================================================================
--- ksrc/drivers/testing/timerbench.c (Revision 1252)
+++ ksrc/drivers/testing/timerbench.c (Arbeitskopie)
@@ -232,55 +232,6 @@ int rt_tmbench_close(struct rtdm_dev_con
}
-#ifdef CONFIG_IPIPE_TRACE
-int tracer_ioctl(int request, rtdm_user_info_t *user_info, void *arg)
-{
- switch (request) {
- case RTBNCH_RTIOC_BEGIN_TRACE:
- ipipe_trace_begin((long)arg);
- break;
-
- case RTBNCH_RTIOC_END_TRACE:
- ipipe_trace_end((long)arg);
- break;
-
- case RTBNCH_RTIOC_REFREEZE_TRACE:
- ipipe_trace_frozen_reset();
- /* fall through */
-
- case RTBNCH_RTIOC_FREEZE_TRACE:
- ipipe_trace_freeze((long)arg);
- break;
-
- case RTBNCH_RTIOC_SPECIAL_TRACE:
- ipipe_trace_special((long)arg, 0);
- break;
-
- case RTBNCH_RTIOC_SPECIAL_TRACE_EX: {
- struct rtbnch_trace_special special;
-
- if (user_info) {
- if (!rtdm_read_user_ok(user_info, arg,
- sizeof(struct rtbnch_trace_special)) ||
- rtdm_copy_from_user(user_info, &special, arg,
- sizeof(struct rtbnch_trace_special)))
- return 0;
- } else
- special = *(struct rtbnch_trace_special *)arg;
- ipipe_trace_special(special.id, special.v);
- break;
- }
-
- default:
- return 0;
- }
- return 1;
-}
-#else /* !CONFIG_IPIPE_TRACE */
-#define tracer_ioctl(request, user_info, arg) (0)
-#endif /* CONFIG_IPIPE_TRACE */
-
-
int rt_tmbench_ioctl_nrt(struct rtdm_dev_context *context,
rtdm_user_info_t *user_info, int request, void *arg)
{
@@ -288,9 +239,6 @@ int rt_tmbench_ioctl_nrt(struct rtdm_dev
int ret = 0;
- if (tracer_ioctl(request, user_info, arg))
- return 0;
-
ctx = (struct rt_tmbench_context *)context->dev_private;
switch (request) {
@@ -475,9 +423,6 @@ int rt_tmbench_ioctl_rt(struct rtdm_dev_
int ret = 0;
- if (tracer_ioctl(request, user_info, arg))
- return 0;
-
ctx = (struct rt_tmbench_context *)context->dev_private;
switch (request) {
Index: ksrc/nucleus/shadow.c
===================================================================
--- ksrc/nucleus/shadow.c (Revision 1252)
+++ ksrc/nucleus/shadow.c (Arbeitskopie)
@@ -1261,6 +1261,48 @@ static int xnshadow_sys_barrier(struct t
return xnshadow_wait_barrier(regs);
}
+#ifdef CONFIG_IPIPE_TRACE
+static int notrace xnshadow_sys_trace_begin(struct task_struct *curr,
+ struct pt_regs *regs)
+{
+ ipipe_trace_begin(__xn_reg_arg1(regs));
+ return 0;
+}
+
+static int notrace xnshadow_sys_trace_end(struct task_struct *curr,
+ struct pt_regs *regs)
+{
+ ipipe_trace_end(__xn_reg_arg1(regs));
+ return 0;
+}
+
+static int notrace xnshadow_sys_trace_freeze(struct task_struct *curr,
+ struct pt_regs *regs)
+{
+ ipipe_trace_freeze(__xn_reg_arg1(regs));
+ return 0;
+}
+
+static int notrace xnshadow_sys_trace_special(struct task_struct *curr,
+ struct pt_regs *regs)
+{
+ ipipe_trace_special(__xn_reg_arg1(regs), __xn_reg_arg2(regs));
+ return 0;
+}
+
+static int notrace xnshadow_sys_trace_mreset(struct task_struct *curr,
+ struct pt_regs *regs)
+{
+ return ipipe_trace_max_reset();
+}
+
+static int notrace xnshadow_sys_trace_freset(struct task_struct *curr,
+ struct pt_regs *regs)
+{
+ return ipipe_trace_frozen_reset();
+}
+#endif /* CONFIG_IPIPE_TRACE */
+
static xnsysent_t xnshadow_systab[] = {
[__xn_sys_migrate] = {&xnshadow_sys_migrate, __xn_exec_current},
[__xn_sys_arch] = {&xnshadow_sys_arch, __xn_exec_any},
@@ -1268,6 +1310,17 @@ static xnsysent_t xnshadow_systab[] = {
[__xn_sys_info] = {&xnshadow_sys_info, __xn_exec_lostage},
[__xn_sys_completion] = {&xnshadow_sys_completion, __xn_exec_lostage},
[__xn_sys_barrier] = {&xnshadow_sys_barrier, __xn_exec_lostage},
+#ifdef CONFIG_IPIPE_TRACE
+ [__xn_sys_trace_begin] = {&xnshadow_sys_trace_begin, __xn_exec_any},
+ [__xn_sys_trace_end] = {&xnshadow_sys_trace_end, __xn_exec_any},
+ [__xn_sys_trace_freeze] = {&xnshadow_sys_trace_freeze, __xn_exec_any},
+ [__xn_sys_trace_specl] = {&xnshadow_sys_trace_special, __xn_exec_any},
+ [__xn_sys_trace_mreset] = {&xnshadow_sys_trace_mreset, __xn_exec_any},
+ [__xn_sys_trace_freset] = {&xnshadow_sys_trace_freset, __xn_exec_any},
+#else /* !CONFIG_IPIPE_TRACE */
+ /* has to be filled up with an ENOSYS returning handler once further
+ syscalls follow */
+#endif /* CONFIG_IPIPE_TRACE */
};
static inline int substitute_linux_syscall(struct task_struct *curr,
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface
2006-06-22 10:54 [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface Jan Kiszka
@ 2006-06-23 7:03 ` Philippe Gerum
2006-06-23 9:27 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2006-06-23 7:03 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
On Thu, 2006-06-22 at 12:54 +0200, Jan Kiszka wrote:
> Hi,
>
> having to load xeno_timerbench and to open its device just for
> triggering the I-pipe tracer was not a smart decision of mine. This
> patch makes is more comfortable to call the tracer from user space.
> Index: include/asm-generic/syscall.h
> ===================================================================
> --- include/asm-generic/syscall.h (Revision 1252)
> +++ include/asm-generic/syscall.h (Arbeitskopie)
> @@ -30,6 +30,13 @@
> #define __xn_sys_info 4 /* xnshadow_get_info(muxid,&info) */
> #define __xn_sys_arch 5 /* r = xnarch_local_syscall(args) */
>
> +#define __xn_sys_trace_begin 6 /* ipipe_trace_begin(v) */
> +#define __xn_sys_trace_end 7 /* ipipe_trace_end(v) */
> +#define __xn_sys_trace_freeze 8 /* ipipe_trace_freeze(v) */
> +#define __xn_sys_trace_specl 9 /*
ipipe_trace_special(special_id, v) */
> +#define __xn_sys_trace_mreset 10 /* ipipe_trace_max_reset() */
> +#define __xn_sys_trace_freset 11 /* ipipe_trace_frozen_reset() */
> +
Ok for providing a tracer syscall from the nucleus table, but let's
not pollute the namespace uselessly. We could just have a single
tracer entry point, using the first arg as a function code for begin,
end, freeze etc. Given that those ops are not on the fast path, there
is nothing to gain in having them as separate calls. See __xn_sys_arch
for ARM.
>
> Index: include/nucleus/ipipe_trace.h
> ===================================================================
This file should go to include/asm-generic/ since it depends on the
underlying real-time enabler (i.e. I-pipe). This way, there would be
no need to check for __XENO_SIM__.
> --- include/nucleus/ipipe_trace.h (Revision 0)
> +++ include/nucleus/ipipe_trace.h (Revision 0)
> @@ -0,0 +1,82 @@
> +/*
> Index: src/testsuite/latency/latency.c
> ===================================================================
> --- src/testsuite/latency/latency.c (Revision 1252)
> +++ src/testsuite/latency/latency.c (Arbeitskopie)
> @@ -12,6 +12,7 @@
> #include <native/timer.h>
> #include <native/sem.h>
> #include <rtdm/rttesting.h>
> +#include <nucleus/ipipe_trace.h>
>
> RT_TASK latency_task, display_task;
>
> @@ -130,8 +131,7 @@ void latency (void *cookie)
>
> if (freeze_max && (dt > gmaxjitter) && !(finished ||
warmup))
> {
> - rt_dev_ioctl(benchdev, RTBNCH_RTIOC_REFREEZE_TRACE,
> - rt_timer_tsc2ns(dt));
> + ipipe_trace_refreeze(rt_timer_tsc2ns(dt));
I don't like the idea of spreading ipipe-something symbols and
dependancies all over the entire source code including the generic one,
especially when considering that at some point, we are going to have
preempt-rt as the other possible real-time enabler, like
Adeos is already used now. We should use something more generic.
"tracer*" would be ok, I guess.
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface
2006-06-23 7:03 ` Philippe Gerum
@ 2006-06-23 9:27 ` Jan Kiszka
2006-06-23 9:44 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2006-06-23 9:27 UTC (permalink / raw)
To: rpm; +Cc: xenomai-core
Philippe Gerum wrote:
> On Thu, 2006-06-22 at 12:54 +0200, Jan Kiszka wrote:
>> Hi,
>>
>> having to load xeno_timerbench and to open its device just for
>> triggering the I-pipe tracer was not a smart decision of mine. This
>> patch makes is more comfortable to call the tracer from user space.
>
>> Index: include/asm-generic/syscall.h
>> ===================================================================
>> --- include/asm-generic/syscall.h (Revision 1252)
>> +++ include/asm-generic/syscall.h (Arbeitskopie)
>> @@ -30,6 +30,13 @@
>> #define __xn_sys_info 4 /* xnshadow_get_info(muxid,&info) */
>> #define __xn_sys_arch 5 /* r = xnarch_local_syscall(args) */
>>
>> +#define __xn_sys_trace_begin 6 /* ipipe_trace_begin(v) */
>> +#define __xn_sys_trace_end 7 /* ipipe_trace_end(v) */
>> +#define __xn_sys_trace_freeze 8 /* ipipe_trace_freeze(v) */
>> +#define __xn_sys_trace_specl 9 /*
> ipipe_trace_special(special_id, v) */
>> +#define __xn_sys_trace_mreset 10 /* ipipe_trace_max_reset() */
>> +#define __xn_sys_trace_freset 11 /* ipipe_trace_frozen_reset() */
>> +
>
> Ok for providing a tracer syscall from the nucleus table, but let's
> not pollute the namespace uselessly. We could just have a single
> tracer entry point, using the first arg as a function code for begin,
> end, freeze etc. Given that those ops are not on the fast path, there
> is nothing to gain in having them as separate calls. See __xn_sys_arch
> for ARM.
Ok, will change.
>
>>
>> Index: include/nucleus/ipipe_trace.h
>> ===================================================================
>
> This file should go to include/asm-generic/ since it depends on the
> underlying real-time enabler (i.e. I-pipe). This way, there would be
> no need to check for __XENO_SIM__.
Ok, but how is the user supposed to include the API then? Or can we drag
it in implicitly somehow? That would be even nicer I think.
>
>> --- include/nucleus/ipipe_trace.h (Revision 0)
>> +++ include/nucleus/ipipe_trace.h (Revision 0)
>> @@ -0,0 +1,82 @@
>> +/*
>> Index: src/testsuite/latency/latency.c
>> ===================================================================
>> --- src/testsuite/latency/latency.c (Revision 1252)
>> +++ src/testsuite/latency/latency.c (Arbeitskopie)
>> @@ -12,6 +12,7 @@
>> #include <native/timer.h>
>> #include <native/sem.h>
>> #include <rtdm/rttesting.h>
>> +#include <nucleus/ipipe_trace.h>
>>
>> RT_TASK latency_task, display_task;
>>
>> @@ -130,8 +131,7 @@ void latency (void *cookie)
>>
>> if (freeze_max && (dt > gmaxjitter) && !(finished ||
> warmup))
>> {
>> - rt_dev_ioctl(benchdev, RTBNCH_RTIOC_REFREEZE_TRACE,
>> - rt_timer_tsc2ns(dt));
>> + ipipe_trace_refreeze(rt_timer_tsc2ns(dt));
>
> I don't like the idea of spreading ipipe-something symbols and
> dependancies all over the entire source code including the generic one,
> especially when considering that at some point, we are going to have
> preempt-rt as the other possible real-time enabler, like
> Adeos is already used now. We should use something more generic.
> "tracer*" would be ok, I guess.
>
I'm going to rescan Ingo's API to define a common interface where
feasible (their own user space API seems to hide behind gettimeofday).
BTW, looks like that tracer will not make into mainline soon - I noticed
no further pushing recently.
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface
2006-06-23 9:27 ` Jan Kiszka
@ 2006-06-23 9:44 ` Philippe Gerum
2006-06-23 11:19 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2006-06-23 9:44 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
On Fri, 2006-06-23 at 11:27 +0200, Jan Kiszka wrote:
> >> Index: include/nucleus/ipipe_trace.h
> >> ===================================================================
> >
> > This file should go to include/asm-generic/ since it depends on the
> > underlying real-time enabler (i.e. I-pipe). This way, there would be
> > no need to check for __XENO_SIM__.
>
> Ok, but how is the user supposed to include the API then? Or can we drag
> it in implicitly somehow? That would be even nicer I think.
>
asm-generic/trace.h would be dragged in by include/asm-<arch>/hal.h, so
that we get the proper double dependancy on both the architecture if it
does provide the tracing feature, and also on the HAL which in turn
requires the I-pipe.
> >
> >> --- include/nucleus/ipipe_trace.h (Revision 0)
> >> +++ include/nucleus/ipipe_trace.h (Revision 0)
> >> @@ -0,0 +1,82 @@
> >> +/*
> >> Index: src/testsuite/latency/latency.c
> >> ===================================================================
> >> --- src/testsuite/latency/latency.c (Revision 1252)
> >> +++ src/testsuite/latency/latency.c (Arbeitskopie)
> >> @@ -12,6 +12,7 @@
> >> #include <native/timer.h>
> >> #include <native/sem.h>
> >> #include <rtdm/rttesting.h>
> >> +#include <nucleus/ipipe_trace.h>
> >>
> >> RT_TASK latency_task, display_task;
> >>
> >> @@ -130,8 +131,7 @@ void latency (void *cookie)
> >>
> >> if (freeze_max && (dt > gmaxjitter) && !(finished ||
> > warmup))
> >> {
> >> - rt_dev_ioctl(benchdev, RTBNCH_RTIOC_REFREEZE_TRACE,
> >> - rt_timer_tsc2ns(dt));
> >> + ipipe_trace_refreeze(rt_timer_tsc2ns(dt));
> >
> > I don't like the idea of spreading ipipe-something symbols and
> > dependancies all over the entire source code including the generic one,
> > especially when considering that at some point, we are going to have
> > preempt-rt as the other possible real-time enabler, like
> > Adeos is already used now. We should use something more generic.
> > "tracer*" would be ok, I guess.
> >
>
> I'm going to rescan Ingo's API to define a common interface where
> feasible (their own user space API seems to hide behind gettimeofday).
Thanks. We should definitely consider the underlying the real-time
enabling technology Xenomai uses to run skins over as an interchangeable
component.
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface
2006-06-23 9:44 ` Philippe Gerum
@ 2006-06-23 11:19 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2006-06-23 11:19 UTC (permalink / raw)
To: rpm; +Cc: xenomai-core
[-- Attachment #1: Type: text/plain, Size: 4854 bytes --]
Philippe Gerum wrote:
> On Fri, 2006-06-23 at 11:27 +0200, Jan Kiszka wrote:
>>>> Index: include/nucleus/ipipe_trace.h
>>>> ===================================================================
>>> This file should go to include/asm-generic/ since it depends on the
>>> underlying real-time enabler (i.e. I-pipe). This way, there would be
>>> no need to check for __XENO_SIM__.
>> Ok, but how is the user supposed to include the API then? Or can we drag
>> it in implicitly somehow? That would be even nicer I think.
>>
>
> asm-generic/trace.h would be dragged in by include/asm-<arch>/hal.h, so
> that we get the proper double dependancy on both the architecture if it
> does provide the tracing feature, and also on the HAL which in turn
> requires the I-pipe.
Err, asm-<arch>/hal.h are pure kernel space headers, aren't they? But we
need user space support as well.
>
>>>> --- include/nucleus/ipipe_trace.h (Revision 0)
>>>> +++ include/nucleus/ipipe_trace.h (Revision 0)
>>>> @@ -0,0 +1,82 @@
>>>> +/*
>>>> Index: src/testsuite/latency/latency.c
>>>> ===================================================================
>>>> --- src/testsuite/latency/latency.c (Revision 1252)
>>>> +++ src/testsuite/latency/latency.c (Arbeitskopie)
>>>> @@ -12,6 +12,7 @@
>>>> #include <native/timer.h>
>>>> #include <native/sem.h>
>>>> #include <rtdm/rttesting.h>
>>>> +#include <nucleus/ipipe_trace.h>
>>>>
>>>> RT_TASK latency_task, display_task;
>>>>
>>>> @@ -130,8 +131,7 @@ void latency (void *cookie)
>>>>
>>>> if (freeze_max && (dt > gmaxjitter) && !(finished ||
>>> warmup))
>>>> {
>>>> - rt_dev_ioctl(benchdev, RTBNCH_RTIOC_REFREEZE_TRACE,
>>>> - rt_timer_tsc2ns(dt));
>>>> + ipipe_trace_refreeze(rt_timer_tsc2ns(dt));
>>> I don't like the idea of spreading ipipe-something symbols and
>>> dependancies all over the entire source code including the generic one,
>>> especially when considering that at some point, we are going to have
>>> preempt-rt as the other possible real-time enabler, like
>>> Adeos is already used now. We should use something more generic.
>>> "tracer*" would be ok, I guess.
>>>
>> I'm going to rescan Ingo's API to define a common interface where
>> feasible (their own user space API seems to hide behind gettimeofday).
>
> Thanks. We should definitely consider the underlying the real-time
> enabling technology Xenomai uses to run skins over as an interchangeable
> component.
>
Unfortunately, Ingo's semantics are still quite different, partly
incompatible (and unhandy as well - you can only trace one event, not
the worst of a series like with the ipipe tracer). So we may need
special user code to deal with these differences (like in cyclictest).
The most critical point is that Ingo's tracer nukes any timing
guarantees when it fires. In contrast, the ipipe variant is RT-safe.
Anyway, let's try to go for these names and semantics (implementation:
ipipe / Ingo):
xntrace_max_begin(unsigned long v):
Mark the worst-case path beginning together with an arbitrary
ulong. This path is separated from the user path below.
ipipe_trace_begin(v); / -
xntrace_max_end(unsigned long v):
Mark the worst-case path end together with an arbitrary ulong.
The path with maximum length can be obtained from the logs.
ipipe_trace_end(v); / -
xntrace_user_start(void):
Start the user trace path.
ipipe_trace_frozen_reset(); / user_trace_start();
xntrace_user_stop(unsigned long v):
Record an arbitrary ulong and stop the user trace path. The
result is kept until the next invocation of
xntrace_user_start() or xntrace_user_freeze(..., 0).
ipipe_trace_freeze(v); /
trace_special(v, 0, 0); user_trace_stop();
xntrace_user_freeze(unsigned long v, int once):
Record an arbitrary ulong and freeze the user trace path. If
once is 0, the tracer keeps running after the freeze so that
always the latest result can be obtained. Otherwise, this call
is equivalent to xntrace_user_stop(v).
if (once)
xntrace_user_stop(v);
else
ipipe_trace_frozen_reset(); ipipe_trace_freeze(v) / -
xntrace_special(unsigned char id, unsigned long v):
Record an arbitrary uchar + ulong.
ipipe_trace_special(id, v); / trace_special(v, 0, id);
xntrace_special_u64(unsigned char id, unsigned long long v):
Record an arbitrary uchar + u64.
ipipe_trace_special(id, v >> 32);
ipipe_trace_special(id, v & 0xFFFFFFFF); /
trace_special_u64(v, id);
I choose xntrace as prefix because Xenomai is used here to provide an
abstraction layer. Do you agree with the naming? Then this API should be
made available symmetrically in both kernel and use space. Still, the
question is via which header file...
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-23 11:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-22 10:54 [Xenomai-core] [PATCH] provide ipipe_traceing via nucleus interface Jan Kiszka
2006-06-23 7:03 ` Philippe Gerum
2006-06-23 9:27 ` Jan Kiszka
2006-06-23 9:44 ` Philippe Gerum
2006-06-23 11:19 ` 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.