diff options
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r-- | kernel/rcutree_trace.c | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index 4b1875ba9404..fe1dcdbf1ca3 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -213,7 +213,63 @@ static struct file_operations rcugp_fops = { | |||
213 | .release = single_release, | 213 | .release = single_release, |
214 | }; | 214 | }; |
215 | 215 | ||
216 | static struct dentry *rcudir, *datadir, *datadir_csv, *hierdir, *gpdir; | 216 | static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) |
217 | { | ||
218 | seq_printf(m, "%3d%cnp=%ld " | ||
219 | "qsp=%ld cbr=%ld cng=%ld gpc=%ld gps=%ld nf=%ld nn=%ld\n", | ||
220 | rdp->cpu, | ||
221 | cpu_is_offline(rdp->cpu) ? '!' : ' ', | ||
222 | rdp->n_rcu_pending, | ||
223 | rdp->n_rp_qs_pending, | ||
224 | rdp->n_rp_cb_ready, | ||
225 | rdp->n_rp_cpu_needs_gp, | ||
226 | rdp->n_rp_gp_completed, | ||
227 | rdp->n_rp_gp_started, | ||
228 | rdp->n_rp_need_fqs, | ||
229 | rdp->n_rp_need_nothing); | ||
230 | } | ||
231 | |||
232 | static void print_rcu_pendings(struct seq_file *m, struct rcu_state *rsp) | ||
233 | { | ||
234 | int cpu; | ||
235 | struct rcu_data *rdp; | ||
236 | |||
237 | for_each_possible_cpu(cpu) { | ||
238 | rdp = rsp->rda[cpu]; | ||
239 | if (rdp->beenonline) | ||
240 | print_one_rcu_pending(m, rdp); | ||
241 | } | ||
242 | } | ||
243 | |||
244 | static int show_rcu_pending(struct seq_file *m, void *unused) | ||
245 | { | ||
246 | seq_puts(m, "rcu:\n"); | ||
247 | print_rcu_pendings(m, &rcu_state); | ||
248 | seq_puts(m, "rcu_bh:\n"); | ||
249 | print_rcu_pendings(m, &rcu_bh_state); | ||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | static int rcu_pending_open(struct inode *inode, struct file *file) | ||
254 | { | ||
255 | return single_open(file, show_rcu_pending, NULL); | ||
256 | } | ||
257 | |||
258 | static struct file_operations rcu_pending_fops = { | ||
259 | .owner = THIS_MODULE, | ||
260 | .open = rcu_pending_open, | ||
261 | .read = seq_read, | ||
262 | .llseek = seq_lseek, | ||
263 | .release = single_release, | ||
264 | }; | ||
265 | |||
266 | static struct dentry *rcudir; | ||
267 | static struct dentry *datadir; | ||
268 | static struct dentry *datadir_csv; | ||
269 | static struct dentry *gpdir; | ||
270 | static struct dentry *hierdir; | ||
271 | static struct dentry *rcu_pendingdir; | ||
272 | |||
217 | static int __init rcuclassic_trace_init(void) | 273 | static int __init rcuclassic_trace_init(void) |
218 | { | 274 | { |
219 | rcudir = debugfs_create_dir("rcu", NULL); | 275 | rcudir = debugfs_create_dir("rcu", NULL); |
@@ -238,6 +294,11 @@ static int __init rcuclassic_trace_init(void) | |||
238 | NULL, &rcuhier_fops); | 294 | NULL, &rcuhier_fops); |
239 | if (!hierdir) | 295 | if (!hierdir) |
240 | goto free_out; | 296 | goto free_out; |
297 | |||
298 | rcu_pendingdir = debugfs_create_file("rcu_pending", 0444, rcudir, | ||
299 | NULL, &rcu_pending_fops); | ||
300 | if (!rcu_pendingdir) | ||
301 | goto free_out; | ||
241 | return 0; | 302 | return 0; |
242 | free_out: | 303 | free_out: |
243 | if (datadir) | 304 | if (datadir) |
@@ -257,6 +318,7 @@ static void __exit rcuclassic_trace_cleanup(void) | |||
257 | debugfs_remove(datadir_csv); | 318 | debugfs_remove(datadir_csv); |
258 | debugfs_remove(gpdir); | 319 | debugfs_remove(gpdir); |
259 | debugfs_remove(hierdir); | 320 | debugfs_remove(hierdir); |
321 | debugfs_remove(rcu_pendingdir); | ||
260 | debugfs_remove(rcudir); | 322 | debugfs_remove(rcudir); |
261 | } | 323 | } |
262 | 324 | ||