Commit e23670a7 authored by Jan Kiszka's avatar Jan Kiszka Committed by Philippe Gerum
Browse files

cobalt/tracing: Don't report current thread in tracepoints



All these are synchronous, and the thread context is already recorded by
ftrace.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent af10d389
......@@ -734,7 +734,7 @@ static inline int handle_exception(struct ipipe_trap_data *d)
if (xnthread_test_state(thread, XNROOT))
return 0;
trace_cobalt_thread_fault(thread, d);
trace_cobalt_thread_fault(d);
if (xnarch_fault_fpu_p(d)) {
#ifdef CONFIG_XENO_ARCH_FPU
......
......@@ -524,7 +524,7 @@ static int handle_head_syscall(struct ipipe_domain *ipd, struct pt_regs *regs)
nr = code & (__NR_COBALT_SYSCALLS - 1);
trace_cobalt_head_sysentry(thread, code);
trace_cobalt_head_sysentry(code);
process = cobalt_current_process();
if (process == NULL) {
......@@ -661,7 +661,7 @@ ret_handled:
xnthread_sync_window(thread);
}
trace_cobalt_head_sysexit(thread, __xn_reg_rval(regs));
trace_cobalt_head_sysexit(__xn_reg_rval(regs));
return KEVENT_STOP;
......@@ -723,7 +723,7 @@ static int handle_root_syscall(struct ipipe_domain *ipd, struct pt_regs *regs)
code = __xn_syscall(regs);
nr = code & (__NR_COBALT_SYSCALLS - 1);
trace_cobalt_root_sysentry(thread, code);
trace_cobalt_root_sysentry(code);
/* Processing a Xenomai syscall. */
......@@ -802,7 +802,7 @@ ret_handled:
xnthread_sync_window(thread);
}
trace_cobalt_root_sysexit(thread, __xn_reg_rval(regs));
trace_cobalt_root_sysexit(__xn_reg_rval(regs));
return KEVENT_STOP;
}
......
......@@ -217,7 +217,7 @@ int xnsynch_sleep_on(struct xnsynch *synch, xnticks_t timeout,
xnlock_get_irqsave(&nklock, s);
trace_cobalt_synch_sleepon(synch, thread);
trace_cobalt_synch_sleepon(synch);
if ((synch->status & XNSYNCH_PRIO) == 0) /* i.e. FIFO */
list_add_tail(&thread->plink, &synch->pendq);
......@@ -603,7 +603,7 @@ int xnsynch_try_acquire(struct xnsynch *synch)
curr = xnthread_current();
lockp = xnsynch_fastlock(synch);
trace_cobalt_synch_try_acquire(synch, curr);
trace_cobalt_synch_try_acquire(synch);
h = atomic_cmpxchg(lockp, XN_NO_HANDLE,
get_owner_handle(curr->handle, synch));
......@@ -671,7 +671,7 @@ int xnsynch_acquire(struct xnsynch *synch, xnticks_t timeout,
curr = xnthread_current();
currh = curr->handle;
lockp = xnsynch_fastlock(synch);
trace_cobalt_synch_acquire(synch, curr);
trace_cobalt_synch_acquire(synch);
redo:
/* Basic form of xnsynch_try_acquire(). */
h = atomic_cmpxchg(lockp, XN_NO_HANDLE,
......
......@@ -2078,7 +2078,7 @@ void xnthread_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_cobalt_shadow_gorelax(thread, reason);
trace_cobalt_shadow_gorelax(reason);
/*
* If you intend to change the following interrupt-free
......
......@@ -50,24 +50,38 @@ DECLARE_EVENT_CLASS(thread_event,
__entry->state, __entry->info)
);
DECLARE_EVENT_CLASS(synch_wait_event,
TP_PROTO(struct xnsynch *synch, struct xnthread *thread),
TP_ARGS(synch, thread),
DECLARE_EVENT_CLASS(curr_thread_event,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__string(name, thread->name)
__field(unsigned long, state)
__field(unsigned long, info)
),
TP_fast_assign(
__entry->state = thread->state;
__entry->info = thread->info;
),
TP_printk("state=0x%lx info=0x%lx",
__entry->state, __entry->info)
);
DECLARE_EVENT_CLASS(synch_wait_event,
TP_PROTO(struct xnsynch *synch),
TP_ARGS(synch),
TP_STRUCT__entry(
__field(struct xnsynch *, synch)
),
TP_fast_assign(
__entry->thread = thread;
__assign_str(name, thread->name);
__entry->synch = synch;
),
TP_printk("synch=%p thread=%p(%s)",
__entry->synch, __entry->thread, __get_str(name))
TP_printk("synch=%p", __entry->synch)
);
DECLARE_EVENT_CLASS(synch_post_event,
......@@ -115,26 +129,6 @@ DECLARE_EVENT_CLASS(clock_event,
TP_printk("clock_irq=%u", __entry->irq)
);
DECLARE_EVENT_CLASS(thread_migrate,
TP_PROTO(struct xnthread *thread, unsigned int cpu),
TP_ARGS(thread, cpu),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__string(name, thread->name)
__field(unsigned int, cpu)
),
TP_fast_assign(
__entry->thread = thread;
__assign_str(name, thread->name);
__entry->cpu = cpu;
),
TP_printk("thread=%p(%s) cpu=%u",
__entry->thread, __get_str(name), __entry->cpu)
);
DECLARE_EVENT_CLASS(timer_event,
TP_PROTO(struct xntimer *timer),
TP_ARGS(timer),
......@@ -287,26 +281,21 @@ TRACE_EVENT(cobalt_thread_resume,
);
TRACE_EVENT(cobalt_thread_fault,
TP_PROTO(struct xnthread *thread, struct ipipe_trap_data *td),
TP_ARGS(thread, td),
TP_PROTO(struct ipipe_trap_data *td),
TP_ARGS(td),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__string(name, thread->name)
__field(void *, ip)
__field(unsigned int, type)
),
TP_fast_assign(
__entry->thread = thread;
__assign_str(name, thread->name);
__entry->ip = (void *)xnarch_fault_pc(td);
__entry->type = xnarch_fault_trap(td);
),
TP_printk("thread=%p(%s) ip=%p type=%x",
__entry->thread, __get_str(name), __entry->ip,
__entry->type)
TP_printk("ip=%p type=%x",
__entry->ip, __entry->type)
);
TRACE_EVENT(cobalt_thread_set_current_prio,
......@@ -349,42 +338,67 @@ DEFINE_EVENT(thread_event, cobalt_thread_unblock,
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_thread_wait_period,
DEFINE_EVENT(curr_thread_event, cobalt_thread_wait_period,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_thread_missed_period,
DEFINE_EVENT(curr_thread_event, cobalt_thread_missed_period,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_thread_set_mode,
DEFINE_EVENT(curr_thread_event, cobalt_thread_set_mode,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
DEFINE_EVENT(thread_migrate, cobalt_thread_migrate,
TP_PROTO(struct xnthread *thread, unsigned int cpu),
TP_ARGS(thread, cpu)
TRACE_EVENT(cobalt_thread_migrate,
TP_PROTO(unsigned int cpu),
TP_ARGS(cpu),
TP_STRUCT__entry(
__field(unsigned int, cpu)
),
TP_fast_assign(
__entry->cpu = cpu;
),
TP_printk("cpu=%u", __entry->cpu)
);
DEFINE_EVENT(thread_migrate, cobalt_thread_migrate_passive,
TRACE_EVENT(cobalt_thread_migrate_passive,
TP_PROTO(struct xnthread *thread, unsigned int cpu),
TP_ARGS(thread, cpu)
TP_ARGS(thread, cpu),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__string(name, thread->name)
__field(unsigned int, cpu)
),
TP_fast_assign(
__entry->thread = thread;
__assign_str(name, thread->name);
__entry->cpu = cpu;
),
TP_printk("thread=%p(%s) cpu=%u",
__entry->thread, __get_str(name), __entry->cpu)
);
DEFINE_EVENT(thread_event, cobalt_shadow_gohard,
DEFINE_EVENT(curr_thread_event, cobalt_shadow_gohard,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_watchdog_signal,
DEFINE_EVENT(curr_thread_event, cobalt_watchdog_signal,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_shadow_hardened,
DEFINE_EVENT(curr_thread_event, cobalt_shadow_hardened,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
......@@ -397,29 +411,26 @@ DEFINE_EVENT(thread_event, cobalt_shadow_hardened,
{ SIGDEBUG_MIGRATE_FAULT, "fault" })
TRACE_EVENT(cobalt_shadow_gorelax,
TP_PROTO(struct xnthread *thread, int reason),
TP_ARGS(thread, reason),
TP_PROTO(int reason),
TP_ARGS(reason),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__field(int, reason)
),
TP_fast_assign(
__entry->thread = thread;
__entry->reason = reason;
),
TP_printk("thread=%p reason=%s",
__entry->thread, cobalt_print_relax_reason(__entry->reason))
TP_printk("reason=%s", cobalt_print_relax_reason(__entry->reason))
);
DEFINE_EVENT(thread_event, cobalt_shadow_relaxed,
DEFINE_EVENT(curr_thread_event, cobalt_shadow_relaxed,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_shadow_entry,
DEFINE_EVENT(curr_thread_event, cobalt_shadow_entry,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
......@@ -444,7 +455,7 @@ TRACE_EVENT(cobalt_shadow_map,
__entry->thread, __get_str(name), __entry->prio)
);
DEFINE_EVENT(thread_event, cobalt_shadow_unmap,
DEFINE_EVENT(curr_thread_event, cobalt_shadow_unmap,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
);
......@@ -622,18 +633,18 @@ TRACE_EVENT(cobalt_timer_migrate,
#endif /* CONFIG_SMP */
DEFINE_EVENT(synch_wait_event, cobalt_synch_sleepon,
TP_PROTO(struct xnsynch *synch, struct xnthread *thread),
TP_ARGS(synch, thread)
TP_PROTO(struct xnsynch *synch),
TP_ARGS(synch)
);
DEFINE_EVENT(synch_wait_event, cobalt_synch_try_acquire,
TP_PROTO(struct xnsynch *synch, struct xnthread *thread),
TP_ARGS(synch, thread)
TP_PROTO(struct xnsynch *synch),
TP_ARGS(synch)
);
DEFINE_EVENT(synch_wait_event, cobalt_synch_acquire,
TP_PROTO(struct xnsynch *synch, struct xnthread *thread),
TP_ARGS(synch, thread)
TP_PROTO(struct xnsynch *synch),
TP_ARGS(synch)
);
DEFINE_EVENT(synch_post_event, cobalt_synch_release,
......
......@@ -161,42 +161,33 @@
DECLARE_EVENT_CLASS(syscall_entry,
TP_PROTO(struct xnthread *thread, unsigned int nr),
TP_ARGS(thread, nr),
TP_PROTO(unsigned int nr),
TP_ARGS(nr),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__string(name, thread ? thread->name : "(anon)")
__field(unsigned int, nr)
),
TP_fast_assign(
__entry->thread = thread;
__assign_str(name, thread ? thread->name : "(anon)");
__entry->nr = nr;
),
TP_printk("thread=%p(%s) syscall=%s",
__entry->thread, __get_str(name),
__cobalt_syscall_name(__entry->nr))
TP_printk("syscall=%s", __cobalt_syscall_name(__entry->nr))
);
DECLARE_EVENT_CLASS(syscall_exit,
TP_PROTO(struct xnthread *thread, long result),
TP_ARGS(thread, result),
TP_PROTO(long result),
TP_ARGS(result),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__field(long, result)
),
TP_fast_assign(
__entry->thread = thread;
__entry->result = result;
),
TP_printk("thread=%p result=%ld",
__entry->thread, __entry->result)
TP_printk("result=%ld", __entry->result)
);
#define cobalt_print_sched_policy(__policy) \
......@@ -281,23 +272,23 @@ DECLARE_EVENT_CLASS(cobalt_void,
);
DEFINE_EVENT(syscall_entry, cobalt_head_sysentry,
TP_PROTO(struct xnthread *thread, unsigned int nr),
TP_ARGS(thread, nr)
TP_PROTO(unsigned int nr),
TP_ARGS(nr)
);
DEFINE_EVENT(syscall_exit, cobalt_head_sysexit,
TP_PROTO(struct xnthread *thread, long result),
TP_ARGS(thread, result)
TP_PROTO(long result),
TP_ARGS(result)
);
DEFINE_EVENT(syscall_entry, cobalt_root_sysentry,
TP_PROTO(struct xnthread *thread, unsigned int nr),
TP_ARGS(thread, nr)
TP_PROTO(unsigned int nr),
TP_ARGS(nr)
);
DEFINE_EVENT(syscall_exit, cobalt_root_sysexit,
TP_PROTO(struct xnthread *thread, long result),
TP_ARGS(thread, result)
TP_PROTO(long result),
TP_ARGS(result)
);
DEFINE_EVENT(cobalt_posix_schedparam, cobalt_pthread_create,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment