Module: xenomai-forge Branch: master Commit: cca5f8690344498271d8c60fef79897ceffa15a1 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=cca5f8690344498271d8c60fef79897ceffa15a1
Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org> Date: Sun Sep 23 16:41:50 2012 +0200 nucleus/debug: allow resetting xnlock statistics --- kernel/cobalt/nucleus/pod.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/kernel/cobalt/nucleus/pod.c b/kernel/cobalt/nucleus/pod.c index db49b15..9b1f933 100644 --- a/kernel/cobalt/nucleus/pod.c +++ b/kernel/cobalt/nucleus/pod.c @@ -2916,8 +2916,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