Commit 8f4708bc authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/thread: flesh out state info returned by EVL_THRIOC_GET_STATE



This enables threads running out-of-band to retrieve most of the raw
thread-related state information "evl ps" accesses through /sysfs
attributes.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent ae3b59f1
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <uapi/evl/sched.h> #include <uapi/evl/sched.h>
#define EVL_ABI_LEVEL 8 #define EVL_ABI_LEVEL 9
#define EVL_CONTROL_DEV "/dev/evl/control" #define EVL_CONTROL_DEV "/dev/evl/control"
......
...@@ -82,7 +82,12 @@ struct evl_user_window { ...@@ -82,7 +82,12 @@ struct evl_user_window {
struct evl_thread_state { struct evl_thread_state {
struct evl_sched_attrs eattrs; struct evl_sched_attrs eattrs;
int cpu; __u32 cpu;
__u32 state;
__u32 isw;
__u32 csw;
__u32 sc;
__u64 xtime;
}; };
#define EVL_THREAD_IOCBASE 'T' #define EVL_THREAD_IOCBASE 'T'
......
...@@ -2017,6 +2017,11 @@ void evl_get_thread_state(struct evl_thread *thread, ...@@ -2017,6 +2017,11 @@ void evl_get_thread_state(struct evl_thread *thread,
statebuf->eattrs.sched_priority = thread->cprio; statebuf->eattrs.sched_priority = thread->cprio;
__get_sched_attrs(thread->sched_class, thread, &statebuf->eattrs); __get_sched_attrs(thread->sched_class, thread, &statebuf->eattrs);
statebuf->cpu = evl_rq_cpu(thread->rq); statebuf->cpu = evl_rq_cpu(thread->rq);
statebuf->state = evl_rq_cpu(thread->rq);
statebuf->isw = thread->stat.isw.counter;
statebuf->csw = thread->stat.csw.counter;
statebuf->sc = thread->stat.sc.counter;
statebuf->xtime = ktime_to_ns(thread->stat.account.total);
xnlock_put_irqrestore(&nklock, flags); xnlock_put_irqrestore(&nklock, flags);
} }
EXPORT_SYMBOL_GPL(evl_get_thread_state); EXPORT_SYMBOL_GPL(evl_get_thread_state);
......
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