Skip to contentSkip to conversation

LTTng for Xenomai - next round

Xenomai-core Jan Kiszka 3 participants 7 messages Oct 18, 2007 – Nov 8, 2007

Subsystems (3)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi,

LTTng is becoming interesting again: Mathieu uploaded a back-port to 2.6.23.1 yesterday which is already implementing the scheme that is intended to be submitted upstream.

What changed for us?

- We now have a recent patch basis for the kernel again.

- The instrumentation process was significantly simplified: No more facility registration, no more probe modules, no more XML file hacking - it's all derived from the trace points now! Some example:

trace_mark(kernel_timer_itimer_expired, "pid %d", sig->tsk->pid);
^----^ ^------------------^ ^----^
facility trace point argument name
name name and type

I rebased the patches over I-pipe for i386 (see attached patches and extended series description), and I also started to rework the Xenomai patch. The diffstat of the latter is fairly telling:

 include/nucleus/ltt.h   |  111 +---------------------------
 ksrc/nucleus/Config.in  |    9 --
 ksrc/nucleus/Kconfig    |   36 ---------
 ksrc/nucleus/Makefile   |    3
 ksrc/nucleus/intr.c     |   19 ++--
 ksrc/nucleus/ltt.c      |  186 ------------------------------------------------
 ksrc/nucleus/module.c   |    7 -
 ksrc/nucleus/pod.c      |  102 ++++++++++++++++----------
 ksrc/nucleus/shadow.c   |   43 +++++++----
 ksrc/nucleus/synch.c    |   19 +++-
 ksrc/nucleus/timebase.c |    6 -
 11 files changed, 125 insertions(+), 416 deletions(-)

You see, no more ltt.c, i.e. no more probe module!

At this point, we are already able to use the services of "lttv -m textDump" or lttv-gui to display traces from Xenomai kernels as event lists. Yes, I tried this, and it works! (Hint: Don't forget to ltt-armall your trace points before trying to collect data...)

Yet to be done:

- Finish the xnltt_log_event refactoring (half done, pod.c is missing yet - with ~30 trace point)

- Port and update the Xenomai extension over latest lttv.

Well, I'm not looking for work, I'm looking for workers :). Anyone interested and available to help with the open topics? Daniel...?

Jan

---
 arch/i386/kernel/ipipe.c |    4 -
 include/asm-i386/ipipe.h |    4 -
 include/linux/kernel.h   |    1 
 include/linux/marker.h   |   10 ++--
 kernel/exit.c            |    1 
 kernel/sched.c           |   52 +++++++++++++++++++++++
 ltt/ltt-relay.c          |    2 
 ltt/ltt-serialize.c      |   12 +++--
 mm/memory.c              |  102 +++++++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 172 insertions(+), 16 deletions(-)
include/linux/kernel.h +1 -0
Index: linux-2.6.23-ipipe/include/linux/kernel.h
===================================================================
@@ -15,6 +15,7 @@
 #include <linux/bitops.h>
 #include <linux/log2.h>
 #include <linux/marker.h>
+#include <linux/ipipe_base.h>
 #include <asm/byteorder.h>
 #include <asm/bug.h>
 
