aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_trace.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-04-04 00:33:51 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-05-06 02:16:56 -0400
commit4a29865689dbb87a02e3b0fff4a4ae5041273173 (patch)
tree72c9f1641a9fb05e3ae4d8cc068f62f9c566bae9 /kernel/rcutree_trace.c
parentd71df90eadfc35aa549ff9a850842673febca71f (diff)
rcu: make rcutorture version numbers available through debugfs
It is not possible to accurately correlate rcutorture output with that of debugfs. This patch therefore adds a debugfs file that prints out the rcutorture version number, permitting easy correlation. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r--kernel/rcutree_trace.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index fc40e89a028c..3baa235786b5 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -394,6 +394,29 @@ static const struct file_operations rcu_pending_fops = {
394 .release = single_release, 394 .release = single_release,
395}; 395};
396 396
397static int show_rcutorture(struct seq_file *m, void *unused)
398{
399 seq_printf(m, "rcutorture test sequence: %lu %s\n",
400 rcutorture_testseq >> 1,
401 (rcutorture_testseq & 0x1) ? "(test in progress)" : "");
402 seq_printf(m, "rcutorture update version number: %lu\n",
403 rcutorture_vernum);
404 return 0;
405}
406
407static int rcutorture_open(struct inode *inode, struct file *file)
408{
409 return single_open(file, show_rcutorture, NULL);
410}
411
412static const struct file_operations rcutorture_fops = {
413 .owner = THIS_MODULE,
414 .open = rcutorture_open,
415 .read = seq_read,
416 .llseek = seq_lseek,
417 .release = single_release,
418};
419
397static struct dentry *rcudir; 420static struct dentry *rcudir;
398 421
399static int __init rcutree_trace_init(void) 422static int __init rcutree_trace_init(void)
@@ -430,6 +453,11 @@ static int __init rcutree_trace_init(void)
430 NULL, &rcu_pending_fops); 453 NULL, &rcu_pending_fops);
431 if (!retval) 454 if (!retval)
432 goto free_out; 455 goto free_out;
456
457 retval = debugfs_create_file("rcutorture", 0444, rcudir,
458 NULL, &rcutorture_fops);
459 if (!retval)
460 goto free_out;
433 return 0; 461 return 0;
434free_out: 462free_out:
435 debugfs_remove_recursive(rcudir); 463 debugfs_remove_recursive(rcudir);