Commit fab0540a authored by Jan Kiszka's avatar Jan Kiszka Committed by Philippe Gerum

kernel/cobalt: Add reason to gorelax trace point

Trace and print the name of the relaxation reason whenever available.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 23bb3153
......@@ -1997,7 +1997,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);
trace_cobalt_shadow_gorelax(thread, reason);
/*
* If you intend to change the following interrupt-free
......
......@@ -357,9 +357,29 @@ DEFINE_EVENT(thread_event, cobalt_shadow_hardened,
TP_ARGS(thread)
);
DEFINE_EVENT(thread_event, cobalt_shadow_gorelax,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
#define cobalt_print_relax_reason(reason) \
__print_symbolic(reason, \
{ SIGDEBUG_UNDEFINED, "undefined" }, \
{ SIGDEBUG_MIGRATE_SIGNAL, "signal" }, \
{ SIGDEBUG_MIGRATE_SYSCALL, "syscall" }, \
{ SIGDEBUG_MIGRATE_FAULT, "fault" })
TRACE_EVENT(cobalt_shadow_gorelax,
TP_PROTO(struct xnthread *thread, int reason),
TP_ARGS(thread, 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))
);
DEFINE_EVENT(thread_event, cobalt_shadow_relaxed,
......
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