Module: xenomai-forge
Branch: next
Commit: c3d5792bc0def09f32136db88dcec67b2db17526
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=c3d5792bc0def09f32136db88dcec67b2db17526

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Sep 19 15:51:55 2014 +0200

cobalt/thread, cobalt/sched: cosmetic fix to kthread names

---

 kernel/cobalt/sched.c  |   13 +++++++++----
 kernel/cobalt/thread.c |    5 ++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 465fe52..2f8d277 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -1008,7 +1008,7 @@ 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  %-5s %-8s  %-10s %s\n",
+                              "%3u  %-6d %-5s  %-8s  %-5s %-8s  %-10s 
%s%s%s\n",
                               p->cpu,
                               p->pid,
                               p->sched_class,
@@ -1016,7 +1016,9 @@ static int vfile_schedlist_show(struct 
xnvfile_snapshot_iterator *it,
                               pbuf,
                               tbuf,
                               sbuf,
-                              p->name);
+                              (p->state & XNUSER) ? "" : "[",
+                              p->name,
+                              (p->state & XNUSER) ? "" : "]");
        }
 
        return 0;
@@ -1210,9 +1212,12 @@ static int vfile_schedstat_show(struct 
xnvfile_snapshot_iterator *it,
                }
                xnvfile_printf(it,
                               "%3u  %-6d %-10lu %-10lu %-10lu %-4lu  %.8x  
%3u.%u"
-                              "  %s\n",
+                              "  %s%s%s\n",
                               p->cpu, p->pid, p->ssw, p->csw, p->xsc, p->pf, 
p->state,
-                              usage / 10, usage % 10, p->name);
+                              usage / 10, usage % 10,
+                              (p->state & XNUSER) ? "" : "[",
+                              p->name,
+                              (p->state & XNUSER) ? "" : "]");
        }
 
        return 0;
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 7c2405a..f44bfe0 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -162,11 +162,10 @@ int __xnthread_init(struct xnthread *thread,
 
        if (attr->name)
                ksformat(thread->name,
-                        sizeof(thread->name), flags & XNUSER ?
-                        "%s" : "[%s]", attr->name);
+                        sizeof(thread->name), "%s", attr->name);
        else
                ksformat(thread->name,
-                        sizeof(thread->name), "[%p]", thread);
+                        sizeof(thread->name), "@%p", thread);
 
        thread->personality = attr->personality;
        cpus_and(thread->affinity, attr->affinity, nkaffinity);


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

Reply via email to