[tip:core/rcu] rcutorture: Print SRCU lock/unlock totals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  ac3748c60426602c091c8c9281c95fadb781fcc0
Gitweb:     http://git.kernel.org/tip/ac3748c60426602c091c8c9281c95fadb781fcc0
Author:     Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
AuthorDate: Mon, 22 May 2017 13:59:52 -0700
Committer:  Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
CommitDate: Mon, 24 Jul 2017 16:04:08 -0700

rcutorture: Print SRCU lock/unlock totals

This commit adds printing of SRCU lock/unlock totals, which are just
the sums of the per-CPU counts.  Saves a bit of mental arithmetic.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---
 kernel/rcu/srcutree.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 8f6fd11..b4f491b 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -1221,6 +1221,7 @@ void srcu_torture_stats_print(struct srcu_struct *sp, char *tt, char *tf)
 {
 	int cpu;
 	int idx;
+	unsigned long s0 = 0, s1 = 0;
 
 	idx = sp->srcu_idx & 0x1;
 	pr_alert("%s%s Tree SRCU per-CPU(idx=%d):", tt, tf, idx);
@@ -1246,8 +1247,10 @@ void srcu_torture_stats_print(struct srcu_struct *sp, char *tt, char *tf)
 		c0 = l0 - u0;
 		c1 = l1 - u1;
 		pr_cont(" %d(%ld,%ld)", cpu, c0, c1);
+		s0 += c0;
+		s1 += c1;
 	}
-	pr_cont("\n");
+	pr_cont(" T(%ld,%ld)\n", s0, s1);
 }
 EXPORT_SYMBOL_GPL(srcu_torture_stats_print);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux