Module: xenomai-2.6
Branch: master
Commit: a07e5c7515f35570d8a4c0dd8e8981fc023a3199
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=a07e5c7515f35570d8a4c0dd8e8981fc023a3199

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Sep 23 16:41:50 2012 +0200

nucleus/debug: allow resetting xnlock statistics

---

 ksrc/nucleus/pod.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 1f4a749..5aae394 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -3144,8 +3144,33 @@ static int lock_vfile_show(struct 
xnvfile_regular_iterator *it, void *data)
        return 0;
 }
 
+static ssize_t lock_vfile_store(struct xnvfile_input *input)
+{
+       ssize_t ret;
+       spl_t s;
+       int cpu;
+
+       long val;
+
+       ret = xnvfile_get_integer(input, &val);
+       if (ret < 0)
+               return ret;
+
+       if (val != 0)
+               return -EINVAL;
+
+       for_each_online_cpu(cpu) {
+               xnlock_get_irqsave(&nklock, s);
+               memset(&xnlock_stats[cpu], '\0', sizeof(xnlock_stats[cpu]));
+               xnlock_put_irqrestore(&nklock, s);
+       }
+
+       return ret;
+}
+
 static struct xnvfile_regular_ops lock_vfile_ops = {
        .show = lock_vfile_show,
+       .store = lock_vfile_store,
 };
 
 static struct xnvfile_regular lock_vfile = {


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

Reply via email to