aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_trace.c
diff options
context:
space:
mode:
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);