aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_trace.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-09-28 13:49:58 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-11-08 14:55:30 -0500
commit42c3533eee88e012e1aa3c4d6d2cc53354130e24 (patch)
tree5ba55eedbda8d257812ee3b2c8778e4c0b3a2e94 /kernel/rcutree_trace.c
parent5f4ee1fa16fa1bee673b75722ca43350a74fba36 (diff)
rcu: Fix tracing formatting
The rcu_state structure's ->completed field is unsigned long, so this commit adjusts show_one_rcugp()'s printf() format to suit. Also add the required ACCESS_ONCE() directives while we are in this function. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r--kernel/rcutree_trace.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index bcc4865fea8b..3312ed7e411e 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -46,6 +46,8 @@
46#define RCU_TREE_NONCORE 46#define RCU_TREE_NONCORE
47#include "rcutree.h" 47#include "rcutree.h"
48 48
49#define ulong2long(a) (*(long *)(&(a)))
50
49static int r_open(struct inode *inode, struct file *file, 51static int r_open(struct inode *inode, struct file *file,
50 const struct seq_operations *op) 52 const struct seq_operations *op)
51{ 53{
@@ -116,10 +118,10 @@ static void print_one_rcu_data(struct seq_file *m, struct rcu_data *rdp)
116{ 118{
117 if (!rdp->beenonline) 119 if (!rdp->beenonline)
118 return; 120 return;
119 seq_printf(m, "%3d%cc=%lu g=%lu pq=%d qp=%d", 121 seq_printf(m, "%3d%cc=%ld g=%ld pq=%d qp=%d",
120 rdp->cpu, 122 rdp->cpu,
121 cpu_is_offline(rdp->cpu) ? '!' : ' ', 123 cpu_is_offline(rdp->cpu) ? '!' : ' ',
122 rdp->completed, rdp->gpnum, 124 ulong2long(rdp->completed), ulong2long(rdp->gpnum),
123 rdp->passed_quiesce, rdp->qs_pending); 125 rdp->passed_quiesce, rdp->qs_pending);
124 seq_printf(m, " dt=%d/%llx/%d df=%lu", 126 seq_printf(m, " dt=%d/%llx/%d df=%lu",
125 atomic_read(&rdp->dynticks->dynticks), 127 atomic_read(&rdp->dynticks->dynticks),
@@ -246,8 +248,9 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
246 struct rcu_node *rnp; 248 struct rcu_node *rnp;
247 249
248 gpnum = rsp->gpnum; 250 gpnum = rsp->gpnum;
249 seq_printf(m, "%s: c=%lu g=%lu s=%d jfq=%ld j=%x ", 251 seq_printf(m, "%s: c=%ld g=%ld s=%d jfq=%ld j=%x ",
250 rsp->name, rsp->completed, gpnum, rsp->fqs_state, 252 rsp->name, ulong2long(rsp->completed), ulong2long(gpnum),
253 rsp->fqs_state,
251 (long)(rsp->jiffies_force_qs - jiffies), 254 (long)(rsp->jiffies_force_qs - jiffies),
252 (int)(jiffies & 0xffff)); 255 (int)(jiffies & 0xffff));
253 seq_printf(m, "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld/%ld\n", 256 seq_printf(m, "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld/%ld\n",
@@ -301,16 +304,16 @@ static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp)
301 struct rcu_node *rnp = &rsp->node[0]; 304 struct rcu_node *rnp = &rsp->node[0];
302 305
303 raw_spin_lock_irqsave(&rnp->lock, flags); 306 raw_spin_lock_irqsave(&rnp->lock, flags);
304 completed = rsp->completed; 307 completed = ACCESS_ONCE(rsp->completed);
305 gpnum = rsp->gpnum; 308 gpnum = ACCESS_ONCE(rsp->gpnum);
306 if (rsp->completed == rsp->gpnum) 309 if (completed == gpnum)
307 gpage = 0; 310 gpage = 0;
308 else 311 else
309 gpage = jiffies - rsp->gp_start; 312 gpage = jiffies - rsp->gp_start;
310 gpmax = rsp->gp_max; 313 gpmax = rsp->gp_max;
311 raw_spin_unlock_irqrestore(&rnp->lock, flags); 314 raw_spin_unlock_irqrestore(&rnp->lock, flags);
312 seq_printf(m, "%s: completed=%ld gpnum=%lu age=%ld max=%ld\n", 315 seq_printf(m, "%s: completed=%ld gpnum=%ld age=%ld max=%ld\n",
313 rsp->name, completed, gpnum, gpage, gpmax); 316 rsp->name, ulong2long(completed), ulong2long(gpnum), gpage, gpmax);
314} 317}
315 318
316static int show_rcugp(struct seq_file *m, void *unused) 319static int show_rcugp(struct seq_file *m, void *unused)