Module: xenomai-forge
Branch: rtdm-api-waitqueues
Commit: 331c89247191d5b78096930f65d246c4be627991
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=331c89247191d5b78096930f65d246c4be627991

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Apr 17 12:29:55 2014 +0200

cobalt/sched: expose thread personality via /proc/xenomai/sched/threads

---

 kernel/cobalt/sched.c  |    9 ++++++---
 kernel/cobalt/shadow.c |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 7f05052..93e44ac 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -864,6 +864,7 @@ struct vfile_schedlist_data {
        pid_t pid;
        char name[XNOBJECT_NAME_LEN];
        char sched_class[XNOBJECT_NAME_LEN];
+       char personality[XNOBJECT_NAME_LEN];
        int cprio;
        xnticks_t timeout;
        unsigned long state;
@@ -912,6 +913,7 @@ static int vfile_schedlist_next(struct 
xnvfile_snapshot_iterator *it,
        p->cprio = thread->cprio;
        p->state = xnthread_state_flags(thread);
        xnobject_copy_name(p->sched_class, thread->sched_class->name);
+       xnobject_copy_name(p->personality, thread->personality->name);
        period = xnthread_get_period(thread);
        timeout = xnthread_get_timeout(thread, priv->start_time);
        /*
@@ -942,8 +944,8 @@ static int vfile_schedlist_show(struct 
xnvfile_snapshot_iterator *it,
 
        if (p == NULL)
                xnvfile_printf(it,
-                              "%-3s  %-6s %-5s  %-8s %-8s  %-10s %s\n",
-                              "CPU", "PID", "CLASS", "PRI", "TIMEOUT",
+                              "%-3s  %-6s %-5s  %-8s  %-5s %-8s  %-10s %s\n",
+                              "CPU", "PID", "CLASS", "PERS", "PRI", "TIMEOUT",
                               "STAT", "NAME");
        else {
                ksformat(pbuf, sizeof(pbuf), "%3d", p->cprio);
@@ -951,10 +953,11 @@ static int vfile_schedlist_show(struct 
xnvfile_snapshot_iterator *it,
                xnthread_format_status(p->state, sbuf, sizeof(sbuf));
 
                xnvfile_printf(it,
-                              "%3u  %-6d %-5s  %-8s %-8s  %-10s %s\n",
+                              "%3u  %-6d %-5s  %-8s  %-5s %-8s  %-10s %s\n",
                               p->cpu,
                               p->pid,
                               p->sched_class,
+                              p->personality,
                               pbuf,
                               tbuf,
                               sbuf,
diff --git a/kernel/cobalt/shadow.c b/kernel/cobalt/shadow.c
index 7108645..1d188f6 100644
--- a/kernel/cobalt/shadow.c
+++ b/kernel/cobalt/shadow.c
@@ -2663,7 +2663,7 @@ void xnshadow_cleanup(void)
 
 /* Xenomai's generic personality. */
 struct xnpersonality xenomai_personality = {
-       .name = "xenomai",
+       .name = "core",
        /* .magic = 0 */
 };
 EXPORT_SYMBOL_GPL(xenomai_personality);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to