Commit 7b0812b3 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/wait: display waitqueue name in trace


Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
parent 382242af
......@@ -22,6 +22,7 @@ struct evl_wait_channel {
int (*follow_depend)(struct evl_wait_channel *wchan,
struct evl_thread *originator);
struct list_head wait_list;
const char *name;
};
struct evl_wait_queue {
......@@ -39,6 +40,7 @@ struct evl_wait_queue {
.reorder_wait = evl_reorder_wait, \
.follow_depend = evl_follow_wait_depend, \
.wait_list = LIST_HEAD_INIT((__name).wchan.wait_list), \
.name = #__name, \
}, \
}
......
......@@ -18,13 +18,12 @@
#include <linux/tracepoint.h>
#include <linux/trace_seq.h>
#include <evl/timer.h>
#include <evl/wait.h>
struct evl_rq;
struct evl_thread;
struct evl_sched_attrs;
struct evl_init_thread_attr;
struct evl_wait_channel;
struct evl_wait_queue;
struct evl_mutex;
struct evl_clock;
......@@ -72,14 +71,14 @@ DECLARE_EVENT_CLASS(wq_event,
TP_ARGS(wq),
TP_STRUCT__entry(
__field(struct evl_wait_queue *, wq)
__string(name, wq->wchan.name)
),
TP_fast_assign(
__entry->wq = wq;
__assign_str(name, wq->wchan.name);
),
TP_printk("wq=%p", __entry->wq)
TP_printk("wq=%s", __get_str(name))
);
DECLARE_EVENT_CLASS(mutex_event,
......@@ -705,6 +704,11 @@ DEFINE_EVENT(wq_event, evl_flush_wait,
TP_ARGS(wq)
);
DEFINE_EVENT(wq_event, evl_finish_wait,
TP_PROTO(struct evl_wait_queue *wq),
TP_ARGS(wq)
);
DEFINE_EVENT(mutex_event, evl_mutex_trylock,
TP_PROTO(struct evl_mutex *mutex),
TP_ARGS(mutex)
......
......@@ -21,6 +21,7 @@ void __evl_init_wait(struct evl_wait_queue *wq,
raw_spin_lock_init(&wq->lock);
wq->wchan.reorder_wait = evl_reorder_wait;
wq->wchan.follow_depend = evl_follow_wait_depend;
wq->wchan.name = name;
INIT_LIST_HEAD(&wq->wchan.wait_list);
lockdep_set_class_and_name(&wq->lock, key, name);
}
......@@ -147,6 +148,8 @@ int evl_wait_schedule(struct evl_wait_queue *wq)
evl_schedule();
trace_evl_finish_wait(wq);
/*
* Upon return from schedule, we may or may not have been
* unlinked from the wait channel, depending on whether we
......
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