kernel/exit.c +1 -0
Index: linux-2.6.23-ipipe/kernel/exit.c
===================================================================
@@ -975,6 +975,7 @@ fastcall NORET_TYPE void do_exit(long co
 	if (group_dead)
 		acct_process();
 	trace_mark(kernel_process_exit, "pid %d", tsk->pid);
+	ipipe_exit_notify(tsk);
 
 	exit_sem(tsk);
 	__exit_files(tsk);
kernel/sched.c +52 -0

55 lines not on this page · raw message

mm/memory.c +102 -0

111 lines not on this page · raw message

arch/i386/kernel/ipipe.c +0 -4
Index: linux-2.6.23-ipipe/arch/i386/kernel/ipipe.c
===================================================================
@@ -815,13 +815,9 @@ EXPORT_SYMBOL(ipipe_critical_exit);
 EXPORT_SYMBOL(ipipe_trigger_irq);
 EXPORT_SYMBOL(ipipe_get_sysinfo);
 
-EXPORT_SYMBOL_GPL(irq_desc);
 EXPORT_SYMBOL_GPL(__switch_to);
 EXPORT_SYMBOL_GPL(show_stack);
 EXPORT_PER_CPU_SYMBOL_GPL(init_tss);
-#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
-EXPORT_SYMBOL(tasklist_lock);
-#endif /* CONFIG_SMP || CONFIG_DEBUG_SPINLOCK */
 #ifdef CONFIG_SMP
 EXPORT_PER_CPU_SYMBOL_GPL(cpu_tlbstate);
 #endif /* CONFIG_SMP */
include/asm-i386/ipipe.h +2 -2
Index: linux-2.6.23-ipipe/include/asm-i386/ipipe.h
===================================================================
@@ -22,6 +22,8 @@
 #ifndef __I386_IPIPE_H
 #define __I386_IPIPE_H
 
+#define ipipe_processor_id()   raw_smp_processor_id()
+
 #ifdef CONFIG_IPIPE
 
 #define IPIPE_ARCH_STRING	"1.10-10"
@@ -37,8 +39,6 @@
 #include <linux/ipipe_percpu.h>
 #include <asm/ptrace.h>
 
-#define ipipe_processor_id()   raw_smp_processor_id()
-
 #define prepare_arch_switch(next)		\
 do {						\
 	ipipe_schedule_notify(current, next);	\
include/linux/marker.h +6 -4
Index: linux-2.6.23-ipipe/include/linux/marker.h
===================================================================
@@ -66,19 +66,21 @@ struct marker {
 		__mark_check_format(format, ## args);			\
 		if (!generic) {						\
 			if (unlikely(immediate_read(__mark_##name.state))) { \
-				preempt_disable();			\
+				unsigned long __irqflags;		\
+				ipipe_preempt_disable(__irqflags);	\
 				(*__mark_##name.call)			\
 					(&__mark_##name, call_data,	\
 					format, ## args);		\
-				preempt_enable();			\
+				ipipe_preempt_enable(__irqflags);	\
 			}						\
 		} else {						\
 			if (unlikely(_immediate_read(__mark_##name.state))) { \
-				preempt_disable();			\
+				unsigned long __irqflags;		\
+				ipipe_preempt_disable(__irqflags);	\
 				(*__mark_##name.call)			\
 					(&__mark_##name, call_data,	\
 					format, ## args);		\
-				preempt_enable();			\
+				ipipe_preempt_enable(__irqflags);	\
 			}						\
 		}							\
 	} while (0)
ltt/ltt-relay.c +1 -1
Index: linux-2.6.23-ipipe/ltt/ltt-relay.c
===================================================================
@@ -1010,7 +1010,7 @@ static void *ltt_relay_reserve_slot(stru
 	/*
 	 * Perform retryable operations.
 	 */
-	if (ltt_nesting[smp_processor_id()] > 4) {
+	if (ltt_nesting[ipipe_processor_id()] > 4) {
 		local_inc(&ltt_buf->events_lost);
 		return NULL;
 	}
ltt/ltt-serialize.c +7 -5
Index: linux-2.6.23-ipipe/ltt/ltt-serialize.c
===================================================================
@@ -10,6 +10,7 @@
 #include <linux/ctype.h>
 #include <linux/string.h>
 #include <linux/module.h>
+#include <linux/ipipe_base.h>
 #include <linux/ltt-tracer.h>
 
 enum ltt_type {
@@ -943,6 +944,7 @@ void ltt_vtrace(const struct marker *mda
 	u32 compact_data = 0;
 	void *serialize_private = NULL;
 	int cpu;
+	unsigned long irqflags;
 
 	pdata = (struct ltt_active_marker *)mdata->private;
 	if (unlikely(private_data && private_data->id < MARKER_CORE_IDS))
@@ -959,13 +961,13 @@ void ltt_vtrace(const struct marker *mda
 		&& (!private_data || !private_data->force)))
 		return;
 
-	preempt_disable();
+	ipipe_preempt_disable(irqflags);
 	if (likely(!private_data || !private_data->force
 			|| private_data->cpu == -1))
-		cpu = smp_processor_id();
+		cpu = ipipe_processor_id();
 	else
 		cpu = private_data->cpu;
-	ltt_nesting[smp_processor_id()]++;
+	ltt_nesting[ipipe_processor_id()]++;
 
 	if (unlikely(private_data && private_data->trace))
 		dest_trace = private_data->trace;
@@ -1018,8 +1020,8 @@ void ltt_vtrace(const struct marker *mda
 		/* Out-of-order commit */
 		ltt_commit_slot(channel, &transport_data, buffer, slot_size);
 	}
-	ltt_nesting[smp_processor_id()]--;
-	preempt_enable();
+	ltt_nesting[ipipe_processor_id()]--;
+	ipipe_preempt_enable(irqflags);
 }
 EXPORT_SYMBOL_GPL(ltt_vtrace);
 
mm/memory.c +0 -102

111 lines not on this page · raw message

include/linux/kernel.h +0 -1
Index: linux-2.6.23-ipipe/include/linux/kernel.h
===================================================================
@@ -14,7 +14,6 @@
 #include <linux/compiler.h>
 #include <linux/bitops.h>
 #include <linux/log2.h>
-#include <linux/ipipe_base.h>
 #include <asm/byteorder.h>
 #include <asm/bug.h>
 
kernel/sched.c +0 -52

55 lines not on this page · raw message

kernel/exit.c +0 -1
Index: linux-2.6.23-ipipe/kernel/exit.c
===================================================================
@@ -973,7 +973,6 @@ fastcall NORET_TYPE void do_exit(long co
 
 	if (group_dead)
 		acct_process();
- 	ipipe_exit_notify(tsk);
 	exit_sem(tsk);
 	__exit_files(tsk);
 	__exit_fs(tsk);

adeos-ipipe-2.6.23-i386-1.10-10.patch
# Linux kernel markers (in 2.6.23-mm1)
prepare-lttng.patch
change-struct-marker-users.patch combine-instrumentation-menus-in-kernel-kconfiginstrumentation.patch linux-kernel-markers.patch linux-kernel-markers-checkpatch-fixes.patch linux-kernel-markers-coding-style-fixes.patch linux-kernel-markers-alignment-fix.patch add-samples-subdir.patch
linux-kernel-markers-samples.patch linux-kernel-markers-samples-checkpatch-fixes.patch linux-kernel-markers-samples-coding-style-fix.patch linux-kernel-markers-samples-remove-asm.patch linux-kernel-markers-documentation.patch
# LTTng patches linux-kernel-markers-port-blktrace-to-markers.patch
#
## CH will submit. linux-kernel-markers-port-spu-to-markers.patch #
kprobes-use-mutex-for-insn-pages.patch kprobes-dont-use-kprobes-mutex-in-arch-code.patch kprobes-declare-kprobes-mutex-static.patch declare-array.patch text-edit-lock-architecture-independent-code.patch text-edit-lock-alternative-i386-and-x86_64.patch text-edit-lock-kprobes-architecture-independent.patch text-edit-lock-kprobes-i386.patch text-edit-lock-kprobes-x86_64.patch text-edit-lock-i386-standardize-debug-rodata.patch text-edit-lock-x86_64-standardize-debug-rodata.patch
# #removed-immediate-values-global-modules-list-and-mutex.patch immediate-values-architecture-independent-code.patch immediate-values-kconfig-embedded.patch immediate-values-move-kprobes-i386-restore-interrupt-to-kdebug-h.patch immediate-values-i386-optimization.patch immediate-values-powerpc-optimization.patch immediate-values-documentation.patch
#

# not in mainline profiling-use-immediate-values.patch
linux-kernel-markers-immediate-values.patch
#
#
# cmpxchg_local and cmpxchg64_local standardization
add-cmpxchg-local-to-generic-for-up.patch
i386-cmpxchg64-80386-80486-fallback.patch
add-cmpxchg64-to-alpha.patch
add-cmpxchg64-to-mips.patch
add-cmpxchg64-to-powerpc.patch
add-cmpxchg64-to-x86_64.patch
#
add-cmpxchg-local-to-arm.patch
add-cmpxchg-local-to-avr32.patch
add-cmpxchg-local-to-blackfin.patch
add-cmpxchg-local-to-cris.patch
add-cmpxchg-local-to-frv.patch
add-cmpxchg-local-to-h8300.patch
add-cmpxchg-local-to-ia64.patch
add-cmpxchg-local-to-m32r.patch
fix-m32r-__xchg.patch
fix-m32r-include-sched-h-in-smpboot.patch
local_t_m32r_optimized.patch
add-cmpxchg-local-to-m68k.patch
add-cmpxchg-local-to-m68knommu.patch
add-cmpxchg-local-to-parisc.patch
add-cmpxchg-local-to-ppc.patch
add-cmpxchg-local-to-s390.patch
add-cmpxchg-local-to-sh.patch
add-cmpxchg-local-to-sh64.patch
add-cmpxchg-local-to-sparc.patch
add-cmpxchg-local-to-sparc64.patch
add-cmpxchg-local-to-v850.patch
add-cmpxchg-local-to-xtensa.patch
#
# not lttng. slub-use-cmpxchg-local.patch
#
local_t-documentation-update-2.patch
atomic_opstxt-mention-local_t.patch
local_t-update-documentation.patch
# WAIT FOR USERSPACE MARKERS IMPLEMENTATION BEFORE SENDING TO UPSTREAM
local_t-update-documentation-2.patch
lttng-instrument-kernelh.patch # NOT FOR UPSTREAM
lttng-export-irq_desc.patch
#
#kernel trace thread flag
lttng-kernel-trace-thread-flag-alpha.patch
lttng-kernel-trace-thread-flag-arm.patch
lttng-kernel-trace-thread-flag-avr32.patch
lttng-kernel-trace-thread-flag-blackfin.patch
lttng-kernel-trace-thread-flag-cris.patch
lttng-kernel-trace-thread-flag-frv.patch
lttng-kernel-trace-thread-flag-h8300.patch
lttng-kernel-trace-thread-flag-i386.patch
lttng-kernel-trace-thread-flag-ia64.patch #FIXME
lttng-kernel-trace-thread-flag-m32r.patch
lttng-kernel-trace-thread-flag-m68k.patch
lttng-kernel-trace-thread-flag-m68knommu.patch
lttng-kernel-trace-thread-flag-mips.patch
lttng-kernel-trace-thread-flag-parisc.patch
lttng-kernel-trace-thread-flag-powerpc.patch
lttng-kernel-trace-thread-flag-s390.patch #FIXME
lttng-kernel-trace-thread-flag-sh.patch
lttng-kernel-trace-thread-flag-sh64.patch
lttng-kernel-trace-thread-flag-sparc.patch
lttng-kernel-trace-thread-flag-sparc64.patch
lttng-kernel-trace-thread-flag-um.patch
lttng-kernel-trace-thread-flag-v850.patch
lttng-kernel-trace-thread-flag-x86_64.patch
lttng-kernel-trace-thread-flag-xtensa.patch
lttng-kernel-trace-thread-flag-api.patch
#
lttng-build-instrumentation-menu.patch
#
lttng-timestamp-core.patch
lttng-timestamp-generic.patch
lttng-timestamp-ppc.patch
lttng-mips-export-hpt-frequency.patch
lttng-timestamp-mips.patch
lttng-timestamp-powerpc.patch
#
lttng-timestamp-sh.patch
lttng-test-tsc.patch
lttng-timestamp-i386.patch
lttng-timestamp-x86_64.patch
#
#
lttng-relay-hotplug.patch
lttng-core-header.patch
lttng-core.patch
lttng-core-i386.patch
lttng-core-powerpc.patch
lttng-tracer-header.patch
lttng-tracer.patch
lttng-transport-2.patch
lttng-netlink-control.patch
lttng-serialize.patch
#
#
lttng-instrumentation-arm.patch
lttng-instrumentation-i386.patch
lttng-instrumentation-mips.patch
lttng-instrumentation-powerpc.patch
lttng-instrumentation-ppc.patch
lttng-instrumentation-s390.patch	#FIXME: syscall trace 8 bit.
lttng-instrumentation-sh.patch
lttng-instrumentation-sh64.patch
lttng-instrumentation-sparc.patch
lttng-instrumentation-x86_64.patch
#
lttng-instrumentation.patch
lttng-instrumentation-modules.patch
lttng-export-tasklist-lock.patch
#
lttng-instrumentation-stack.patch
lttng-probes.patch
lttng-statedump.patch
lttng-menus.patch
#
#
seq_file_sorted.patch
module.c-sort-module-list.patch
linux-kernel-markers-iterator.patch
lttng-marker-control.patch
#
#
# Userspace tracing. Disabled for now.
#
#lttng-userspace-tracing.patch
#lttng-userspace-tracing-arm.patch
#lttng-userspace-tracing-i386.patch
#lttng-userspace-tracing-mips.patch
#lttng-userspace-tracing-powerpc.patch
#lttng-userspace-tracing-sh.patch
#lttng-userspace-tracing-x86_64.patch
#lttng-userspace-tracing-menus.patch
#
ltt-ipipe-2.6.23-i386-1.10-10.patch
---
 include/nucleus/ltt.h   |  111 +---------------------------
 ksrc/nucleus/Config.in  |    9 --
 ksrc/nucleus/Kconfig    |   36 ---------
 ksrc/nucleus/Makefile   |    3 
 ksrc/nucleus/intr.c     |   19 ++--
 ksrc/nucleus/ltt.c      |  186 ------------------------------------------------
 ksrc/nucleus/module.c   |    7 -
 ksrc/nucleus/pod.c      |  102 ++++++++++++++++----------
 ksrc/nucleus/shadow.c   |   43 +++++++----
 ksrc/nucleus/synch.c    |   19 +++-
 ksrc/nucleus/timebase.c |    6 -
 11 files changed, 125 insertions(+), 416 deletions(-)
include/nucleus/ltt.h +5 -106

130 lines not on this page · raw message

ksrc/nucleus/intr.c +9 -10
Index: xenomai/ksrc/nucleus/intr.c
===================================================================
@@ -98,9 +98,8 @@ void xnintr_clock_handler(void)
 
 	xnarch_announce_tick();
 
-	xnltt_log_event(xeno_ev_ienter, XNARCH_TIMER_IRQ);
-	xnltt_log_event(xeno_ev_tstick, nktbase.name,
-			xnpod_current_thread()->name);
+	xnltt_log_event(xn_nucleus_irq_enter, "irq %d", XNARCH_TIMER_IRQ);
+	xnltt_log_event(xn_nucleus_tbase_tick, "base %s", nktbase.name);
 
 	++sched->inesting;
 
@@ -124,7 +123,7 @@ void xnintr_clock_handler(void)
 		xnarch_relay_tick();
 	}
 
-	xnltt_log_event(xeno_ev_iexit, XNARCH_TIMER_IRQ);
+	xnltt_log_event(xn_nucleus_irq_exit, "irq %d", XNARCH_TIMER_IRQ);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -168,7 +167,7 @@ static void xnintr_shirq_handler(unsigne
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	xnltt_log_event(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -212,7 +211,7 @@ static void xnintr_shirq_handler(unsigne
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	xnltt_log_event(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -233,7 +232,7 @@ static void xnintr_edge_shirq_handler(un
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	xnltt_log_event(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -292,7 +291,7 @@ static void xnintr_edge_shirq_handler(un
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	xnltt_log_event(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -443,7 +442,7 @@ static void xnintr_irq_handler(unsigned 
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	xnltt_log_event(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -490,7 +489,7 @@ static void xnintr_irq_handler(unsigned 
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	xnltt_log_event(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
ksrc/nucleus/ltt.c deleted +0 -186

186 lines not on this page · raw message

ksrc/nucleus/pod.c +64 -38

299 lines not on this page · raw message

ksrc/nucleus/shadow.c +30 -13

109 lines not on this page · raw message

ksrc/nucleus/synch.c +14 -5
Index: xenomai/ksrc/nucleus/synch.c
===================================================================
@@ -174,7 +174,9 @@ void xnsynch_sleep_on(xnsynch_t *synch, 
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_sleepon, thread->name, synch);
+	xnltt_log_event(xn_nucleus_synch_sleepon,
+			"thread %p thread_name %s sync %p",
+			thread, thread->name, synch);
 
 	if (!testbits(synch->status, XNSYNCH_PRIO)) { /* i.e. FIFO */
 		appendpq(&synch->pendq, &thread->plink);
@@ -388,7 +390,9 @@ xnthread_t *xnsynch_wakeup_one_sleeper(x
 		thread->wchan = NULL;
 		synch->owner = thread;
 		xnthread_set_info(thread, XNWAKEN);
-		xnltt_log_event(xeno_ev_wakeup1, thread->name, synch);
+		xnltt_log_event(xn_nucleus_synch_wakeup_one,
+				"thread %p thread_name %s sync %p",
+				thread, thread->name, synch);
 		xnpod_resume_thread(thread, XNPEND);
 	} else
 		synch->owner = NULL;
@@ -461,7 +465,9 @@ xnpholder_t *xnsynch_wakeup_this_sleeper
 	thread->wchan = NULL;
 	synch->owner = thread;
 	xnthread_set_info(thread, XNWAKEN);
-	xnltt_log_event(xeno_ev_wakeupx, thread->name, synch);
+	xnltt_log_event(xn_nucleus_synch_wakeup_all,
+			"thread %p thread_name %s synch %p",
+			thread, thread->name, synch);
 	xnpod_resume_thread(thread, XNPEND);
 
 	if (testbits(synch->status, XNSYNCH_CLAIMED))
@@ -531,7 +537,8 @@ int xnsynch_flush(xnsynch_t *synch, xnfl
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_syncflush, synch, reason);
+	xnltt_log_event(xn_nucleus_synch_flush, "synch %p reason %lu",
+			synch, reason);
 
 	status = emptypq_p(&synch->pendq) ? XNSYNCH_DONE : XNSYNCH_RESCHED;
 
@@ -577,7 +584,9 @@ void xnsynch_forget_sleeper(xnthread_t *
 {
 	xnsynch_t *synch = thread->wchan;
 
-	xnltt_log_event(xeno_ev_syncforget, thread->name, synch);
+	xnltt_log_event(xn_nucleus_synch_forget,
+			"thread %p thread_name %s synch %p",
+			thread, thread->name, synch);
 
 	xnthread_clear_state(thread, XNPEND);
 	thread->wchan = NULL;
ksrc/nucleus/timebase.c +3 -3
Index: xenomai/ksrc/nucleus/timebase.c
===================================================================
@@ -469,8 +469,7 @@ void xntbase_tick(xntbase_t *base)
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_tstick, base->name,
-			xnpod_current_thread()->name);
+	xnltt_log_event(xn_nucleus_tbase_tick, "base %s", base->name);
 
 	if (base == &nktbase)
 		xntimer_tick_aperiodic();
@@ -565,7 +564,8 @@ void xntbase_adjust_time(xntbase_t *base
 	}
 #endif /* CONFIG_XENO_OPT_TIMING_PERIODIC */
 
-	/* xnltt_log_event(xeno_ev_timeadjust, base->name, delta); */
+	xnltt_log_event(xn_nucleus_tbase_adjust, "base %s delta %Lu",
+			base->name, delta);
 }
 
 /* The master time base - the most precise one, aperiodic, always valid. */
ksrc/nucleus/Config.in +0 -9
Index: xenomai/ksrc/nucleus/Config.in
===================================================================
@@ -60,15 +60,6 @@ if [ "$CONFIG_XENO_OPT_NUCLEUS" != "n" ]
 	fi
 	endmenu
 
-	if [ "$CONFIG_LTT" != "n" ]; then
-		mainmenu_option next_comment
-		comment 'LTT tracepoints filtering'
-			bool 'Disable IRQ-related tracepoints' CONFIG_XENO_OPT_FILTER_EVIRQ
-			bool 'Disable thread-related tracepoints' CONFIG_XENO_OPT_FILTER_EVTHR
-			bool 'Disable syscall-related tracepoints' CONFIG_XENO_OPT_FILTER_EVSYS
-			bool 'Disable all tracepoints' CONFIG_XENO_OPT_FILTER_EVALL
-		endmenu
-	fi
 	endmenu
 fi
 
ksrc/nucleus/Kconfig +0 -36
Index: xenomai/ksrc/nucleus/Kconfig
===================================================================
@@ -339,40 +339,4 @@ config XENO_OPT_TIMER_WHEEL_STEP
 
 endmenu
 
-menu "LTT tracepoints filtering"
-
-	depends on LTT
-
-config XENO_OPT_FILTER_EVIRQ
-	bool "Disable IRQ-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside real-time interrupt handlers.
-
-config XENO_OPT_FILTER_EVTHR
-	bool "Disable thread-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside most thread-related services.
-
-config XENO_OPT_FILTER_EVSYS
-	bool "Disable syscall-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside the shadow syscall dispatcher.
-
-config XENO_OPT_FILTER_EVALL
-	bool "Disable all tracepoints"
-	help
-
-	This option disables all LTT tracepoints inside Xenomai.
-
-endmenu
-
 endif
ksrc/nucleus/Makefile +0 -3
Index: xenomai/ksrc/nucleus/Makefile
===================================================================
@@ -14,8 +14,6 @@ xeno_nucleus-$(CONFIG_XENO_OPT_MAP) += m
 
 xeno_nucleus-$(CONFIG_XENO_OPT_REGISTRY) += registry.o
 
-xeno_nucleus-$(CONFIG_LTT) += ltt.o
-
 EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai
 
 else
@@ -35,7 +33,6 @@ opt_objs-$(CONFIG_XENO_OPT_PERVASIVE) +=
 opt_objs-$(CONFIG_XENO_OPT_PIPE) += pipe.o
 opt_objs-$(CONFIG_XENO_OPT_MAP) += map.o
 opt_objs-$(CONFIG_XENO_OPT_REGISTRY) += registry.o
-opt_objs-$(CONFIG_LTT) += ltt.o
 
 xeno_nucleus-objs += $(opt_objs-y)
 
ksrc/nucleus/module.c +0 -7
Index: xenomai/ksrc/nucleus/module.c
===================================================================
@@ -1156,10 +1156,6 @@ int __init __xeno_sys_init(void)
 
 	xnintr_mount();
 
-#ifdef CONFIG_LTT
-	xnltt_mount();
-#endif /* CONFIG_LTT */
-
 #ifdef CONFIG_XENO_OPT_PIPE
 	err = xnpipe_mount();
 
@@ -1249,9 +1245,6 @@ void __exit __xeno_sys_exit(void)
 #ifdef CONFIG_XENO_OPT_PIPE
 	xnpipe_umount();
 #endif /* CONFIG_XENO_OPT_PIPE */
-#ifdef CONFIG_LTT
-	xnltt_umount();
-#endif /* CONFIG_LTT */
 #endif /* __KERNEL__ */
 
 	if (nkmsgbuf)
#1 lore raw
Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: vendredi, 19. octobre 2007 00:06
To: xenomai-core
Cc: ROSSIER Daniel
Subject: LTTng for Xenomai - next round

Hi,

LTTng is becoming interesting again: Mathieu uploaded a back-port to 2.6.23.1 yesterday which is already implementing the scheme that is intended to be submitted upstream.

What changed for us?

- We now have a recent patch basis for the kernel again.

- The instrumentation process was significantly simplified: No more facility registration, no more probe modules, no more XML file hacking - it's all derived from the trace points now! Some example:

trace_mark(kernel_timer_itimer_expired, "pid %d", sig->tsk->pid);
^----^ ^------------------^ ^----^
facility trace point argument name
name name and type

I rebased the patches over I-pipe for i386 (see attached patches and extended series description), and I also started to rework the Xenomai patch. The diffstat of the latter is fairly telling:

Quoted 6 lines
 include/nucleus/ltt.h   |  111 +---------------------------
 ksrc/nucleus/Config.in  |    9 --
 ksrc/nucleus/Kconfig    |   36 ---------
 ksrc/nucleus/Makefile   |    3
 ksrc/nucleus/intr.c     |   19 ++--
 ksrc/nucleus/ltt.c      |  186

---------------------------------------

Quoted 17 lines

---------

 ksrc/nucleus/module.c   |    7 -
 ksrc/nucleus/pod.c      |  102 ++++++++++++++++----------
 ksrc/nucleus/shadow.c   |   43 +++++++----
 ksrc/nucleus/synch.c    |   19 +++-
 ksrc/nucleus/timebase.c |    6 -
 11 files changed, 125 insertions(+), 416 deletions(-)

You see, no more ltt.c, i.e. no more probe module!

At this point, we are already able to use the services of "lttv -m textDump" or lttv-gui to display traces from Xenomai kernels as event lists. Yes, I tried this, and it works! (Hint: Don't forget to ltt- armall your trace points before trying to collect data...)

Yet to be done:

Quoted 7 lines

- Finish the xnltt_log_event refactoring (half done, pod.c is missing yet - with ~30 trace point)

- Port and update the Xenomai extension over latest lttv.

Well, I'm not looking for work, I'm looking for workers :). Anyone interested and available to help with the open topics? Daniel...?

Sounds very good :-) I will see if we can contribute. Jean-Philippe is working on a comparison between Xenomai and RTOS-32 for
a x86 target system (diploma work) and is currently about to install the pretty old version (2.6.17) of xenoltt. I will see with him if it makes sense to migrate to the latest version, at this point of his work.

Quoted 2 lines

Jan

Daniel

author
#2 lore raw
Quoted 59 lines · ROSSIER Daniel
Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: vendredi, 19. octobre 2007 00:06
To: xenomai-core
Cc: ROSSIER Daniel
Subject: LTTng for Xenomai - next round

Hi,

LTTng is becoming interesting again: Mathieu uploaded a back-port to 2.6.23.1 yesterday which is already implementing the scheme that is intended to be submitted upstream.

What changed for us?

- We now have a recent patch basis for the kernel again.

- The instrumentation process was significantly simplified: No more facility registration, no more probe modules, no more XML file hacking - it's all derived from the trace points now! Some example:

trace_mark(kernel_timer_itimer_expired, "pid %d", sig->tsk->pid);
^----^ ^------------------^ ^----^
facility trace point argument name
name name and type

I rebased the patches over I-pipe for i386 (see attached patches and extended series description), and I also started to rework the Xenomai patch. The diffstat of the latter is fairly telling:

Quoted 6 lines
 include/nucleus/ltt.h   |  111 +---------------------------
 ksrc/nucleus/Config.in  |    9 --
 ksrc/nucleus/Kconfig    |   36 ---------
 ksrc/nucleus/Makefile   |    3
 ksrc/nucleus/intr.c     |   19 ++--
 ksrc/nucleus/ltt.c      |  186

---------------------------------------

Quoted 22 lines

---------

 ksrc/nucleus/module.c   |    7 -
 ksrc/nucleus/pod.c      |  102 ++++++++++++++++----------
 ksrc/nucleus/shadow.c   |   43 +++++++----
 ksrc/nucleus/synch.c    |   19 +++-
 ksrc/nucleus/timebase.c |    6 -
 11 files changed, 125 insertions(+), 416 deletions(-)

You see, no more ltt.c, i.e. no more probe module!

At this point, we are already able to use the services of "lttv -m textDump" or lttv-gui to display traces from Xenomai kernels as event lists. Yes, I tried this, and it works! (Hint: Don't forget to ltt- armall your trace points before trying to collect data...)

Yet to be done:

- Finish the xnltt_log_event refactoring (half done, pod.c is missing yet - with ~30 trace point)

- Port and update the Xenomai extension over latest lttv.

Quoted 7 lines
Quoted 2 lines

Well, I'm not looking for work, I'm looking for workers :). Anyone interested and available to help with the open topics? Daniel...?

Sounds very good :-) I will see if we can contribute. Jean-Philippe is working on a comparison between Xenomai and RTOS-32 for
a x86 target system (diploma work) and is currently about to install the pretty old version (2.6.17) of xenoltt.

Please do comparisons based on recent versions!

Quoted 2 lines

I will see with him if it makes
sense to migrate to the latest version, at this point of his work.

The largest chunk is surely the lttv plugin. Fortunately, synchronisation between plugin and instrumentation should be far simpler now. Still, lttv remains a kind of big "beast"... ;)

Regarding the instrumentation: My latest Xenomai patch changed the marker arguments even more away from your original patch. Not looking at the plugin for this, I may have removed useful information. Please let us know what you would like to see in the trace points so that this part can quickly stabilise, maybe even go into the next Xenomai release.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
author
#3 lore raw
Quoted 6 lines · Jan Kiszka

...
Regarding the instrumentation: My latest Xenomai patch changed the marker arguments even more away from your original patch. Not looking at the plugin for this, I may have removed useful information. Please let us know what you would like to see in the trace points so that this part can quickly stabilise, maybe even go into the next Xenomai release.

I decided to accelerate the core instrumentation as it looks like I will need it sooner than expected. So here comes another version of the Xenomai-part of the patch series, changing the following:

- Full conversion to trace_mark, no intermediate xnltt_log_event anymore. Unsupported kernel versions are caught by the wrapping layer instead. Thus, also ltt.h is obsolete now (bootstrap run is required for user land).

- Refactoring of all pre-existing trace points, currently focusing on making text dumps of Xenomai LTTng events more readable. This definitely breaks the older LTTV plugin for Xenomai in various ways.

- New trace points for the timer subsystem and for RTDM.

My personal plan would be to merge something like this patch before 2.4 release. The trace points should be declared as preliminary though, because I bet we will stumble over a few suboptimal or lacking instrumentations later on when starting to use this service on development and production systems.

Jan

---
 include/asm-generic/wrappers.h |    6 +
 include/nucleus/Makefile.am    |    1 
 include/nucleus/ltt.h          |  140 ------------------------------
 include/rtdm/rtdm_driver.h     |    7 +
 ksrc/nucleus/Config.in         |    9 -
 ksrc/nucleus/Kconfig           |   36 -------
 ksrc/nucleus/Makefile          |    3 
 ksrc/nucleus/intr.c            |   32 ++++---
 ksrc/nucleus/ltt.c             |  186 -----------------------------------------
 ksrc/nucleus/module.c          |    8 -
 ksrc/nucleus/pod.c             |  126 +++++++++++++++++++--------
 ksrc/nucleus/shadow.c          |   48 +++++++---
 ksrc/nucleus/synch.c           |   20 +++-
 ksrc/nucleus/timebase.c        |   27 +++--
 ksrc/nucleus/timer.c           |   25 +++++
 ksrc/skins/rtdm/core.c         |   33 +++++++
 ksrc/skins/rtdm/device.c       |   21 ++++
 ksrc/skins/rtdm/drvlib.c       |   25 +++++
 18 files changed, 286 insertions(+), 467 deletions(-)
include/nucleus/ltt.h deleted +0 -140
Index: xenomai/include/nucleus/ltt.h
===================================================================
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2004 Gilles Chanteperdrix <[email protected]>
- * Copyright (C) 2005 Philippe Gerum <[email protected]>.
- *
- * 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.
- */
-
-#ifndef _XENO_NUCLEUS_LTT_H
-#define _XENO_NUCLEUS_LTT_H
-
-#include <nucleus/types.h>
-
-#ifdef CONFIG_LTT
-
-#include <linux/ltt-core.h>
-
-struct xnltt_evmap {
-
-    char *ltt_label;	/* !< Event label (creation time). */
-    char *ltt_format;	/* !< Event format (creation time). */
-    int ltt_evid;	/* !< LTT custom event id. */
-    int ltt_filter;	/* !< Event filter. */
-};
-
-#define xeno_ev_ienter       0
-#define xeno_ev_iexit        1
-#define xeno_ev_resched      2
-#define xeno_ev_smpsched     3
-#define xeno_ev_fastsched    4
-#define xeno_ev_switch       5
-#define xeno_ev_fault        6
-#define xeno_ev_callout      7
-#define xeno_ev_finalize     8
-#define xeno_ev_thrinit      9
-#define xeno_ev_thrstart     10
-#define xeno_ev_threstart    11
-#define xeno_ev_thrdelete    12
-#define xeno_ev_thrsuspend   13
-#define xeno_ev_thresume     14
-#define xeno_ev_thrunblock   15
-#define xeno_ev_threnice     16
-#define xeno_ev_cpumigrate   17
-#define xeno_ev_sigdispatch  18
-#define xeno_ev_thrboot      19
-#define xeno_ev_tstick       20
-#define xeno_ev_sleepon      21
-#define xeno_ev_wakeup1      22
-#define xeno_ev_wakeupx      23
-#define xeno_ev_syncflush    24
-#define xeno_ev_syncforget   25
-#define xeno_ev_lohandler    26
-#define xeno_ev_primarysw    27
-#define xeno_ev_primary      28
-#define xeno_ev_secondarysw  29
-#define xeno_ev_secondary    30
-#define xeno_ev_shadowmap    31
-#define xeno_ev_shadowunmap  32
-#define xeno_ev_shadowstart  33
-#define xeno_ev_syscall      34
-#define xeno_ev_shadowexit   35
-#define xeno_ev_thrsetmode   36
-#define xeno_ev_rdrotate     37
-#define xeno_ev_rractivate   38
-#define xeno_ev_rrdeactivate 39
-#define xeno_ev_timeset      40
-#define xeno_ev_addhook      41
-#define xeno_ev_remhook      42
-#define xeno_ev_thrperiodic  43
-#define xeno_ev_thrwait      44
-#define xeno_ev_tsenable     45
-#define xeno_ev_tsdisable    46
-#define xeno_ev_mark         47
-#define xeno_ev_watchdog     48
-
-#define xeno_evthr  0x1
-#define xeno_evirq  0x2
-#define xeno_evsys  0x4
-#define xeno_evall  0x7
-
-#define XNLTT_MAX_EVENTS 64
-
-extern struct xnltt_evmap xnltt_evtable[];
-
-extern int xnltt_filter;
-
-#define xnltt_log_event(ev, args...) \
-do { \
-  if (xnltt_evtable[ev].ltt_filter & xnltt_filter) \
-    ltt_log_std_formatted_event(xnltt_evtable[ev].ltt_evid, ##args); \
-} while(0)
-
-static inline void xnltt_set_filter (int mask)
-{
-    xnltt_filter = mask;
-}
-
-static inline void xnltt_stop_tracing (void)
-{
-    xnltt_set_filter(0);
-}
-
-void xnltt_log_mark(const char *fmt,
-		    ...);
-
-int xnltt_mount(void);
-
-void xnltt_umount(void);
-
-#else /* !CONFIG_LTT */
-
-#define xnltt_log_event(ev, args...); /* Eat the semi-colon. */
-
-static inline void xnltt_log_mark (const char *fmt, ...)
-{
-}
-
-static inline void xnltt_set_filter (int mask)
-{
-}
-
-static inline void xnltt_stop_tracing (void)
-{
-}
-
-#endif /* CONFIG_LTT */
-
-#endif /* !_XENO_NUCLEUS_LTT_H_ */
ksrc/nucleus/intr.c +21 -11
Index: xenomai/ksrc/nucleus/intr.c
===================================================================
@@ -34,7 +34,6 @@
 
 #include <nucleus/pod.h>
 #include <nucleus/intr.h>
-#include <nucleus/ltt.h>
 #include <nucleus/stat.h>
 #include <asm/xenomai/bits/intr.h>
 
@@ -98,9 +97,8 @@ void xnintr_clock_handler(void)
 
 	xnarch_announce_tick();
 
-	xnltt_log_event(xeno_ev_ienter, XNARCH_TIMER_IRQ);
-	xnltt_log_event(xeno_ev_tstick, nktbase.name,
-			xnpod_current_thread()->name);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", XNARCH_TIMER_IRQ);
+	trace_mark(xn_nucleus_tbase_tick, "base %s", nktbase.name);
 
 	++sched->inesting;
 
@@ -124,7 +122,7 @@ void xnintr_clock_handler(void)
 		xnarch_relay_tick();
 	}
 
-	xnltt_log_event(xeno_ev_iexit, XNARCH_TIMER_IRQ);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", XNARCH_TIMER_IRQ);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -168,7 +166,7 @@ static void xnintr_shirq_handler(unsigne
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -212,7 +210,7 @@ static void xnintr_shirq_handler(unsigne
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -233,7 +231,7 @@ static void xnintr_edge_shirq_handler(un
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -292,7 +290,7 @@ static void xnintr_edge_shirq_handler(un
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -443,7 +441,7 @@ static void xnintr_irq_handler(unsigned 
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -490,7 +488,7 @@ static void xnintr_irq_handler(unsigned 
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -695,6 +693,9 @@ int xnintr_attach(xnintr_t *intr, void *
 	int err;
 	spl_t s;
 
+	trace_mark(xn_nucleus_irq_attach, "irq %u name %s",
+		   intr->irq, intr->name);
+
 	intr->cookie = cookie;
 	memset(&intr->stat, 0, sizeof(intr->stat));
 
@@ -750,6 +751,8 @@ int xnintr_detach(xnintr_t *intr)
 	int err;
 	spl_t s;
 
+	trace_mark(xn_nucleus_irq_detach, "irq %u", intr->irq);
+
 	xnlock_get_irqsave(&intrlock, s);
 
 	err = xnintr_irq_detach(intr);
@@ -790,6 +793,8 @@ int xnintr_detach(xnintr_t *intr)
 
 int xnintr_enable(xnintr_t *intr)
 {
+	trace_mark(xn_nucleus_irq_enable, "irq %u", intr->irq);
+
 	return xnarch_enable_irq(intr->irq);
 }
 
@@ -820,6 +825,8 @@ int xnintr_enable(xnintr_t *intr)
 
 int xnintr_disable(xnintr_t *intr)
 {
+	trace_mark(xn_nucleus_irq_disable, "irq %u", intr->irq);
+
 	return xnarch_disable_irq(intr->irq);
 }
 
@@ -844,6 +851,9 @@ int xnintr_disable(xnintr_t *intr)
 
 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr, xnarch_cpumask_t cpumask)
 {
+	trace_mark(xn_nucleus_irq_affinity, "irq %u %lu",
+		   intr->irq, *(unsigned long *)&cpumask);
+
 	return xnarch_set_irq_affinity(intr->irq, cpumask);
 }
 
ksrc/nucleus/ltt.c deleted +0 -186

186 lines not on this page · raw message

ksrc/nucleus/pod.c +87 -39

329 lines not on this page · raw message

ksrc/nucleus/shadow.c +32 -16

120 lines not on this page · raw message

ksrc/nucleus/synch.c +14 -6
Index: xenomai/ksrc/nucleus/synch.c
===================================================================
@@ -35,7 +35,6 @@
 #include <nucleus/synch.h>
 #include <nucleus/thread.h>
 #include <nucleus/module.h>
-#include <nucleus/ltt.h>
 
 /*! 
  * \fn void xnsynch_init(xnsynch_t *synch, xnflags_t flags);
@@ -174,7 +173,9 @@ void xnsynch_sleep_on(xnsynch_t *synch, 
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_sleepon, thread->name, synch);
+	trace_mark(xn_nucleus_synch_sleepon,
+		   "thread %p thread_name %s sync %p",
+		   thread, xnthread_name(thread), synch);
 
 	if (!testbits(synch->status, XNSYNCH_PRIO)) { /* i.e. FIFO */
 		appendpq(&synch->pendq, &thread->plink);
@@ -388,7 +389,9 @@ xnthread_t *xnsynch_wakeup_one_sleeper(x
 		thread->wchan = NULL;
 		synch->owner = thread;
 		xnthread_set_info(thread, XNWAKEN);
-		xnltt_log_event(xeno_ev_wakeup1, thread->name, synch);
+		trace_mark(xn_nucleus_synch_wakeup_one,
+			   "thread %p thread_name %s sync %p",
+			   thread, xnthread_name(thread), synch);
 		xnpod_resume_thread(thread, XNPEND);
 	} else
 		synch->owner = NULL;
@@ -461,7 +464,9 @@ xnpholder_t *xnsynch_wakeup_this_sleeper
 	thread->wchan = NULL;
 	synch->owner = thread;
 	xnthread_set_info(thread, XNWAKEN);
-	xnltt_log_event(xeno_ev_wakeupx, thread->name, synch);
+	trace_mark(xn_nucleus_synch_wakeup_all,
+		   "thread %p thread_name %s synch %p",
+		   thread, xnthread_name(thread), synch);
 	xnpod_resume_thread(thread, XNPEND);
 
 	if (testbits(synch->status, XNSYNCH_CLAIMED))
@@ -531,7 +536,8 @@ int xnsynch_flush(xnsynch_t *synch, xnfl
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_syncflush, synch, reason);
+	trace_mark(xn_nucleus_synch_flush, "synch %p reason %lu",
+		   synch, reason);
 
 	status = emptypq_p(&synch->pendq) ? XNSYNCH_DONE : XNSYNCH_RESCHED;
 
@@ -577,7 +583,9 @@ void xnsynch_forget_sleeper(xnthread_t *
 {
 	xnsynch_t *synch = thread->wchan;
 
-	xnltt_log_event(xeno_ev_syncforget, thread->name, synch);
+	trace_mark(xn_nucleus_synch_forget,
+		   "thread %p thread_name %s synch %p",
+		   thread, xnthread_name(thread), synch);
 
 	xnthread_clear_state(thread, XNPEND);
 	thread->wchan = NULL;
ksrc/nucleus/timebase.c +15 -12
Index: xenomai/ksrc/nucleus/timebase.c
===================================================================
@@ -53,7 +53,6 @@
 
 #include <nucleus/pod.h>
 #include <nucleus/timer.h>
-#include <nucleus/ltt.h>
 #include <nucleus/module.h>
 
 DEFINE_XNQUEUE(nktimebaseq);
@@ -378,19 +377,21 @@ void xntbase_start(xntbase_t *base)
 	xnticks_t start_date;
 	spl_t s;
 
- 	if (base == &nktbase || xntbase_enabled_p(base))
+	if (base == &nktbase || xntbase_enabled_p(base))
 		return;
 
+	trace_mark(xn_nucleus_tbase_start, "base %s", base->name);
+
 	xnlock_get_irqsave(&nklock, s);
 
-  	start_date = xnarch_get_cpu_time();
+	start_date = xnarch_get_cpu_time();
 
- 	/* Only synchronise non-isolated time bases on the master base. */
- 	if (!xntbase_isolated_p(base)) {
- 		base->wallclock_offset = xntbase_ns2ticks(base,
- 			start_date + nktbase.wallclock_offset);
- 		__setbits(base->status, XNTBSET);
- 	}
+	/* Only synchronise non-isolated time bases on the master base. */
+	if (!xntbase_isolated_p(base)) {
+		base->wallclock_offset = xntbase_ns2ticks(base,
+			start_date + nktbase.wallclock_offset);
+		__setbits(base->status, XNTBSET);
+	}
 
 	start_date += base->tickvalue;
 
@@ -433,6 +434,8 @@ void xntbase_stop(xntbase_t *base)
 
 	xntslave_stop(base2slave(base));
 	__clrbits(base->status, XNTBRUN | XNTBSET);
+
+	trace_mark(xn_nucleus_tbase_stop, "base %s", base->name);
 }
 
 /*!
@@ -469,8 +472,7 @@ void xntbase_tick(xntbase_t *base)
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_tstick, base->name,
-			xnpod_current_thread()->name);
+	trace_mark(xn_nucleus_tbase_tick, "base %s", base->name);
 
 	if (base == &nktbase)
 		xntimer_tick_aperiodic();
@@ -565,7 +567,8 @@ void xntbase_adjust_time(xntbase_t *base
 	}
 #endif /* CONFIG_XENO_OPT_TIMING_PERIODIC */
 
-	/* xnltt_log_event(xeno_ev_timeadjust, base->name, delta); */
+	trace_mark(xn_nucleus_tbase_adjust, "base %s delta %Lu",
+		   base->name, delta);
 }
 
 /* The master time base - the most precise one, aperiodic, always valid. */
ksrc/nucleus/Config.in +0 -9
Index: xenomai/ksrc/nucleus/Config.in
===================================================================
@@ -60,15 +60,6 @@ if [ "$CONFIG_XENO_OPT_NUCLEUS" != "n" ]
 	fi
 	endmenu
 
-	if [ "$CONFIG_LTT" != "n" ]; then
-		mainmenu_option next_comment
-		comment 'LTT tracepoints filtering'
-			bool 'Disable IRQ-related tracepoints' CONFIG_XENO_OPT_FILTER_EVIRQ
-			bool 'Disable thread-related tracepoints' CONFIG_XENO_OPT_FILTER_EVTHR
-			bool 'Disable syscall-related tracepoints' CONFIG_XENO_OPT_FILTER_EVSYS
-			bool 'Disable all tracepoints' CONFIG_XENO_OPT_FILTER_EVALL
-		endmenu
-	fi
 	endmenu
 fi
 
ksrc/nucleus/Kconfig +0 -36
Index: xenomai/ksrc/nucleus/Kconfig
===================================================================
@@ -339,40 +339,4 @@ config XENO_OPT_TIMER_WHEEL_STEP
 
 endmenu
 
-menu "LTT tracepoints filtering"
-
-	depends on LTT
-
-config XENO_OPT_FILTER_EVIRQ
-	bool "Disable IRQ-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside real-time interrupt handlers.
-
-config XENO_OPT_FILTER_EVTHR
-	bool "Disable thread-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside most thread-related services.
-
-config XENO_OPT_FILTER_EVSYS
-	bool "Disable syscall-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside the shadow syscall dispatcher.
-
-config XENO_OPT_FILTER_EVALL
-	bool "Disable all tracepoints"
-	help
-
-	This option disables all LTT tracepoints inside Xenomai.
-
-endmenu
-
 endif
ksrc/nucleus/Makefile +0 -3
Index: xenomai/ksrc/nucleus/Makefile
===================================================================
@@ -14,8 +14,6 @@ xeno_nucleus-$(CONFIG_XENO_OPT_MAP) += m
 
 xeno_nucleus-$(CONFIG_XENO_OPT_REGISTRY) += registry.o
 
-xeno_nucleus-$(CONFIG_LTT) += ltt.o
-
 EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai
 
 else
@@ -35,7 +33,6 @@ opt_objs-$(CONFIG_XENO_OPT_PERVASIVE) +=
 opt_objs-$(CONFIG_XENO_OPT_PIPE) += pipe.o
 opt_objs-$(CONFIG_XENO_OPT_MAP) += map.o
 opt_objs-$(CONFIG_XENO_OPT_REGISTRY) += registry.o
-opt_objs-$(CONFIG_LTT) += ltt.o
 
 xeno_nucleus-objs += $(opt_objs-y)
 
ksrc/nucleus/module.c +0 -8
Index: xenomai/ksrc/nucleus/module.c
===================================================================
@@ -34,7 +34,6 @@
 #ifdef CONFIG_XENO_OPT_PERVASIVE
 #include <nucleus/core.h>
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
-#include <nucleus/ltt.h>
 #include <asm/xenomai/bits/init.h>
 
 MODULE_DESCRIPTION("Xenomai nucleus");
@@ -1156,10 +1155,6 @@ int __init __xeno_sys_init(void)
 
 	xnintr_mount();
 
-#ifdef CONFIG_LTT
-	xnltt_mount();
-#endif /* CONFIG_LTT */
-
 #ifdef CONFIG_XENO_OPT_PIPE
 	err = xnpipe_mount();
 
@@ -1249,9 +1244,6 @@ void __exit __xeno_sys_exit(void)
 #ifdef CONFIG_XENO_OPT_PIPE
 	xnpipe_umount();
 #endif /* CONFIG_XENO_OPT_PIPE */
-#ifdef CONFIG_LTT
-	xnltt_umount();
-#endif /* CONFIG_LTT */
 #endif /* __KERNEL__ */
 
 	if (nkmsgbuf)
include/asm-generic/wrappers.h +6 -0
Index: xenomai/include/asm-generic/wrappers.h
===================================================================
@@ -275,4 +275,10 @@ unsigned long __va_to_kva(unsigned long 
 #define IRQF_SHARED			SA_SHIRQ
 #endif /* < 2.6.18 */
 
+#if defined(CONFIG_MARKERS) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+#include <linux/marker.h>
+#else /* !CONFIG_MARKERS */
+#define xnltt_log_event(ev, fmt, args...)	do { } while (0)
+#endif /* CONFIG_MARKERS */
+
 #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
ksrc/nucleus/timer.c +25 -0
Index: xenomai/ksrc/nucleus/timer.c
===================================================================
@@ -170,6 +170,10 @@ int xntimer_start_aperiodic(xntimer_t *t
 {
 	xnticks_t date, now;
 
+	trace_mark(xn_nucleus_timer_start,
+		   "timer %p base %s value %Lu interval %Lu mode %u",
+		   timer, timer->base->name, value, interval, mode);
+
 	if (!testbits(timer->status, XNTIMER_DEQUEUED))
 		xntimer_dequeue_aperiodic(timer);
 
@@ -218,6 +222,8 @@ void xntimer_stop_aperiodic(xntimer_t *t
 {
 	int heading;
 
+	trace_mark(xn_nucleus_timer_stop, "timer %p", timer);
+
 	heading = xntimer_heading_p(timer);
 	xntimer_dequeue_aperiodic(timer);
 
@@ -294,6 +300,8 @@ void xntimer_tick_aperiodic(void)
 			   dates are ordered by increasing values. */
 			break;
 
+		trace_mark(xn_nucleus_timer_expire, "timer %p", timer);
+
 		xntimer_dequeue_aperiodic(timer);
 		xnstat_counter_inc(&timer->fired);
 
@@ -371,6 +379,10 @@ static int xntimer_start_periodic(xntime
 				  xnticks_t value, xnticks_t interval,
 				  xntmode_t mode)
 {
+	trace_mark(xn_nucleus_timer_start,
+		   "timer %p base %s value %Lu interval %Lu mode %u",
+		   timer, timer->base->name, value, interval, mode);
+
 	if (!testbits(timer->status, XNTIMER_DEQUEUED))
 		xntimer_dequeue_periodic(timer);
 
@@ -406,6 +418,8 @@ static int xntimer_start_periodic(xntime
 
 static void xntimer_stop_periodic(xntimer_t *timer)
 {
+	trace_mark(xn_nucleus_timer_stop, "timer %p", timer);
+
 	xntimer_dequeue_periodic(timer);
 }
 
@@ -488,6 +502,8 @@ void xntimer_tick_periodic_inner(xntslav
 				  - base->jiffies) > 0)
 			break;
 
+		trace_mark(xn_nucleus_timer_expire, "timer %p", timer);
+
 		xntimer_dequeue_periodic(timer);
 		xnstat_counter_inc(&timer->fired);
 
@@ -625,6 +641,8 @@ void xntslave_start(xntslave_t *slave, x
 	int nr_cpus, cpu;
 	spl_t s;
 
+	trace_mark(xn_nucleus_tbase_start, "base %s", slave->base.name);
+
 	for (cpu = 0, nr_cpus = xnarch_num_online_cpus(); cpu < nr_cpus; cpu++) {
 
 		struct percpu_cascade *pc = &slave->cascade[cpu];
@@ -642,6 +660,8 @@ void xntslave_stop(xntslave_t *slave)
 	int nr_cpus, cpu;
 	spl_t s;
 
+	trace_mark(xn_nucleus_tbase_stop, "base %s", slave->base.name);
+
 	for (cpu = 0, nr_cpus = xnarch_num_online_cpus(); cpu < nr_cpus; cpu++) {
 
 		struct percpu_cascade *pc = &slave->cascade[cpu];
@@ -837,6 +857,9 @@ int xntimer_migrate(xntimer_t *timer, xn
 	int queued;
 	spl_t s;
 
+	trace_mark(xn_nucleus_timer_migrate, "timer %p cpu %d",
+		   timer, xnsched_cpu(sched));
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (sched == timer->sched)
@@ -932,6 +955,8 @@ void xntimer_freeze(void)
 	int nr_cpus, cpu;
 	spl_t s;
 
+	trace_mark(xn_nucleus_timer_freeze, MARK_NOARGS);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	nr_cpus = xnarch_num_online_cpus();
include/rtdm/rtdm_driver.h +7 -0
Index: xenomai/include/rtdm/rtdm_driver.h
===================================================================
@@ -1019,11 +1019,13 @@ void __rtdm_synch_flush(xnsynch_t *synch
 
 static inline void rtdm_event_pulse(rtdm_event_t *event)
 {
+	trace_mark(xn_rtdm_event_pulse, "event %p", event);
 	__rtdm_synch_flush(&event->synch_base, 0);
 }
 
 static inline void rtdm_event_destroy(rtdm_event_t *event)
 {
+	trace_mark(xn_rtdm_event_destroy, "event %p", event);
 	__rtdm_synch_flush(&event->synch_base, XNRMID);
 }
 #endif /* !DOXYGEN_CPP */
@@ -1044,6 +1046,7 @@ void rtdm_sem_up(rtdm_sem_t *sem);
 #ifndef DOXYGEN_CPP /* Avoid static inline tags for RTDM in doxygen */
 static inline void rtdm_sem_destroy(rtdm_sem_t *sem)
 {
+	trace_mark(xn_rtdm_sem_destroy, "sem %p", sem);
 	__rtdm_synch_flush(&sem->synch_base, XNRMID);
 }
 #endif /* !DOXYGEN_CPP */
@@ -1064,12 +1067,16 @@ static inline void rtdm_mutex_unlock(rtd
 {
 	XENO_ASSERT(RTDM, !xnpod_asynch_p(), return;);
 
+	trace_mark(xn_rtdm_mutex_unlock, "mutex %p", mutex);
+
 	if (unlikely(xnsynch_wakeup_one_sleeper(&mutex->synch_base) != NULL))
 		xnpod_schedule();
 }
 
 static inline void rtdm_mutex_destroy(rtdm_mutex_t *mutex)
 {
+	trace_mark(xn_rtdm_mutex_destroy, "mutex %p", mutex);
+
 	__rtdm_synch_flush(&mutex->synch_base, XNRMID);
 }
 #endif /* !DOXYGEN_CPP */
ksrc/skins/rtdm/core.c +33 -0
Index: xenomai/ksrc/skins/rtdm/core.c
===================================================================
@@ -204,6 +204,8 @@ int __rt_dev_open(rtdm_user_info_t *user
 	int nrt_mode = !rtdm_in_rt_context();
 
 	device = get_named_device(path);
+	trace_mark(xn_rtdm_open, "user_info %p path %s oflag %d device %p",
+		   user_info, path, oflag, device);
 	ret = -ENODEV;
 	if (!device)
 		goto err_out;
@@ -227,6 +229,8 @@ int __rt_dev_open(rtdm_user_info_t *user
 
 	fildes->context = context;
 
+	trace_mark(xn_rtdm_fd_created, "device %p fd %d", device, context->fd);
+
 	return context->fd;
 
 cleanup_out:
@@ -250,6 +254,9 @@ int __rt_dev_socket(rtdm_user_info_t *us
 	int nrt_mode = !rtdm_in_rt_context();
 
 	device = get_protocol_device(protocol_family, socket_type);
+	trace_mark(xn_rtdm_socket, "user_info %p protocol_family %d "
+		   "socket_type %d protocol %d device %p",
+		   user_info, protocol_family, socket_type, protocol, device);
 	ret = -EAFNOSUPPORT;
 	if (!device)
 		goto err_out;
@@ -273,6 +280,8 @@ int __rt_dev_socket(rtdm_user_info_t *us
 
 	fildes->context = context;
 
+	trace_mark(xn_rtdm_fd_created, "device %p fd %d", device, context->fd);
+
 	return context->fd;
 
 cleanup_out:
@@ -292,6 +301,8 @@ int __rt_dev_close(rtdm_user_info_t *use
 	int ret;
 	int nrt_mode = !rtdm_in_rt_context();
 
+	trace_mark(xn_rtdm_close, "user_info %p fd %d", user_info, fd);
+
 	ret = -EBADF;
 	if (unlikely((unsigned int)fd >= RTDM_FD_MAX))
 		goto err_out;
@@ -350,6 +361,8 @@ again:
 			 test_bit(RTDM_CREATED_IN_NRT, &context->context_flags),
 			 s);
 
+	trace_mark(xn_rtdm_fd_closed, "fd %d", fd);
+
 	return ret;
 
 unlock_out:
@@ -413,6 +426,7 @@ do {									\
 	rtdm_context_unlock(context);					\
 									\
 err_out:								\
+	trace_mark(xn_rtdm_##operation##_done, "result %d", ret);	\
 	return ret;							\
 } while (0)
 
@@ -431,6 +445,9 @@ int __rt_dev_ioctl(rtdm_user_info_t *use
 	arg = va_arg(args, void __user *);
 	va_end(args);
 
+	trace_mark(xn_rtdm_ioctl, "user_info %p fd %d request %d arg %p",
+		   user_info, fd, request, arg);
+
 	MAJOR_FUNCTION_WRAPPER_TH(ioctl, (unsigned int)request, arg);
 
 	if (unlikely(ret < 0) && (unsigned int)request == RTIOC_DEVICE_INFO) {
@@ -454,6 +471,8 @@ EXPORT_SYMBOL(__rt_dev_ioctl);
 ssize_t __rt_dev_read(rtdm_user_info_t *user_info, int fd, void *buf,
 		      size_t nbyte)
 {
+	trace_mark(xn_rtdm_read, "user_info %p fd %d buf %p nbyte %zu",
+		   user_info, fd, buf, nbyte);
 	MAJOR_FUNCTION_WRAPPER(read, buf, nbyte);
 }
 
@@ -462,6 +481,8 @@ EXPORT_SYMBOL(__rt_dev_read);
 ssize_t __rt_dev_write(rtdm_user_info_t *user_info, int fd, const void *buf,
 		       size_t nbyte)
 {
+	trace_mark(xn_rtdm_write, "user_info %p fd %d buf %p nbyte %zu",
+		   user_info, fd, buf, nbyte);
 	MAJOR_FUNCTION_WRAPPER(write, buf, nbyte);
 }
 
@@ -470,6 +491,12 @@ EXPORT_SYMBOL(__rt_dev_write);
 ssize_t __rt_dev_recvmsg(rtdm_user_info_t *user_info, int fd,
 			 struct msghdr *msg, int flags)
 {
+	trace_mark(xn_rtdm_recvmsg, "user_info %p fd %d msg_name %p "
+		   "msg_namelen %u msg_iov %p msg_iovlen %zu "
+		   "msg_control %p msg_controllen %zu msg_flags %d",
+		   user_info, fd, msg->msg_name, msg->msg_namelen,
+		   msg->msg_iov, msg->msg_iovlen, msg->msg_control,
+		   msg->msg_controllen, msg->msg_flags);
 	MAJOR_FUNCTION_WRAPPER(recvmsg, msg, flags);
 }
 
@@ -478,6 +505,12 @@ EXPORT_SYMBOL(__rt_dev_recvmsg);
 ssize_t __rt_dev_sendmsg(rtdm_user_info_t *user_info, int fd,
 			 const struct msghdr *msg, int flags)
 {
+	trace_mark(xn_rtdm_recvmsg, "user_info %p fd %d msg_name %p "
+		   "msg_namelen %u msg_iov %p msg_iovlen %zu "
+		   "msg_control %p msg_controllen %zu msg_flags %d",
+		   user_info, fd, msg->msg_name, msg->msg_namelen,
+		   msg->msg_iov, msg->msg_iovlen, msg->msg_control,
+		   msg->msg_controllen, msg->msg_flags);
 	MAJOR_FUNCTION_WRAPPER(sendmsg, msg, flags);
 }
 
ksrc/skins/rtdm/device.c +21 -0
Index: xenomai/ksrc/skins/rtdm/device.c
===================================================================
@@ -263,6 +263,13 @@ int rtdm_dev_register(struct rtdm_device
 	down(&nrt_dev_lock);
 
 	if ((device->device_flags & RTDM_DEVICE_TYPE_MASK) == RTDM_NAMED_DEVICE) {
+		trace_mark(xn_rtdm_nameddev_register, "device %p name %s "
+			   "flags %d class %d sub_class %d profile_version %d "
+			   "driver_version %d", device, device->device_name,
+			   device->device_flags, device->device_class,
+			   device->device_sub_class, device->profile_version,
+			   device->driver_version);
+
 		hashkey =
 		    get_name_hash(device->device_name, RTDM_MAX_DEVNAME_LEN,
 				  name_hashkey_mask);
@@ -290,6 +297,15 @@ int rtdm_dev_register(struct rtdm_device
 
 		up(&nrt_dev_lock);
 	} else {
+		trace_mark(xn_rtdm_protocol_register, "device %p "
+			   "protocol_family %d socket_type %d flags %d "
+			   "class %d sub_class %d profile_version %d "
+			   "driver_version %d", device,
+			   device->protocol_family, device->socket_type,
+			   device->device_flags, device->device_class,
+			   device->device_sub_class, device->profile_version,
+			   device->driver_version);
+
 		hashkey = get_proto_hash(device->protocol_family,
 					 device->socket_type);
 
@@ -372,6 +388,9 @@ int rtdm_dev_unregister(struct rtdm_devi
 	if (!reg_dev)
 		return -ENODEV;
 
+	trace_mark(xn_rtdm_dev_unregister, "device %p poll_delay %u",
+		   device, poll_delay);
+
 	down(&nrt_dev_lock);
 	xnlock_get_irqsave(&rt_dev_lock, s);
 
@@ -381,6 +400,7 @@ int rtdm_dev_unregister(struct rtdm_devi
 
 		if (!poll_delay) {
 			rtdm_dereference_device(reg_dev);
+			trace_mark(xn_rtdm_dev_busy, "device %p", device);
 			return -EAGAIN;
 		}
 
@@ -388,6 +408,7 @@ int rtdm_dev_unregister(struct rtdm_devi
 			xnlogwarn("RTDM: device %s still in use - waiting for "
 				  "release...\n", reg_dev->device_name);
 		msleep(poll_delay);
+		trace_mark(xn_rtdm_dev_poll, "device %p", device);
 
 		down(&nrt_dev_lock);
 		xnlock_get_irqsave(&rt_dev_lock, s);
ksrc/skins/rtdm/drvlib.c +25 -0
Index: xenomai/ksrc/skins/rtdm/drvlib.c
===================================================================
@@ -408,6 +408,9 @@ void rtdm_task_join_nrt(rtdm_task_t *tas
 
 	XENO_ASSERT(RTDM, xnpod_root_p(), return;);
 
+	trace_mark(xn_rtdm_task_joinnrt, "thread %p poll_delay %u",
+		   task, poll_delay);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	while (!xnthread_test_state(task, XNZOMBIE)) {
@@ -745,6 +748,8 @@ void rtdm_event_init(rtdm_event_t *event
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_event_init, "event %p pending %lu", event, pending);
+
 	/* Make atomic for re-initialisation support */
 	xnlock_get_irqsave(&nklock, s);
 
@@ -822,6 +827,8 @@ void rtdm_event_signal(rtdm_event_t *eve
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_event_signal, "event %p", event);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	xnsynch_set_flags(&event->synch_base, RTDM_EVENT_PENDING);
@@ -911,6 +918,10 @@ int rtdm_event_timedwait(rtdm_event_t *e
 
 	XENO_ASSERT(RTDM, !xnpod_unblockable_p(), return -EPERM;);
 
+	trace_mark(xn_rtdm_event_timedwait,
+		   "event %p timeout %Lu timeout_seq %p timeout_seq_value %Lu",
+		   event, timeout, timeout_seq, timeout_seq ? *timeout_seq : 0);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (unlikely(testbits(event->synch_base.status, RTDM_SYNCH_DELETED)))
@@ -979,6 +990,8 @@ void rtdm_event_clear(rtdm_event_t *even
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_event_clear, "event %p", event);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	xnsynch_clear_flags(&event->synch_base, RTDM_EVENT_PENDING);
@@ -1014,6 +1027,8 @@ void rtdm_sem_init(rtdm_sem_t *sem, unsi
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_sem_init, "sem %p value %lu", sem, value);
+
 	/* Make atomic for re-initialisation support */
 	xnlock_get_irqsave(&nklock, s);
 
@@ -1125,6 +1140,10 @@ int rtdm_sem_timeddown(rtdm_sem_t *sem, 
 
 	XENO_ASSERT(RTDM, !xnpod_unblockable_p(), return -EPERM;);
 
+	trace_mark(xn_rtdm_sem_timedwait,
+		   "sem %p timeout %Lu timeout_seq %p timeout_seq_value %Lu",
+		   sem, timeout, timeout_seq, timeout_seq ? *timeout_seq : 0);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (testbits(sem->synch_base.status, RTDM_SYNCH_DELETED))
@@ -1188,6 +1207,8 @@ void rtdm_sem_up(rtdm_sem_t *sem)
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_sem_up, "sem %p", sem);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (xnsynch_wakeup_one_sleeper(&sem->synch_base))
@@ -1349,6 +1370,10 @@ int rtdm_mutex_timedlock(rtdm_mutex_t *m
 	spl_t s;
 	int err = 0;
 
+	trace_mark(xn_rtdm_mutex_timedlock,
+		   "mutex %p timeout %Lu timeout_seq %p timeout_seq_value %Lu",
+		   mutex, timeout, timeout_seq, timeout_seq ? *timeout_seq : 0);
+
 	XENO_ASSERT(RTDM, !xnpod_unblockable_p(), return -EPERM;);
 
 	xnlock_get_irqsave(&nklock, s);
include/nucleus/Makefile.am +0 -1
Index: xenomai/include/nucleus/Makefile.am
===================================================================
@@ -8,7 +8,6 @@ includesub_HEADERS = \
 	heap.h \
 	intr.h \
 	jhash.h \
-	ltt.h \
 	map.h \
 	module.h \
 	pipe.h \
author
#4 lore raw
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka

...
Regarding the instrumentation: My latest Xenomai patch changed the marker arguments even more away from your original patch. Not looking at the plugin for this, I may have removed useful information. Please let us know what you would like to see in the trace points so that this part can quickly stabilise, maybe even go into the next Xenomai release.

Quoted 8 lines

I decided to accelerate the core instrumentation as it looks like I will need it sooner than expected. So here comes another version of the Xenomai-part of the patch series, changing the following:

- Full conversion to trace_mark, no intermediate xnltt_log_event anymore. Unsupported kernel versions are caught by the wrapping layer instead. Thus, also ltt.h is obsolete now (bootstrap run is required for user land).

Just realised: As usual, this patch nicely breaks the simulator (what is trace_mark?). Will fix with the next submission later today or tomorrow.

Jan

author
#5 lore raw
Quoted 12 lines · Jan Kiszka
Quoted 11 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka

...
Regarding the instrumentation: My latest Xenomai patch changed the marker arguments even more away from your original patch. Not looking at the plugin for this, I may have removed useful information. Please let us know what you would like to see in the trace points so that this part can quickly stabilise, maybe even go into the next Xenomai release.

I decided to accelerate the core instrumentation as it looks like I will need it sooner than expected. So here comes another version of the Xenomai-part of the patch series, changing the following:

Quoted 8 lines
Quoted 4 lines

- Full conversion to trace_mark, no intermediate xnltt_log_event anymore. Unsupported kernel versions are caught by the wrapping layer instead. Thus, also ltt.h is obsolete now (bootstrap run is required for user land).

Just realised: As usual, this patch nicely breaks the simulator (what is trace_mark?). Will fix with the next submission later today or tomorrow.

Here comes v6 of instrumentation patch. It fixes the simulator build + another build error when periodic timing was disabled.

Jan

---
 include/asm-generic/wrappers.h |    6 +
 include/asm-sim/system.h       |    3 
 include/nucleus/Makefile.am    |    1 
 include/nucleus/ltt.h          |  140 ------------------------------
 include/rtdm/rtdm_driver.h     |    7 +
 ksrc/nucleus/Config.in         |    9 -
 ksrc/nucleus/Kconfig           |   36 -------
 ksrc/nucleus/Makefile          |    3 
 ksrc/nucleus/intr.c            |   32 ++++---
 ksrc/nucleus/ltt.c             |  186 -----------------------------------------
 ksrc/nucleus/module.c          |    8 -
 ksrc/nucleus/pod.c             |  128 +++++++++++++++++++---------
 ksrc/nucleus/shadow.c          |   48 +++++++---
 ksrc/nucleus/synch.c           |   20 +++-
 ksrc/nucleus/timebase.c        |   27 +++--
 ksrc/nucleus/timer.c           |   25 +++++
 ksrc/skins/rtdm/core.c         |   33 +++++++
 ksrc/skins/rtdm/device.c       |   21 ++++
 ksrc/skins/rtdm/drvlib.c       |   25 +++++
 19 files changed, 290 insertions(+), 468 deletions(-)
include/nucleus/ltt.h deleted +0 -140
Index: xenomai/include/nucleus/ltt.h
===================================================================
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2004 Gilles Chanteperdrix <[email protected]>
- * Copyright (C) 2005 Philippe Gerum <[email protected]>.
- *
- * 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.
- */
-
-#ifndef _XENO_NUCLEUS_LTT_H
-#define _XENO_NUCLEUS_LTT_H
-
-#include <nucleus/types.h>
-
-#ifdef CONFIG_LTT
-
-#include <linux/ltt-core.h>
-
-struct xnltt_evmap {
-
-    char *ltt_label;	/* !< Event label (creation time). */
-    char *ltt_format;	/* !< Event format (creation time). */
-    int ltt_evid;	/* !< LTT custom event id. */
-    int ltt_filter;	/* !< Event filter. */
-};
-
-#define xeno_ev_ienter       0
-#define xeno_ev_iexit        1
-#define xeno_ev_resched      2
-#define xeno_ev_smpsched     3
-#define xeno_ev_fastsched    4
-#define xeno_ev_switch       5
-#define xeno_ev_fault        6
-#define xeno_ev_callout      7
-#define xeno_ev_finalize     8
-#define xeno_ev_thrinit      9
-#define xeno_ev_thrstart     10
-#define xeno_ev_threstart    11
-#define xeno_ev_thrdelete    12
-#define xeno_ev_thrsuspend   13
-#define xeno_ev_thresume     14
-#define xeno_ev_thrunblock   15
-#define xeno_ev_threnice     16
-#define xeno_ev_cpumigrate   17
-#define xeno_ev_sigdispatch  18
-#define xeno_ev_thrboot      19
-#define xeno_ev_tstick       20
-#define xeno_ev_sleepon      21
-#define xeno_ev_wakeup1      22
-#define xeno_ev_wakeupx      23
-#define xeno_ev_syncflush    24
-#define xeno_ev_syncforget   25
-#define xeno_ev_lohandler    26
-#define xeno_ev_primarysw    27
-#define xeno_ev_primary      28
-#define xeno_ev_secondarysw  29
-#define xeno_ev_secondary    30
-#define xeno_ev_shadowmap    31
-#define xeno_ev_shadowunmap  32
-#define xeno_ev_shadowstart  33
-#define xeno_ev_syscall      34
-#define xeno_ev_shadowexit   35
-#define xeno_ev_thrsetmode   36
-#define xeno_ev_rdrotate     37
-#define xeno_ev_rractivate   38
-#define xeno_ev_rrdeactivate 39
-#define xeno_ev_timeset      40
-#define xeno_ev_addhook      41
-#define xeno_ev_remhook      42
-#define xeno_ev_thrperiodic  43
-#define xeno_ev_thrwait      44
-#define xeno_ev_tsenable     45
-#define xeno_ev_tsdisable    46
-#define xeno_ev_mark         47
-#define xeno_ev_watchdog     48
-
-#define xeno_evthr  0x1
-#define xeno_evirq  0x2
-#define xeno_evsys  0x4
-#define xeno_evall  0x7
-
-#define XNLTT_MAX_EVENTS 64
-
-extern struct xnltt_evmap xnltt_evtable[];
-
-extern int xnltt_filter;
-
-#define xnltt_log_event(ev, args...) \
-do { \
-  if (xnltt_evtable[ev].ltt_filter & xnltt_filter) \
-    ltt_log_std_formatted_event(xnltt_evtable[ev].ltt_evid, ##args); \
-} while(0)
-
-static inline void xnltt_set_filter (int mask)
-{
-    xnltt_filter = mask;
-}
-
-static inline void xnltt_stop_tracing (void)
-{
-    xnltt_set_filter(0);
-}
-
-void xnltt_log_mark(const char *fmt,
-		    ...);
-
-int xnltt_mount(void);
-
-void xnltt_umount(void);
-
-#else /* !CONFIG_LTT */
-
-#define xnltt_log_event(ev, args...); /* Eat the semi-colon. */
-
-static inline void xnltt_log_mark (const char *fmt, ...)
-{
-}
-
-static inline void xnltt_set_filter (int mask)
-{
-}
-
-static inline void xnltt_stop_tracing (void)
-{
-}
-
-#endif /* CONFIG_LTT */
-
-#endif /* !_XENO_NUCLEUS_LTT_H_ */
ksrc/nucleus/intr.c +21 -11
Index: xenomai/ksrc/nucleus/intr.c
===================================================================
@@ -34,7 +34,6 @@
 
 #include <nucleus/pod.h>
 #include <nucleus/intr.h>
-#include <nucleus/ltt.h>
 #include <nucleus/stat.h>
 #include <asm/xenomai/bits/intr.h>
 
@@ -98,9 +97,8 @@ void xnintr_clock_handler(void)
 
 	xnarch_announce_tick();
 
-	xnltt_log_event(xeno_ev_ienter, XNARCH_TIMER_IRQ);
-	xnltt_log_event(xeno_ev_tstick, nktbase.name,
-			xnpod_current_thread()->name);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", XNARCH_TIMER_IRQ);
+	trace_mark(xn_nucleus_tbase_tick, "base %s", nktbase.name);
 
 	++sched->inesting;
 
@@ -124,7 +122,7 @@ void xnintr_clock_handler(void)
 		xnarch_relay_tick();
 	}
 
-	xnltt_log_event(xeno_ev_iexit, XNARCH_TIMER_IRQ);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", XNARCH_TIMER_IRQ);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -168,7 +166,7 @@ static void xnintr_shirq_handler(unsigne
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -212,7 +210,7 @@ static void xnintr_shirq_handler(unsigne
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -233,7 +231,7 @@ static void xnintr_edge_shirq_handler(un
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -292,7 +290,7 @@ static void xnintr_edge_shirq_handler(un
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -443,7 +441,7 @@ static void xnintr_irq_handler(unsigned 
 
 	prev  = xnstat_exectime_get_current(sched);
 	start = xnstat_exectime_now();
-	xnltt_log_event(xeno_ev_ienter, irq);
+	trace_mark(xn_nucleus_irq_enter, "irq %d", irq);
 
 	++sched->inesting;
 
@@ -490,7 +488,7 @@ static void xnintr_irq_handler(unsigned 
 	if (--sched->inesting == 0 && xnsched_resched_p())
 		xnpod_schedule();
 
-	xnltt_log_event(xeno_ev_iexit, irq);
+	trace_mark(xn_nucleus_irq_exit, "irq %d", irq);
 	xnstat_exectime_switch(sched, prev);
 }
 
@@ -695,6 +693,9 @@ int xnintr_attach(xnintr_t *intr, void *
 	int err;
 	spl_t s;
 
+	trace_mark(xn_nucleus_irq_attach, "irq %u name %s",
+		   intr->irq, intr->name);
+
 	intr->cookie = cookie;
 	memset(&intr->stat, 0, sizeof(intr->stat));
 
@@ -750,6 +751,8 @@ int xnintr_detach(xnintr_t *intr)
 	int err;
 	spl_t s;
 
+	trace_mark(xn_nucleus_irq_detach, "irq %u", intr->irq);
+
 	xnlock_get_irqsave(&intrlock, s);
 
 	err = xnintr_irq_detach(intr);
@@ -790,6 +793,8 @@ int xnintr_detach(xnintr_t *intr)
 
 int xnintr_enable(xnintr_t *intr)
 {
+	trace_mark(xn_nucleus_irq_enable, "irq %u", intr->irq);
+
 	return xnarch_enable_irq(intr->irq);
 }
 
@@ -820,6 +825,8 @@ int xnintr_enable(xnintr_t *intr)
 
 int xnintr_disable(xnintr_t *intr)
 {
+	trace_mark(xn_nucleus_irq_disable, "irq %u", intr->irq);
+
 	return xnarch_disable_irq(intr->irq);
 }
 
@@ -844,6 +851,9 @@ int xnintr_disable(xnintr_t *intr)
 
 xnarch_cpumask_t xnintr_affinity(xnintr_t *intr, xnarch_cpumask_t cpumask)
 {
+	trace_mark(xn_nucleus_irq_affinity, "irq %u %lu",
+		   intr->irq, *(unsigned long *)&cpumask);
+
 	return xnarch_set_irq_affinity(intr->irq, cpumask);
 }
 
ksrc/nucleus/ltt.c deleted +0 -186

186 lines not on this page · raw message

ksrc/nucleus/pod.c +88 -40

337 lines not on this page · raw message

ksrc/nucleus/shadow.c +32 -16

120 lines not on this page · raw message

ksrc/nucleus/synch.c +14 -6
Index: xenomai/ksrc/nucleus/synch.c
===================================================================
@@ -35,7 +35,6 @@
 #include <nucleus/synch.h>
 #include <nucleus/thread.h>
 #include <nucleus/module.h>
-#include <nucleus/ltt.h>
 
 /*! 
  * \fn void xnsynch_init(xnsynch_t *synch, xnflags_t flags);
@@ -174,7 +173,9 @@ void xnsynch_sleep_on(xnsynch_t *synch, 
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_sleepon, thread->name, synch);
+	trace_mark(xn_nucleus_synch_sleepon,
+		   "thread %p thread_name %s sync %p",
+		   thread, xnthread_name(thread), synch);
 
 	if (!testbits(synch->status, XNSYNCH_PRIO)) { /* i.e. FIFO */
 		appendpq(&synch->pendq, &thread->plink);
@@ -388,7 +389,9 @@ xnthread_t *xnsynch_wakeup_one_sleeper(x
 		thread->wchan = NULL;
 		synch->owner = thread;
 		xnthread_set_info(thread, XNWAKEN);
-		xnltt_log_event(xeno_ev_wakeup1, thread->name, synch);
+		trace_mark(xn_nucleus_synch_wakeup_one,
+			   "thread %p thread_name %s sync %p",
+			   thread, xnthread_name(thread), synch);
 		xnpod_resume_thread(thread, XNPEND);
 	} else
 		synch->owner = NULL;
@@ -461,7 +464,9 @@ xnpholder_t *xnsynch_wakeup_this_sleeper
 	thread->wchan = NULL;
 	synch->owner = thread;
 	xnthread_set_info(thread, XNWAKEN);
-	xnltt_log_event(xeno_ev_wakeupx, thread->name, synch);
+	trace_mark(xn_nucleus_synch_wakeup_all,
+		   "thread %p thread_name %s synch %p",
+		   thread, xnthread_name(thread), synch);
 	xnpod_resume_thread(thread, XNPEND);
 
 	if (testbits(synch->status, XNSYNCH_CLAIMED))
@@ -531,7 +536,8 @@ int xnsynch_flush(xnsynch_t *synch, xnfl
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_syncflush, synch, reason);
+	trace_mark(xn_nucleus_synch_flush, "synch %p reason %lu",
+		   synch, reason);
 
 	status = emptypq_p(&synch->pendq) ? XNSYNCH_DONE : XNSYNCH_RESCHED;
 
@@ -577,7 +583,9 @@ void xnsynch_forget_sleeper(xnthread_t *
 {
 	xnsynch_t *synch = thread->wchan;
 
-	xnltt_log_event(xeno_ev_syncforget, thread->name, synch);
+	trace_mark(xn_nucleus_synch_forget,
+		   "thread %p thread_name %s synch %p",
+		   thread, xnthread_name(thread), synch);
 
 	xnthread_clear_state(thread, XNPEND);
 	thread->wchan = NULL;
ksrc/nucleus/timebase.c +15 -12
Index: xenomai/ksrc/nucleus/timebase.c
===================================================================
@@ -53,7 +53,6 @@
 
 #include <nucleus/pod.h>
 #include <nucleus/timer.h>
-#include <nucleus/ltt.h>
 #include <nucleus/module.h>
 
 DEFINE_XNQUEUE(nktimebaseq);
@@ -378,19 +377,21 @@ void xntbase_start(xntbase_t *base)
 	xnticks_t start_date;
 	spl_t s;
 
- 	if (base == &nktbase || xntbase_enabled_p(base))
+	if (base == &nktbase || xntbase_enabled_p(base))
 		return;
 
+	trace_mark(xn_nucleus_tbase_start, "base %s", base->name);
+
 	xnlock_get_irqsave(&nklock, s);
 
-  	start_date = xnarch_get_cpu_time();
+	start_date = xnarch_get_cpu_time();
 
- 	/* Only synchronise non-isolated time bases on the master base. */
- 	if (!xntbase_isolated_p(base)) {
- 		base->wallclock_offset = xntbase_ns2ticks(base,
- 			start_date + nktbase.wallclock_offset);
- 		__setbits(base->status, XNTBSET);
- 	}
+	/* Only synchronise non-isolated time bases on the master base. */
+	if (!xntbase_isolated_p(base)) {
+		base->wallclock_offset = xntbase_ns2ticks(base,
+			start_date + nktbase.wallclock_offset);
+		__setbits(base->status, XNTBSET);
+	}
 
 	start_date += base->tickvalue;
 
@@ -433,6 +434,8 @@ void xntbase_stop(xntbase_t *base)
 
 	xntslave_stop(base2slave(base));
 	__clrbits(base->status, XNTBRUN | XNTBSET);
+
+	trace_mark(xn_nucleus_tbase_stop, "base %s", base->name);
 }
 
 /*!
@@ -469,8 +472,7 @@ void xntbase_tick(xntbase_t *base)
 
 	xnlock_get_irqsave(&nklock, s);
 
-	xnltt_log_event(xeno_ev_tstick, base->name,
-			xnpod_current_thread()->name);
+	trace_mark(xn_nucleus_tbase_tick, "base %s", base->name);
 
 	if (base == &nktbase)
 		xntimer_tick_aperiodic();
@@ -565,7 +567,8 @@ void xntbase_adjust_time(xntbase_t *base
 	}
 #endif /* CONFIG_XENO_OPT_TIMING_PERIODIC */
 
-	/* xnltt_log_event(xeno_ev_timeadjust, base->name, delta); */
+	trace_mark(xn_nucleus_tbase_adjust, "base %s delta %Lu",
+		   base->name, delta);
 }
 
 /* The master time base - the most precise one, aperiodic, always valid. */
ksrc/nucleus/Config.in +0 -9
Index: xenomai/ksrc/nucleus/Config.in
===================================================================
@@ -60,15 +60,6 @@ if [ "$CONFIG_XENO_OPT_NUCLEUS" != "n" ]
 	fi
 	endmenu
 
-	if [ "$CONFIG_LTT" != "n" ]; then
-		mainmenu_option next_comment
-		comment 'LTT tracepoints filtering'
-			bool 'Disable IRQ-related tracepoints' CONFIG_XENO_OPT_FILTER_EVIRQ
-			bool 'Disable thread-related tracepoints' CONFIG_XENO_OPT_FILTER_EVTHR
-			bool 'Disable syscall-related tracepoints' CONFIG_XENO_OPT_FILTER_EVSYS
-			bool 'Disable all tracepoints' CONFIG_XENO_OPT_FILTER_EVALL
-		endmenu
-	fi
 	endmenu
 fi
 
ksrc/nucleus/Kconfig +0 -36
Index: xenomai/ksrc/nucleus/Kconfig
===================================================================
@@ -339,40 +339,4 @@ config XENO_OPT_TIMER_WHEEL_STEP
 
 endmenu
 
-menu "LTT tracepoints filtering"
-
-	depends on LTT
-
-config XENO_OPT_FILTER_EVIRQ
-	bool "Disable IRQ-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside real-time interrupt handlers.
-
-config XENO_OPT_FILTER_EVTHR
-	bool "Disable thread-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside most thread-related services.
-
-config XENO_OPT_FILTER_EVSYS
-	bool "Disable syscall-related tracepoints"
-	default y if XENO_OPT_FILTER_EVALL=y
-	help
-
-	When LTT support is active, this option disables tracepoints
-	inside the shadow syscall dispatcher.
-
-config XENO_OPT_FILTER_EVALL
-	bool "Disable all tracepoints"
-	help
-
-	This option disables all LTT tracepoints inside Xenomai.
-
-endmenu
-
 endif
ksrc/nucleus/Makefile +0 -3
Index: xenomai/ksrc/nucleus/Makefile
===================================================================
@@ -14,8 +14,6 @@ xeno_nucleus-$(CONFIG_XENO_OPT_MAP) += m
 
 xeno_nucleus-$(CONFIG_XENO_OPT_REGISTRY) += registry.o
 
-xeno_nucleus-$(CONFIG_LTT) += ltt.o
-
 EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai
 
 else
@@ -35,7 +33,6 @@ opt_objs-$(CONFIG_XENO_OPT_PERVASIVE) +=
 opt_objs-$(CONFIG_XENO_OPT_PIPE) += pipe.o
 opt_objs-$(CONFIG_XENO_OPT_MAP) += map.o
 opt_objs-$(CONFIG_XENO_OPT_REGISTRY) += registry.o
-opt_objs-$(CONFIG_LTT) += ltt.o
 
 xeno_nucleus-objs += $(opt_objs-y)
 
ksrc/nucleus/module.c +0 -8
Index: xenomai/ksrc/nucleus/module.c
===================================================================
@@ -34,7 +34,6 @@
 #ifdef CONFIG_XENO_OPT_PERVASIVE
 #include <nucleus/core.h>
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
-#include <nucleus/ltt.h>
 #include <asm/xenomai/bits/init.h>
 
 MODULE_DESCRIPTION("Xenomai nucleus");
@@ -1156,10 +1155,6 @@ int __init __xeno_sys_init(void)
 
 	xnintr_mount();
 
-#ifdef CONFIG_LTT
-	xnltt_mount();
-#endif /* CONFIG_LTT */
-
 #ifdef CONFIG_XENO_OPT_PIPE
 	err = xnpipe_mount();
 
@@ -1249,9 +1244,6 @@ void __exit __xeno_sys_exit(void)
 #ifdef CONFIG_XENO_OPT_PIPE
 	xnpipe_umount();
 #endif /* CONFIG_XENO_OPT_PIPE */
-#ifdef CONFIG_LTT
-	xnltt_umount();
-#endif /* CONFIG_LTT */
 #endif /* __KERNEL__ */
 
 	if (nkmsgbuf)
include/asm-generic/wrappers.h +6 -0
Index: xenomai/include/asm-generic/wrappers.h
===================================================================
@@ -275,4 +275,10 @@ unsigned long __va_to_kva(unsigned long 
 #define IRQF_SHARED			SA_SHIRQ
 #endif /* < 2.6.18 */
 
+#if defined(CONFIG_MARKERS) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+#include <linux/marker.h>
+#else /* !CONFIG_MARKERS */
+#define xnltt_log_event(ev, fmt, args...)	do { } while (0)
+#endif /* CONFIG_MARKERS */
+
 #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
ksrc/nucleus/timer.c +25 -0
Index: xenomai/ksrc/nucleus/timer.c
===================================================================
@@ -170,6 +170,10 @@ int xntimer_start_aperiodic(xntimer_t *t
 {
 	xnticks_t date, now;
 
+	trace_mark(xn_nucleus_timer_start,
+		   "timer %p base %s value %Lu interval %Lu mode %u",
+		   timer, xntimer_base(timer)->name, value, interval, mode);
+
 	if (!testbits(timer->status, XNTIMER_DEQUEUED))
 		xntimer_dequeue_aperiodic(timer);
 
@@ -218,6 +222,8 @@ void xntimer_stop_aperiodic(xntimer_t *t
 {
 	int heading;
 
+	trace_mark(xn_nucleus_timer_stop, "timer %p", timer);
+
 	heading = xntimer_heading_p(timer);
 	xntimer_dequeue_aperiodic(timer);
 
@@ -294,6 +300,8 @@ void xntimer_tick_aperiodic(void)
 			   dates are ordered by increasing values. */
 			break;
 
+		trace_mark(xn_nucleus_timer_expire, "timer %p", timer);
+
 		xntimer_dequeue_aperiodic(timer);
 		xnstat_counter_inc(&timer->fired);
 
@@ -371,6 +379,10 @@ static int xntimer_start_periodic(xntime
 				  xnticks_t value, xnticks_t interval,
 				  xntmode_t mode)
 {
+	trace_mark(xn_nucleus_timer_start,
+		   "timer %p base %s value %Lu interval %Lu mode %u", timer,
+		   xntimer_base(timer)->name->name, value, interval, mode);
+
 	if (!testbits(timer->status, XNTIMER_DEQUEUED))
 		xntimer_dequeue_periodic(timer);
 
@@ -406,6 +418,8 @@ static int xntimer_start_periodic(xntime
 
 static void xntimer_stop_periodic(xntimer_t *timer)
 {
+	trace_mark(xn_nucleus_timer_stop, "timer %p", timer);
+
 	xntimer_dequeue_periodic(timer);
 }
 
@@ -488,6 +502,8 @@ void xntimer_tick_periodic_inner(xntslav
 				  - base->jiffies) > 0)
 			break;
 
+		trace_mark(xn_nucleus_timer_expire, "timer %p", timer);
+
 		xntimer_dequeue_periodic(timer);
 		xnstat_counter_inc(&timer->fired);
 
@@ -625,6 +641,8 @@ void xntslave_start(xntslave_t *slave, x
 	int nr_cpus, cpu;
 	spl_t s;
 
+	trace_mark(xn_nucleus_tbase_start, "base %s", slave->base.name);
+
 	for (cpu = 0, nr_cpus = xnarch_num_online_cpus(); cpu < nr_cpus; cpu++) {
 
 		struct percpu_cascade *pc = &slave->cascade[cpu];
@@ -642,6 +660,8 @@ void xntslave_stop(xntslave_t *slave)
 	int nr_cpus, cpu;
 	spl_t s;
 
+	trace_mark(xn_nucleus_tbase_stop, "base %s", slave->base.name);
+
 	for (cpu = 0, nr_cpus = xnarch_num_online_cpus(); cpu < nr_cpus; cpu++) {
 
 		struct percpu_cascade *pc = &slave->cascade[cpu];
@@ -837,6 +857,9 @@ int xntimer_migrate(xntimer_t *timer, xn
 	int queued;
 	spl_t s;
 
+	trace_mark(xn_nucleus_timer_migrate, "timer %p cpu %d",
+		   timer, xnsched_cpu(sched));
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (sched == timer->sched)
@@ -932,6 +955,8 @@ void xntimer_freeze(void)
 	int nr_cpus, cpu;
 	spl_t s;
 
+	trace_mark(xn_nucleus_timer_freeze, MARK_NOARGS);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	nr_cpus = xnarch_num_online_cpus();
include/rtdm/rtdm_driver.h +7 -0
Index: xenomai/include/rtdm/rtdm_driver.h
===================================================================
@@ -1019,11 +1019,13 @@ void __rtdm_synch_flush(xnsynch_t *synch
 
 static inline void rtdm_event_pulse(rtdm_event_t *event)
 {
+	trace_mark(xn_rtdm_event_pulse, "event %p", event);
 	__rtdm_synch_flush(&event->synch_base, 0);
 }
 
 static inline void rtdm_event_destroy(rtdm_event_t *event)
 {
+	trace_mark(xn_rtdm_event_destroy, "event %p", event);
 	__rtdm_synch_flush(&event->synch_base, XNRMID);
 }
 #endif /* !DOXYGEN_CPP */
@@ -1044,6 +1046,7 @@ void rtdm_sem_up(rtdm_sem_t *sem);
 #ifndef DOXYGEN_CPP /* Avoid static inline tags for RTDM in doxygen */
 static inline void rtdm_sem_destroy(rtdm_sem_t *sem)
 {
+	trace_mark(xn_rtdm_sem_destroy, "sem %p", sem);
 	__rtdm_synch_flush(&sem->synch_base, XNRMID);
 }
 #endif /* !DOXYGEN_CPP */
@@ -1064,12 +1067,16 @@ static inline void rtdm_mutex_unlock(rtd
 {
 	XENO_ASSERT(RTDM, !xnpod_asynch_p(), return;);
 
+	trace_mark(xn_rtdm_mutex_unlock, "mutex %p", mutex);
+
 	if (unlikely(xnsynch_wakeup_one_sleeper(&mutex->synch_base) != NULL))
 		xnpod_schedule();
 }
 
 static inline void rtdm_mutex_destroy(rtdm_mutex_t *mutex)
 {
+	trace_mark(xn_rtdm_mutex_destroy, "mutex %p", mutex);
+
 	__rtdm_synch_flush(&mutex->synch_base, XNRMID);
 }
 #endif /* !DOXYGEN_CPP */
ksrc/skins/rtdm/core.c +33 -0
Index: xenomai/ksrc/skins/rtdm/core.c
===================================================================
@@ -204,6 +204,8 @@ int __rt_dev_open(rtdm_user_info_t *user
 	int nrt_mode = !rtdm_in_rt_context();
 
 	device = get_named_device(path);
+	trace_mark(xn_rtdm_open, "user_info %p path %s oflag %d device %p",
+		   user_info, path, oflag, device);
 	ret = -ENODEV;
 	if (!device)
 		goto err_out;
@@ -227,6 +229,8 @@ int __rt_dev_open(rtdm_user_info_t *user
 
 	fildes->context = context;
 
+	trace_mark(xn_rtdm_fd_created, "device %p fd %d", device, context->fd);
+
 	return context->fd;
 
 cleanup_out:
@@ -250,6 +254,9 @@ int __rt_dev_socket(rtdm_user_info_t *us
 	int nrt_mode = !rtdm_in_rt_context();
 
 	device = get_protocol_device(protocol_family, socket_type);
+	trace_mark(xn_rtdm_socket, "user_info %p protocol_family %d "
+		   "socket_type %d protocol %d device %p",
+		   user_info, protocol_family, socket_type, protocol, device);
 	ret = -EAFNOSUPPORT;
 	if (!device)
 		goto err_out;
@@ -273,6 +280,8 @@ int __rt_dev_socket(rtdm_user_info_t *us
 
 	fildes->context = context;
 
+	trace_mark(xn_rtdm_fd_created, "device %p fd %d", device, context->fd);
+
 	return context->fd;
 
 cleanup_out:
@@ -292,6 +301,8 @@ int __rt_dev_close(rtdm_user_info_t *use
 	int ret;
 	int nrt_mode = !rtdm_in_rt_context();
 
+	trace_mark(xn_rtdm_close, "user_info %p fd %d", user_info, fd);
+
 	ret = -EBADF;
 	if (unlikely((unsigned int)fd >= RTDM_FD_MAX))
 		goto err_out;
@@ -350,6 +361,8 @@ again:
 			 test_bit(RTDM_CREATED_IN_NRT, &context->context_flags),
 			 s);
 
+	trace_mark(xn_rtdm_fd_closed, "fd %d", fd);
+
 	return ret;
 
 unlock_out:
@@ -413,6 +426,7 @@ do {									\
 	rtdm_context_unlock(context);					\
 									\
 err_out:								\
+	trace_mark(xn_rtdm_##operation##_done, "result %d", ret);	\
 	return ret;							\
 } while (0)
 
@@ -431,6 +445,9 @@ int __rt_dev_ioctl(rtdm_user_info_t *use
 	arg = va_arg(args, void __user *);
 	va_end(args);
 
+	trace_mark(xn_rtdm_ioctl, "user_info %p fd %d request %d arg %p",
+		   user_info, fd, request, arg);
+
 	MAJOR_FUNCTION_WRAPPER_TH(ioctl, (unsigned int)request, arg);
 
 	if (unlikely(ret < 0) && (unsigned int)request == RTIOC_DEVICE_INFO) {
@@ -454,6 +471,8 @@ EXPORT_SYMBOL(__rt_dev_ioctl);
 ssize_t __rt_dev_read(rtdm_user_info_t *user_info, int fd, void *buf,
 		      size_t nbyte)
 {
+	trace_mark(xn_rtdm_read, "user_info %p fd %d buf %p nbyte %zu",
+		   user_info, fd, buf, nbyte);
 	MAJOR_FUNCTION_WRAPPER(read, buf, nbyte);
 }
 
@@ -462,6 +481,8 @@ EXPORT_SYMBOL(__rt_dev_read);
 ssize_t __rt_dev_write(rtdm_user_info_t *user_info, int fd, const void *buf,
 		       size_t nbyte)
 {
+	trace_mark(xn_rtdm_write, "user_info %p fd %d buf %p nbyte %zu",
+		   user_info, fd, buf, nbyte);
 	MAJOR_FUNCTION_WRAPPER(write, buf, nbyte);
 }
 
@@ -470,6 +491,12 @@ EXPORT_SYMBOL(__rt_dev_write);
 ssize_t __rt_dev_recvmsg(rtdm_user_info_t *user_info, int fd,
 			 struct msghdr *msg, int flags)
 {
+	trace_mark(xn_rtdm_recvmsg, "user_info %p fd %d msg_name %p "
+		   "msg_namelen %u msg_iov %p msg_iovlen %zu "
+		   "msg_control %p msg_controllen %zu msg_flags %d",
+		   user_info, fd, msg->msg_name, msg->msg_namelen,
+		   msg->msg_iov, msg->msg_iovlen, msg->msg_control,
+		   msg->msg_controllen, msg->msg_flags);
 	MAJOR_FUNCTION_WRAPPER(recvmsg, msg, flags);
 }
 
@@ -478,6 +505,12 @@ EXPORT_SYMBOL(__rt_dev_recvmsg);
 ssize_t __rt_dev_sendmsg(rtdm_user_info_t *user_info, int fd,
 			 const struct msghdr *msg, int flags)
 {
+	trace_mark(xn_rtdm_recvmsg, "user_info %p fd %d msg_name %p "
+		   "msg_namelen %u msg_iov %p msg_iovlen %zu "
+		   "msg_control %p msg_controllen %zu msg_flags %d",
+		   user_info, fd, msg->msg_name, msg->msg_namelen,
+		   msg->msg_iov, msg->msg_iovlen, msg->msg_control,
+		   msg->msg_controllen, msg->msg_flags);
 	MAJOR_FUNCTION_WRAPPER(sendmsg, msg, flags);
 }
 
ksrc/skins/rtdm/device.c +21 -0
Index: xenomai/ksrc/skins/rtdm/device.c
===================================================================
@@ -263,6 +263,13 @@ int rtdm_dev_register(struct rtdm_device
 	down(&nrt_dev_lock);
 
 	if ((device->device_flags & RTDM_DEVICE_TYPE_MASK) == RTDM_NAMED_DEVICE) {
+		trace_mark(xn_rtdm_nameddev_register, "device %p name %s "
+			   "flags %d class %d sub_class %d profile_version %d "
+			   "driver_version %d", device, device->device_name,
+			   device->device_flags, device->device_class,
+			   device->device_sub_class, device->profile_version,
+			   device->driver_version);
+
 		hashkey =
 		    get_name_hash(device->device_name, RTDM_MAX_DEVNAME_LEN,
 				  name_hashkey_mask);
@@ -290,6 +297,15 @@ int rtdm_dev_register(struct rtdm_device
 
 		up(&nrt_dev_lock);
 	} else {
+		trace_mark(xn_rtdm_protocol_register, "device %p "
+			   "protocol_family %d socket_type %d flags %d "
+			   "class %d sub_class %d profile_version %d "
+			   "driver_version %d", device,
+			   device->protocol_family, device->socket_type,
+			   device->device_flags, device->device_class,
+			   device->device_sub_class, device->profile_version,
+			   device->driver_version);
+
 		hashkey = get_proto_hash(device->protocol_family,
 					 device->socket_type);
 
@@ -372,6 +388,9 @@ int rtdm_dev_unregister(struct rtdm_devi
 	if (!reg_dev)
 		return -ENODEV;
 
+	trace_mark(xn_rtdm_dev_unregister, "device %p poll_delay %u",
+		   device, poll_delay);
+
 	down(&nrt_dev_lock);
 	xnlock_get_irqsave(&rt_dev_lock, s);
 
@@ -381,6 +400,7 @@ int rtdm_dev_unregister(struct rtdm_devi
 
 		if (!poll_delay) {
 			rtdm_dereference_device(reg_dev);
+			trace_mark(xn_rtdm_dev_busy, "device %p", device);
 			return -EAGAIN;
 		}
 
@@ -388,6 +408,7 @@ int rtdm_dev_unregister(struct rtdm_devi
 			xnlogwarn("RTDM: device %s still in use - waiting for "
 				  "release...\n", reg_dev->device_name);
 		msleep(poll_delay);
+		trace_mark(xn_rtdm_dev_poll, "device %p", device);
 
 		down(&nrt_dev_lock);
 		xnlock_get_irqsave(&rt_dev_lock, s);
ksrc/skins/rtdm/drvlib.c +25 -0
Index: xenomai/ksrc/skins/rtdm/drvlib.c
===================================================================
@@ -408,6 +408,9 @@ void rtdm_task_join_nrt(rtdm_task_t *tas
 
 	XENO_ASSERT(RTDM, xnpod_root_p(), return;);
 
+	trace_mark(xn_rtdm_task_joinnrt, "thread %p poll_delay %u",
+		   task, poll_delay);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	while (!xnthread_test_state(task, XNZOMBIE)) {
@@ -745,6 +748,8 @@ void rtdm_event_init(rtdm_event_t *event
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_event_init, "event %p pending %lu", event, pending);
+
 	/* Make atomic for re-initialisation support */
 	xnlock_get_irqsave(&nklock, s);
 
@@ -822,6 +827,8 @@ void rtdm_event_signal(rtdm_event_t *eve
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_event_signal, "event %p", event);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	xnsynch_set_flags(&event->synch_base, RTDM_EVENT_PENDING);
@@ -911,6 +918,10 @@ int rtdm_event_timedwait(rtdm_event_t *e
 
 	XENO_ASSERT(RTDM, !xnpod_unblockable_p(), return -EPERM;);
 
+	trace_mark(xn_rtdm_event_timedwait,
+		   "event %p timeout %Lu timeout_seq %p timeout_seq_value %Lu",
+		   event, timeout, timeout_seq, timeout_seq ? *timeout_seq : 0);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (unlikely(testbits(event->synch_base.status, RTDM_SYNCH_DELETED)))
@@ -979,6 +990,8 @@ void rtdm_event_clear(rtdm_event_t *even
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_event_clear, "event %p", event);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	xnsynch_clear_flags(&event->synch_base, RTDM_EVENT_PENDING);
@@ -1014,6 +1027,8 @@ void rtdm_sem_init(rtdm_sem_t *sem, unsi
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_sem_init, "sem %p value %lu", sem, value);
+
 	/* Make atomic for re-initialisation support */
 	xnlock_get_irqsave(&nklock, s);
 
@@ -1125,6 +1140,10 @@ int rtdm_sem_timeddown(rtdm_sem_t *sem, 
 
 	XENO_ASSERT(RTDM, !xnpod_unblockable_p(), return -EPERM;);
 
+	trace_mark(xn_rtdm_sem_timedwait,
+		   "sem %p timeout %Lu timeout_seq %p timeout_seq_value %Lu",
+		   sem, timeout, timeout_seq, timeout_seq ? *timeout_seq : 0);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (testbits(sem->synch_base.status, RTDM_SYNCH_DELETED))
@@ -1188,6 +1207,8 @@ void rtdm_sem_up(rtdm_sem_t *sem)
 {
 	spl_t s;
 
+	trace_mark(xn_rtdm_sem_up, "sem %p", sem);
+
 	xnlock_get_irqsave(&nklock, s);
 
 	if (xnsynch_wakeup_one_sleeper(&sem->synch_base))
@@ -1349,6 +1370,10 @@ int rtdm_mutex_timedlock(rtdm_mutex_t *m
 	spl_t s;
 	int err = 0;
 
+	trace_mark(xn_rtdm_mutex_timedlock,
+		   "mutex %p timeout %Lu timeout_seq %p timeout_seq_value %Lu",
+		   mutex, timeout, timeout_seq, timeout_seq ? *timeout_seq : 0);
+
 	XENO_ASSERT(RTDM, !xnpod_unblockable_p(), return -EPERM;);
 
 	xnlock_get_irqsave(&nklock, s);
include/nucleus/Makefile.am +0 -1
Index: xenomai/include/nucleus/Makefile.am
===================================================================
@@ -8,7 +8,6 @@ includesub_HEADERS = \
 	heap.h \
 	intr.h \
 	jhash.h \
-	ltt.h \
 	map.h \
 	module.h \
 	pipe.h \
include/asm-sim/system.h +3 -0
Index: xenomai/include/asm-sim/system.h
===================================================================
@@ -261,6 +261,9 @@ xnarch_read_environ (const char *name, c
 #define __init
 #define __exit
 
+/* Kernel markers */
+#define trace_mark(...);
+
 #define container_of(ptr, type, member) ({                      \
         const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
         (type *)( (char *)__mptr - offsetof(type,member) );})
#6 lore raw
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Jan Kiszka
Quoted 15 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka

...
Regarding the instrumentation: My latest Xenomai patch changed the marker arguments even more away from your original patch. Not looking at the plugin for this, I may have removed useful information. Please let us know what you would like to see in the trace points so that this part can quickly stabilise, maybe even go into the next Xenomai release.

I decided to accelerate the core instrumentation as it looks like I will need it sooner than expected. So here comes another version of the Xenomai-part of the patch series, changing the following:

- Full conversion to trace_mark, no intermediate xnltt_log_event anymore. Unsupported kernel versions are caught by the wrapping layer instead. Thus, also ltt.h is obsolete now (bootstrap run is required for user land).

Quoted 7 lines
Quoted 3 lines

Just realised: As usual, this patch nicely breaks the simulator (what is trace_mark?). Will fix with the next submission later today or tomorrow.

Here comes v6 of instrumentation patch. It fixes the simulator build + another build error when periodic timing was disabled.

Ok, we want this in for -rc6 I think, so that we can build over it asap.
Will merge, thanks.

Signature · 1 line
Philippe.