Module: xenomai-jki Branch: queues/ftrace Commit: 66c011b0de4cc4bd0bc50b521308aad13f53ec21 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=66c011b0de4cc4bd0bc50b521308aad13f53ec21
Author: Jan Kiszka <[email protected]> Date: Mon Oct 18 12:54:33 2010 +0200 Basic trace events conversion Convert important nucleus tracepoints into TRACE_EVENT format, providing both the opportunity to build them against LTTng markers and upstream kernel event tracepoints. This also introduces a new header group: include/trace contains tracepoint definitions that need to be put into include/trace/events by prepare-kernel.sh. Signed-off-by: Jan Kiszka <[email protected]> --- include/trace/xn_nucleus.h | 518 ++++++++++++++++++++++++++++++++++++++++++++ ksrc/nucleus/pod.c | 48 ++--- ksrc/nucleus/shadow.c | 43 +--- scripts/prepare-kernel.sh | 3 +- 4 files changed, 548 insertions(+), 64 deletions(-) diff --git a/include/trace/xn_nucleus.h b/include/trace/xn_nucleus.h new file mode 100644 index 0000000..47bb864 --- /dev/null +++ b/include/trace/xn_nucleus.h @@ -0,0 +1,518 @@ +#ifndef CONFIG_MARKERS + +#if !defined(_TRACE_XN_NUCLEUS_MAIN_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_XN_NUCLEUS_H + +#include <linux/tracepoint.h> + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM xn_nucleus + +DECLARE_EVENT_CLASS(thread_event_verbose, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __array(char, thread_name, XNOBJECT_NAME_LEN) + ), + + TP_fast_assign( + __entry->thread = thread; + memcpy(__entry->thread_name, xnthread_name(thread), + XNOBJECT_NAME_LEN); + ), + + TP_printk("thread=%p thread_name=%s", + __entry->thread, __entry->thread_name) +); + +DECLARE_EVENT_CLASS(thread_event, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + ), + + TP_fast_assign( + __entry->thread = thread; + ), + + TP_printk("thread=%p", __entry->thread) +); + +DECLARE_EVENT_CLASS(syscall_entry, + TP_PROTO(struct xnthread *thread, int muxid, int muxop), + TP_ARGS(thread, muxid, muxop), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __array(char, thread_name, XNOBJECT_NAME_LEN) + __field(int, muxid) + __field(int, muxop) + ), + + TP_fast_assign( + __entry->thread = thread; + __entry->thread_name[0] = 0; + if (thread) + memcpy(__entry->thread_name, xnthread_name(thread), + XNOBJECT_NAME_LEN); + __entry->muxid = muxid; + __entry->muxop = muxop; + ), + + TP_printk("thread=%p thread_name=%s muxid=%d muxop=%d", + __entry->thread, __entry->thread_name, __entry->muxid, + __entry->muxop) +); + +DECLARE_EVENT_CLASS(syscall_exit, + TP_PROTO(struct xnthread *thread, int result), + TP_ARGS(thread, result), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __field(int, result) + ), + + TP_fast_assign( + __entry->thread = thread; + __entry->result = result; + ), + + TP_printk("thread=%p result=%d", + __entry->thread, __entry->result) +); + +TRACE_EVENT(xn_nucleus_sched, + TP_PROTO(struct xnsched *sched), + TP_ARGS(sched), + + TP_STRUCT__entry( + __field(unsigned long, status) + ), + + TP_fast_assign( + __entry->status = sched->status; + ), + + TP_printk("status=%lx", __entry->status) +); + +TRACE_EVENT(xn_nucleus_sched_remote, + TP_PROTO(struct xnsched *sched), + TP_ARGS(sched), + + TP_STRUCT__entry( + __field(unsigned long, status) + ), + + TP_fast_assign( + __entry->status = sched->status; + ), + + TP_printk("status=%lx", __entry->status) +); + +TRACE_EVENT(xn_nucleus_sched_switch, + TP_PROTO(struct xnthread *prev, struct xnthread *next), + TP_ARGS(prev, next), + + TP_STRUCT__entry( + __field(struct xnthread *, prev) + __field(struct xnthread *, next) + __array(char, prev_name, XNOBJECT_NAME_LEN) + __array(char, next_name, XNOBJECT_NAME_LEN) + ), + + TP_fast_assign( + __entry->prev = prev; + __entry->next = next; + memcpy(__entry->prev_name, xnthread_name(prev), + XNOBJECT_NAME_LEN); + memcpy(__entry->next_name, xnthread_name(next), + XNOBJECT_NAME_LEN); + ), + + TP_printk("prev=%p prev_name=%s next=%p next_name=%s", + __entry->prev, __entry->prev_name, + __entry->next, __entry->next_name) +); + +TRACE_EVENT(xn_nucleus_sched_sigdispatch, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread), + + TP_STRUCT__entry( + __field(unsigned long, signals) + ), + + TP_fast_assign( + __entry->signals = thread->signals; + ), + + TP_printk("signals=%lx", __entry->signals) +); + +TRACE_EVENT(xn_nucleus_thread_init, + TP_PROTO(struct xnthread *thread, + const struct xnthread_init_attr *attr, + struct xnsched_class *sched_class), + TP_ARGS(thread, attr, sched_class), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __array(char, thread_name, XNOBJECT_NAME_LEN) + __field(xnflags_t, flags) + __array(char, class_name, XNOBJECT_NAME_LEN) + __field(int, cprio) + ), + + TP_fast_assign( + __entry->thread = thread; + memcpy(__entry->thread_name, xnthread_name(thread), + XNOBJECT_NAME_LEN); + __entry->flags = attr->flags; + memcpy(__entry->class_name, sched_class->name, + XNOBJECT_NAME_LEN-1); + __entry->class_name[XNOBJECT_NAME_LEN-1] = 0; + __entry->cprio = thread->cprio; + ), + + TP_printk("thread=%p thread_name=%s flags=%lx class=%s prio=%d", + __entry->thread, __entry->thread_name, __entry->flags, + __entry->class_name, __entry->cprio) +); + +TRACE_EVENT(xn_nucleus_thread_suspend, + TP_PROTO(struct xnthread *thread, xnflags_t mask, xnticks_t timeout, + xntmode_t timeout_mode, xnsynch_t *wchan), + TP_ARGS(thread, mask, timeout, timeout_mode, wchan), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __field(xnflags_t, mask) + __field(xnticks_t, timeout) + __field(xntmode_t, timeout_mode) + __field(xnsynch_t *, wchan) + ), + + TP_fast_assign( + __entry->thread = thread; + __entry->mask = mask; + __entry->timeout = timeout; + __entry->timeout_mode = timeout_mode; + __entry->wchan = wchan; + ), + + TP_printk("thread=%p mask=%lu timeout=%Lu timeout_mode=%d wchan=%p", + __entry->thread, __entry->mask, + __entry->timeout, __entry->timeout_mode, __entry->wchan) +); + +TRACE_EVENT(xn_nucleus_thread_resume, + TP_PROTO(struct xnthread *thread, xnflags_t mask), + TP_ARGS(thread, mask), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __field(xnflags_t, mask) + ), + + TP_fast_assign( + __entry->thread = thread; + __entry->mask = mask; + ), + + TP_printk("thread=%p mask=%lx", + __entry->thread, __entry->mask) +); + +TRACE_EVENT(xn_nucleus_thread_fault, + TP_PROTO(struct xnthread *thread, xnarch_fltinfo_t *fltinfo), + TP_ARGS(thread, fltinfo), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __array(char, thread_name, XNOBJECT_NAME_LEN) + __field(void *, ip) + __field(unsigned int, type) + ), + + TP_fast_assign( + __entry->thread = thread; + memcpy(__entry->thread_name, xnthread_name(thread), + XNOBJECT_NAME_LEN); + __entry->ip = (void *)xnarch_fault_pc(fltinfo); + __entry->type = xnarch_fault_trap(fltinfo); + ), + + TP_printk("thread=%p thread_name=%s ip=%p type=%x", + __entry->thread, __entry->thread_name, __entry->ip, + __entry->type) +); + +DEFINE_EVENT(thread_event, xn_nucleus_thread_delete, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread) +); + +DEFINE_EVENT(thread_event, xn_nucleus_shadow_gohard, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread) +); + +DEFINE_EVENT(thread_event_verbose, xn_nucleus_shadow_hardened, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread) +); + +DEFINE_EVENT(thread_event, xn_nucleus_shadow_gorelax, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread) +); + +DEFINE_EVENT(thread_event_verbose, xn_nucleus_shadow_relaxed, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread) +); + +TRACE_EVENT(xn_nucleus_shadow_map, + TP_PROTO(struct xnthread *thread), + TP_ARGS(thread), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __array(char, thread_name, XNOBJECT_NAME_LEN) + __field(int, prio) + ), + + TP_fast_assign( + __entry->thread = thread; + memcpy(__entry->thread_name, xnthread_name(thread), + XNOBJECT_NAME_LEN); + __entry->prio = xnthread_base_priority(thread); + ), + + TP_printk("thread=%p thread_name=%s prio=%d", + __entry->thread, __entry->thread_name, __entry->prio) +); + +TRACE_EVENT(xn_nucleus_shadow_unmap, + TP_PROTO(struct xnthread *thread, struct task_struct *task), + TP_ARGS(thread, task), + + TP_STRUCT__entry( + __field(struct xnthread *, thread) + __array(char, thread_name, XNOBJECT_NAME_LEN) + __field(pid_t, pid) + __array(char, comm, TASK_COMM_LEN) + ), + + TP_fast_assign( + __entry->thread = thread; + memcpy(__entry->thread_name, xnthread_name(thread), + XNOBJECT_NAME_LEN); + if (task) { + __entry->pid = task->pid; + memcpy(__entry->comm, task->comm, TASK_COMM_LEN); + } else { + __entry->pid = -1; + __entry->comm[0] = 0; + } + ), + + TP_printk("thread=%p thread_name=%s pid=%d comm=%s", + __entry->thread, __entry->thread_name, __entry->pid, + __entry->comm) +); + +DEFINE_EVENT(syscall_entry, xn_nucleus_sys_histage_entry, + TP_PROTO(struct xnthread *thread, int muxid, int muxop), + TP_ARGS(thread, muxid, muxop) +); + +DEFINE_EVENT(syscall_exit, xn_nucleus_sys_histage_exit, + TP_PROTO(struct xnthread *thread, int result), + TP_ARGS(thread, result) +); + +DEFINE_EVENT(syscall_entry, xn_nucleus_sys_lostage_entry, + TP_PROTO(struct xnthread *thread, int muxid, int muxop), + TP_ARGS(thread, muxid, muxop) +); + +DEFINE_EVENT(syscall_exit, xn_nucleus_sys_lostage_exit, + TP_PROTO(struct xnthread *thread, int result), + TP_ARGS(thread, result) +); + +#endif /* _TRACE_XN_NUCLEUS_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> + +#else /* CONFIG_MARKERS */ + +/* LTTng support */ + +static inline void trace_xn_nucleus_sched(struct xnsched *sched) +{ + trace_mark(xn_nucleus, sched, MARK_NOARGS); +} + +static inline void trace_xn_nucleus_sched_remote(struct xnsched *sched) +{ + trace_mark(xn_nucleus, sched_remote, MARK_NOARGS); +} + +static inline void +trace_xn_nucleus_sched_switch(struct xnthread *prev, struct xnthread *next) +{ + trace_mark(xn_nucleus, sched_switch, + "prev %p prev_name %s " + "next %p next_name %s", + prev, xnthread_name(prev), + next, xnthread_name(next)); +} + +static inline void trace_xn_nucleus_sched_sigdispatch(struct xnthread *thread) +{ + trace_mark(xn_nucleus, sched_sigdispatch, "signals %lu", + thread->signals); +} + +static inline void +trace_xn_nucleus_thread_init(struct xnthread *thread, + const struct xnthread_init_attr *attr, + struct xnsched_class *sched_class) +{ + trace_mark(xn_nucleus, thread_init, + "thread %p thread_name %s flags %lu class %s prio %d", + thread, xnthread_name(thread), attr->flags, + sched_class->name, thread->cprio); +} + +static inline void +trace_xn_nucleus_thread_suspend(struct xnthread *thread, xnflags_t mask, + xnticks_t timeout, xntmode_t timeout_mode, + xnsynch_t *wchan) +{ + trace_mark(xn_nucleus, thread_suspend, + "thread %p thread_name %s mask %lu timeout %Lu " + "timeout_mode %d wchan %p", + thread, xnthread_name(thread), mask, timeout, + timeout_mode, wchan); +} + +static inline void +trace_xn_nucleus_thread_resume(struct xnthread *thread, xnflags_t mask) +{ + trace_mark(xn_nucleus, thread_resume, + "thread %p thread_name %s mask %lu", + thread, xnthread_name(thread), mask); +} + +static inline void +trace_xn_nucleus_thread_fault(struct xnthread *thread, + xnarch_fltinfo_t *fltinfo) +{ + trace_mark(xn_nucleus, thread_fault, + "thread %p thread_name %s ip %p type 0x%x", + thread, xnthread_name(thread), + (void *)xnarch_fault_pc(fltinfo), + xnarch_fault_trap(fltinfo)); +} + +static inline void +trace_xn_nucleus_thread_delete(struct xnthread *thread) +{ + trace_mark(xn_nucleus, thread_delete, "thread %p thread_name %s", + thread, xnthread_name(thread)); +} + +static inline void +trace_xn_nucleus_shadow_gohard(struct xnthread *thread) +{ + trace_mark(xn_nucleus, shadow_gohard, + "thread %p thread_name %s comm %s", + thread, xnthread_name(thread), current->comm); +} + +static inline void +trace_xn_nucleus_shadow_hardened(struct xnthread *thread) +{ + trace_mark(xn_nucleus, shadow_hardened, "thread %p thread_name %s", + thread, xnthread_name(thread)); +} + +static inline void +trace_xn_nucleus_shadow_gorelax(struct xnthread *thread) +{ + trace_mark(xn_nucleus, shadow_gorelax, "thread %p thread_name %s", + thread, xnthread_name(thread)); +} + +static inline void +trace_xn_nucleus_shadow_relaxed(struct xnthread *thread) +{ + trace_mark(xn_nucleus, shadow_relaxed, + "thread %p thread_name %s comm %s", + thread, xnthread_name(thread), current->comm); +} + +static inline void +trace_xn_nucleus_shadow_map(struct xnthread *thread) +{ + trace_mark(xn_nucleus, shadow_map, + "thread %p thread_name %s pid %d priority %d", + thread, xnthread_name(thread), current->pid, + xnthread_base_priority(thread)); +} + +static inline void +trace_xn_nucleus_shadow_unmap(struct xnthread *thread, + struct task_struct *task) +{ + trace_mark(xn_nucleus, shadow_unmap, + "thread %p thread_name %s pid %d", + thread, xnthread_name(thread), task ? task->pid : -1); +} + +static inline void +trace_xn_nucleus_sys_histage_entry(struct xnthread *thread, int muxid, + int muxop) +{ + trace_mark(xn_nucleus, syscall_histage_entry, + "thread %p thread_name %s muxid %d muxop %d", + thread, thread ? xnthread_name(thread) : NULL, + muxid, muxop); +} + +static inline void +trace_xn_nucleus_sys_histage_exit(struct xnthread *thread, int result) +{ + trace_mark(xn_nucleus, syscall_histage_exit, + "ret %ld", __xn_reg_rval(regs)); +} + +static inline void +trace_xn_nucleus_sys_lostage_entry(struct xnthread *thread, int muxid, + int muxop) +{ + trace_mark(xn_nucleus, syscall_lostage_entry, + "thread %p thread_name %s muxid %d muxop %d", + thread, thread ? xnthread_name(thread) : NULL, + muxid, muxop); +} + +static inline void +trace_xn_nucleus_sys_lostage_exit(struct xnthread *thread, int result) +{ + trace_mark(xn_nucleus, syscall_lostage_exit, + "ret %ld", __xn_reg_rval(regs)); +} + +#endif /* CONFIG_MARKERS */ diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 9a02e80..651f9a6 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -46,6 +46,9 @@ #include <nucleus/select.h> #include <asm/xenomai/bits/pod.h> +#define CREATE_TRACE_POINTS +#include <trace/events/xn_nucleus.h> + /* * NOTE: We need to initialize the globals; remember that this code * also runs over the simulator in user-space. @@ -267,16 +270,13 @@ EXPORT_SYMBOL_GPL(xnpod_fatal_helper); void xnpod_schedule_handler(void) /* Called with hw interrupts off. */ { - xnsched_t *sched; + xnsched_t *sched = xnpod_current_sched(); - trace_mark(xn_nucleus, sched_remote, MARK_NOARGS); xnarch_memory_barrier(); + trace_xn_nucleus_sched_remote(sched); #if defined(CONFIG_SMP) && defined(CONFIG_XENO_OPT_PRIOCPL) - sched = xnpod_current_sched(); if (testbits(sched->rpistatus, XNRPICK)) xnshadow_rpi_check(); -#else - (void)sched; #endif /* CONFIG_SMP && CONFIG_XENO_OPT_PRIOCPL */ xnpod_schedule(); } @@ -637,10 +637,7 @@ int xnpod_init_thread(struct xnthread *thread, if (ret) return ret; - trace_mark(xn_nucleus, thread_init, - "thread %p thread_name %s flags %lu class %s prio %d", - thread, xnthread_name(thread), attr->flags, - sched_class->name, thread->cprio); + trace_xn_nucleus_thread_init(thread, attr, sched_class); xnlock_get_irqsave(&nklock, s); appendq(&nkpod->threadq, &thread->glink); @@ -1162,8 +1159,7 @@ void xnpod_delete_thread(xnthread_t *thread) nkpod->schedhook(thread, XNDELETED); #endif /* __XENO_SIM__ */ - trace_mark(xn_nucleus, thread_delete, "thread %p thread_name %s", - thread, xnthread_name(thread)); + trace_xn_nucleus_thread_delete(thread); removeq(&nkpod->threadq, &thread->glink); xnvfile_touch_tag(&nkpod->threadlist_tag); @@ -1370,11 +1366,8 @@ void xnpod_suspend_thread(xnthread_t *thread, xnflags_t mask, xnlock_get_irqsave(&nklock, s); - trace_mark(xn_nucleus, thread_suspend, - "thread %p thread_name %s mask %lu timeout %Lu " - "timeout_mode %d wchan %p", - thread, xnthread_name(thread), mask, timeout, - timeout_mode, wchan); + trace_xn_nucleus_thread_suspend(thread, mask, timeout, timeout_mode, + wchan); sched = thread->sched; oldstate = thread->state; @@ -1595,9 +1588,7 @@ void xnpod_resume_thread(struct xnthread *thread, xnflags_t mask) xnlock_get_irqsave(&nklock, s); - trace_mark(xn_nucleus, thread_resume, - "thread %p thread_name %s mask %lu", - thread, xnthread_name(thread), mask); + trace_xn_nucleus_thread_resume(thread, mask); xnarch_trace_pid(xnthread_user_task(thread) ? xnarch_user_pid(xnthread_archtcb(thread)) : -1, xnthread_current_priority(thread)); @@ -2018,8 +2009,7 @@ void xnpod_dispatch_signals(void) || thread->asr == XNTHREAD_INVALID_ASR) return; - trace_mark(xn_nucleus, sched_sigdispatch, "signals %lu", - thread->signals); + trace_xn_nucleus_sched_sigdispatch(thread); /* Start the asynchronous service routine */ oldmode = xnthread_test_state(thread, XNTHREAD_MODE_BITS); @@ -2193,10 +2183,10 @@ void __xnpod_schedule(struct xnsched *sched) if (xnarch_escalate()) return; - trace_mark(xn_nucleus, sched, MARK_NOARGS); - xnlock_get_irqsave(&nklock, s); + trace_xn_nucleus_sched(sched); + curr = sched->curr; xnarch_trace_pid(xnthread_user_task(curr) ? @@ -2227,11 +2217,7 @@ reschedule: prev = curr; - trace_mark(xn_nucleus, sched_switch, - "prev %p prev_name %s " - "next %p next_name %s", - prev, xnthread_name(prev), - next, xnthread_name(next)); + trace_xn_nucleus_sched_switch(prev, next); #ifdef CONFIG_XENO_OPT_PERVASIVE shadow = xnthread_test_state(prev, XNSHADOW); @@ -2572,11 +2558,7 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo) thread = xnpod_current_thread(); - trace_mark(xn_nucleus, thread_fault, - "thread %p thread_name %s ip %p type 0x%x", - thread, xnthread_name(thread), - (void *)xnarch_fault_pc(fltinfo), - xnarch_fault_trap(fltinfo)); + trace_xn_nucleus_thread_fault(thread, fltinfo); #ifdef __KERNEL__ if (xnarch_fault_fpu_p(fltinfo)) { diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index bd0096f..d963f05 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -56,6 +56,7 @@ #include <asm/xenomai/features.h> #include <asm/xenomai/syscall.h> #include <asm/xenomai/bits/shadow.h> +#include <trace/events/xn_nucleus.h> static int xn_gid_arg = -1; module_param_named(xenomai_gid, xn_gid_arg, int, 0644); @@ -983,9 +984,7 @@ redo: * out. */ - trace_mark(xn_nucleus, shadow_gohard, - "thread %p thread_name %s comm %s", - thread, xnthread_name(thread), this_task->comm); + trace_xn_nucleus_shadow_gohard(thread); sched->gktarget = thread; xnthread_set_info(thread, XNATOMIC); @@ -1048,8 +1047,7 @@ redo: if (rpi_p(thread)) rpi_clear_remote(thread); - trace_mark(xn_nucleus, shadow_hardened, "thread %p thread_name %s", - thread, xnthread_name(thread)); + trace_xn_nucleus_shadow_hardened(thread); /* * Recheck pending signals once again. As we block task wakeups during @@ -1118,8 +1116,7 @@ void xnshadow_relax(int notify, int reason) * domain to the Linux domain. This will cause the Linux task * to resume using the register state of the shadow thread. */ - trace_mark(xn_nucleus, shadow_gorelax, "thread %p thread_name %s", - thread, xnthread_name(thread)); + trace_xn_nucleus_shadow_gorelax(thread); /* * If you intend to change the following interrupt-free @@ -1194,9 +1191,7 @@ void xnshadow_relax(int notify, int reason) if (thread->u_mode) *(thread->u_mode) = thread->state; - trace_mark(xn_nucleus, shadow_relaxed, - "thread %p thread_name %s comm %s", - thread, xnthread_name(thread), current->comm); + trace_xn_nucleus_shadow_relaxed(thread); } EXPORT_SYMBOL_GPL(xnshadow_relax); @@ -1332,10 +1327,7 @@ int xnshadow_map(xnthread_t *thread, xncompletion_t __user *u_completion, affinity = xnarch_cpumask_of_cpu(xnarch_first_cpu(affinity)); set_cpus_allowed(current, affinity); - trace_mark(xn_nucleus, shadow_map, - "thread %p thread_name %s pid %d priority %d", - thread, xnthread_name(thread), current->pid, - xnthread_base_priority(thread)); + trace_xn_nucleus_shadow_map(thread); xnarch_init_shadow_tcb(xnthread_archtcb(thread), thread, xnthread_name(thread)); @@ -1434,9 +1426,7 @@ void xnshadow_unmap(xnthread_t *thread) xnarch_atomic_dec(&sys_ppd->refcnt); - trace_mark(xn_nucleus, shadow_unmap, - "thread %p thread_name %s pid %d", - thread, xnthread_name(thread), p ? p->pid : -1); + trace_xn_nucleus_shadow_unmap(thread, p); if (!p) return; @@ -2259,10 +2249,7 @@ static inline int do_hisyscall_event(unsigned event, unsigned domid, void *data) muxid = __xn_mux_id(regs); muxop = __xn_mux_op(regs); - trace_mark(xn_nucleus, syscall_histage_entry, - "thread %p thread_name %s muxid %d muxop %d", - thread, thread ? xnthread_name(thread) : NULL, - muxid, muxop); + trace_xn_nucleus_sys_histage_entry(thread, muxid, muxop); if (muxid < 0 || muxid > XENOMAI_MUX_NR || muxop < 0 || muxop >= muxtable[muxid].props->nrcalls) { @@ -2372,8 +2359,7 @@ static inline int do_hisyscall_event(unsigned event, unsigned domid, void *data) ret_handled: - trace_mark(xn_nucleus, syscall_histage_exit, - "ret %ld", __xn_reg_rval(regs)); + trace_xn_nucleus_sys_histage_exit(thread, __xn_reg_rval(regs)); return RTHAL_EVENT_STOP; linux_syscall: @@ -2471,11 +2457,9 @@ static inline int do_losyscall_event(unsigned event, unsigned domid, void *data) muxid = __xn_mux_id(regs); muxop = __xn_mux_op(regs); - trace_mark(xn_nucleus, syscall_lostage_entry, - "thread %p thread_name %s muxid %d muxop %d", - xnpod_active_p() ? xnpod_current_thread() : NULL, - xnpod_active_p() ? xnthread_name(xnpod_current_thread()) : NULL, - muxid, muxop); + trace_xn_nucleus_sys_lostage_entry(xnpod_active_p() ? + xnpod_current_thread() : NULL, + muxid, muxop); /* Processing a real-time skin syscall. */ @@ -2534,8 +2518,7 @@ static inline int do_losyscall_event(unsigned event, unsigned domid, void *data) xnshadow_relax(0, 0); ret_handled: - trace_mark(xn_nucleus, syscall_lostage_exit, - "ret %ld", __xn_reg_rval(regs)); + trace_xn_nucleus_sys_lostage_exit(thread, __xn_reg_rval(regs)); return RTHAL_EVENT_STOP; } diff --git a/scripts/prepare-kernel.sh b/scripts/prepare-kernel.sh index 02e80ff..3c4f16f 100755 --- a/scripts/prepare-kernel.sh +++ b/scripts/prepare-kernel.sh @@ -585,9 +585,10 @@ patch_link r n include/asm-$xenomai_arch $linux_include_asm/xenomai patch_architecture_specific="n" patch_link r n include/asm-generic include/asm-generic/xenomai patch_link n n include include/xenomai +patch_link n n include/trace include/trace/events cd $xenomai_root for d in include/* ; do - if test -d $d -a -z "`echo $d | grep '^include/asm-'`"; then + if test -d $d -a -z "`echo $d | grep '^include/\(asm-\|trace\)'`"; then destdir=`echo $d | sed -e 's,^\(include\)\(/.*\)$,\1/xenomai\2,'` patch_link r n $d $destdir fi _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
