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

cobalt/tracing: Trace changes of the current thread priority



Specifically useful to validate scheduling during PI or PP phases.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 6bb5cf69
......@@ -466,6 +466,8 @@ bool xnsched_set_effective_priority(struct xnthread *thread, int prio)
thread->cprio = prio;
trace_cobalt_thread_set_current_prio(thread);
return true;
}
......@@ -507,6 +509,8 @@ void xnsched_track_policy(struct xnthread *thread,
xnsched_enqueue(thread);
}
trace_cobalt_thread_set_current_prio(thread);
xnsched_set_resched(thread->sched);
}
......@@ -533,6 +537,8 @@ void xnsched_protect_priority(struct xnthread *thread, int prio)
if (xnthread_test_state(thread, XNREADY))
xnsched_enqueue(thread);
trace_cobalt_thread_set_current_prio(thread);
xnsched_set_resched(thread->sched);
}
......
......@@ -309,6 +309,26 @@ TRACE_EVENT(cobalt_thread_fault,
__entry->type)
);
TRACE_EVENT(cobalt_thread_set_current_prio,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread),
TP_STRUCT__entry(
__field(struct xnthread *, thread)
__string(name, thread->name)
__field(int, cprio)
),
TP_fast_assign(
__entry->thread = thread;
__assign_str(name, thread->name);
__entry->cprio = xnthread_current_priority(thread);
),
TP_printk("thread=%p(%s) prio=%d",
__entry->thread, __get_str(name), __entry->cprio)
);
DEFINE_EVENT(thread_event, cobalt_thread_start,
TP_PROTO(struct xnthread *thread),
TP_ARGS(thread)
......
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