diff options
| author | Michael Wang <wangyun@linux.vnet.ibm.com> | 2012-10-11 17:26:42 -0400 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-11-08 14:56:44 -0500 |
| commit | 6ee0886ff6c81526bf6ad8521d843b934aafa5aa (patch) | |
| tree | 2b0871206ca414eecdf1fe77c79b8435c9b46bd2 | |
| parent | a608d84bdb832a86ad3fdb0767df31fcda9fe280 (diff) | |
rcu: Remove old debugfs interfaces and also RCU flavor name
This commit removes the old debugfs interfaces, so that the new
directory-per-RCU-flavor versions remain. Because the RCU flavor is
given by the directory name, there is no need to print it out, so remove
the name from the printout.
Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
| -rw-r--r-- | kernel/rcutree_trace.c | 190 |
1 files changed, 44 insertions, 146 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index 107997ecdeeb..967115c508bc 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
| @@ -78,32 +78,7 @@ static void r_stop(struct seq_file *m, void *v) | |||
| 78 | { | 78 | { |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static int show_rcubarrier(struct seq_file *m, void *unused) | 81 | static int show_rcubarrier(struct seq_file *m, void *v) |
| 82 | { | ||
| 83 | struct rcu_state *rsp; | ||
| 84 | |||
| 85 | for_each_rcu_flavor(rsp) | ||
| 86 | seq_printf(m, "%s: bcc: %d nbd: %lu\n", | ||
| 87 | rsp->name, | ||
| 88 | atomic_read(&rsp->barrier_cpu_count), | ||
| 89 | rsp->n_barrier_done); | ||
| 90 | return 0; | ||
| 91 | } | ||
| 92 | |||
| 93 | static int rcubarrier_open(struct inode *inode, struct file *file) | ||
| 94 | { | ||
| 95 | return single_open(file, show_rcubarrier, NULL); | ||
| 96 | } | ||
| 97 | |||
| 98 | static const struct file_operations rcubarrier_fops = { | ||
| 99 | .owner = THIS_MODULE, | ||
| 100 | .open = rcubarrier_open, | ||
| 101 | .read = seq_read, | ||
| 102 | .llseek = seq_lseek, | ||
| 103 | .release = single_release, | ||
| 104 | }; | ||
| 105 | |||
| 106 | static int new_show_rcubarrier(struct seq_file *m, void *v) | ||
| 107 | { | 82 | { |
| 108 | struct rcu_state *rsp = (struct rcu_state *)m->private; | 83 | struct rcu_state *rsp = (struct rcu_state *)m->private; |
| 109 | seq_printf(m, "bcc: %d nbd: %lu\n", | 84 | seq_printf(m, "bcc: %d nbd: %lu\n", |
| @@ -112,14 +87,14 @@ static int new_show_rcubarrier(struct seq_file *m, void *v) | |||
| 112 | return 0; | 87 | return 0; |
| 113 | } | 88 | } |
| 114 | 89 | ||
| 115 | static int new_rcubarrier_open(struct inode *inode, struct file *file) | 90 | static int rcubarrier_open(struct inode *inode, struct file *file) |
| 116 | { | 91 | { |
| 117 | return single_open(file, new_show_rcubarrier, inode->i_private); | 92 | return single_open(file, show_rcubarrier, inode->i_private); |
| 118 | } | 93 | } |
| 119 | 94 | ||
| 120 | static const struct file_operations new_rcubarrier_fops = { | 95 | static const struct file_operations rcubarrier_fops = { |
| 121 | .owner = THIS_MODULE, | 96 | .owner = THIS_MODULE, |
| 122 | .open = new_rcubarrier_open, | 97 | .open = rcubarrier_open, |
| 123 | .read = seq_read, | 98 | .read = seq_read, |
| 124 | .llseek = no_llseek, | 99 | .llseek = no_llseek, |
| 125 | .release = seq_release, | 100 | .release = seq_release, |
| @@ -245,23 +220,7 @@ static const struct file_operations rcu_node_boost_fops = { | |||
| 245 | .release = single_release, | 220 | .release = single_release, |
| 246 | }; | 221 | }; |
| 247 | 222 | ||
| 248 | /* | 223 | #endif /* #ifdef CONFIG_RCU_BOOST */ |
| 249 | * Create the rcuboost debugfs entry. Standard error return. | ||
| 250 | */ | ||
| 251 | static int rcu_boost_trace_create_file(struct dentry *rcudir) | ||
| 252 | { | ||
| 253 | return !debugfs_create_file("rcuboost", 0444, rcudir, NULL, | ||
| 254 | &rcu_node_boost_fops); | ||
| 255 | } | ||
| 256 | |||
| 257 | #else /* #ifdef CONFIG_RCU_BOOST */ | ||
| 258 | |||
| 259 | static int rcu_boost_trace_create_file(struct dentry *rcudir) | ||
| 260 | { | ||
| 261 | return 0; /* There cannot be an error if we didn't create it! */ | ||
| 262 | } | ||
| 263 | |||
| 264 | #endif /* #else #ifdef CONFIG_RCU_BOOST */ | ||
| 265 | 224 | ||
| 266 | static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) | 225 | static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) |
| 267 | { | 226 | { |
| @@ -270,8 +229,8 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) | |||
| 270 | struct rcu_node *rnp; | 229 | struct rcu_node *rnp; |
| 271 | 230 | ||
| 272 | gpnum = rsp->gpnum; | 231 | gpnum = rsp->gpnum; |
| 273 | seq_printf(m, "%s: c=%ld g=%ld s=%d jfq=%ld j=%x ", | 232 | seq_printf(m, "c=%ld g=%ld s=%d jfq=%ld j=%x ", |
| 274 | rsp->name, ulong2long(rsp->completed), ulong2long(gpnum), | 233 | ulong2long(rsp->completed), ulong2long(gpnum), |
| 275 | rsp->fqs_state, | 234 | rsp->fqs_state, |
| 276 | (long)(rsp->jiffies_force_qs - jiffies), | 235 | (long)(rsp->jiffies_force_qs - jiffies), |
| 277 | (int)(jiffies & 0xffff)); | 236 | (int)(jiffies & 0xffff)); |
| @@ -294,44 +253,22 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) | |||
| 294 | seq_puts(m, "\n"); | 253 | seq_puts(m, "\n"); |
| 295 | } | 254 | } |
| 296 | 255 | ||
| 297 | static int show_rcuhier(struct seq_file *m, void *unused) | 256 | static int show_rcuhier(struct seq_file *m, void *v) |
| 298 | { | 257 | { |
| 299 | struct rcu_state *rsp; | 258 | struct rcu_state *rsp = (struct rcu_state *)m->private; |
| 300 | 259 | print_one_rcu_state(m, rsp); | |
| 301 | for_each_rcu_flavor(rsp) | ||
| 302 | print_one_rcu_state(m, rsp); | ||
| 303 | return 0; | 260 | return 0; |
| 304 | } | 261 | } |
| 305 | 262 | ||
| 306 | static int rcuhier_open(struct inode *inode, struct file *file) | 263 | static int rcuhier_open(struct inode *inode, struct file *file) |
| 307 | { | 264 | { |
| 308 | return single_open(file, show_rcuhier, NULL); | 265 | return single_open(file, show_rcuhier, inode->i_private); |
| 309 | } | 266 | } |
| 310 | 267 | ||
| 311 | static const struct file_operations rcuhier_fops = { | 268 | static const struct file_operations rcuhier_fops = { |
| 312 | .owner = THIS_MODULE, | 269 | .owner = THIS_MODULE, |
| 313 | .open = rcuhier_open, | 270 | .open = rcuhier_open, |
| 314 | .read = seq_read, | 271 | .read = seq_read, |
| 315 | .llseek = seq_lseek, | ||
| 316 | .release = single_release, | ||
| 317 | }; | ||
| 318 | |||
| 319 | static int new_show_rcuhier(struct seq_file *m, void *v) | ||
| 320 | { | ||
| 321 | struct rcu_state *rsp = (struct rcu_state *)m->private; | ||
| 322 | print_one_rcu_state(m, rsp); | ||
| 323 | return 0; | ||
| 324 | } | ||
| 325 | |||
| 326 | static int new_rcuhier_open(struct inode *inode, struct file *file) | ||
| 327 | { | ||
| 328 | return single_open(file, new_show_rcuhier, inode->i_private); | ||
| 329 | } | ||
| 330 | |||
| 331 | static const struct file_operations new_rcuhier_fops = { | ||
| 332 | .owner = THIS_MODULE, | ||
| 333 | .open = new_rcuhier_open, | ||
| 334 | .read = seq_read, | ||
| 335 | .llseek = no_llseek, | 272 | .llseek = no_llseek, |
| 336 | .release = seq_release, | 273 | .release = seq_release, |
| 337 | }; | 274 | }; |
| @@ -354,48 +291,26 @@ static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp) | |||
| 354 | gpage = jiffies - rsp->gp_start; | 291 | gpage = jiffies - rsp->gp_start; |
| 355 | gpmax = rsp->gp_max; | 292 | gpmax = rsp->gp_max; |
| 356 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | 293 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
| 357 | seq_printf(m, "%s: completed=%ld gpnum=%ld age=%ld max=%ld\n", | 294 | seq_printf(m, "completed=%ld gpnum=%ld age=%ld max=%ld\n", |
| 358 | rsp->name, ulong2long(completed), ulong2long(gpnum), gpage, gpmax); | 295 | ulong2long(completed), ulong2long(gpnum), gpage, gpmax); |
| 359 | } | 296 | } |
| 360 | 297 | ||
| 361 | static int show_rcugp(struct seq_file *m, void *unused) | 298 | static int show_rcugp(struct seq_file *m, void *v) |
| 362 | { | 299 | { |
| 363 | struct rcu_state *rsp; | 300 | struct rcu_state *rsp = (struct rcu_state *)m->private; |
| 364 | 301 | show_one_rcugp(m, rsp); | |
| 365 | for_each_rcu_flavor(rsp) | ||
| 366 | show_one_rcugp(m, rsp); | ||
| 367 | return 0; | 302 | return 0; |
| 368 | } | 303 | } |
| 369 | 304 | ||
| 370 | static int rcugp_open(struct inode *inode, struct file *file) | 305 | static int rcugp_open(struct inode *inode, struct file *file) |
| 371 | { | 306 | { |
| 372 | return single_open(file, show_rcugp, NULL); | 307 | return single_open(file, show_rcugp, inode->i_private); |
| 373 | } | 308 | } |
| 374 | 309 | ||
| 375 | static const struct file_operations rcugp_fops = { | 310 | static const struct file_operations rcugp_fops = { |
| 376 | .owner = THIS_MODULE, | 311 | .owner = THIS_MODULE, |
| 377 | .open = rcugp_open, | 312 | .open = rcugp_open, |
| 378 | .read = seq_read, | 313 | .read = seq_read, |
| 379 | .llseek = seq_lseek, | ||
| 380 | .release = single_release, | ||
| 381 | }; | ||
| 382 | |||
| 383 | static int new_show_rcugp(struct seq_file *m, void *v) | ||
| 384 | { | ||
| 385 | struct rcu_state *rsp = (struct rcu_state *)m->private; | ||
| 386 | show_one_rcugp(m, rsp); | ||
| 387 | return 0; | ||
| 388 | } | ||
| 389 | |||
| 390 | static int new_rcugp_open(struct inode *inode, struct file *file) | ||
| 391 | { | ||
| 392 | return single_open(file, new_show_rcugp, inode->i_private); | ||
| 393 | } | ||
| 394 | |||
| 395 | static const struct file_operations new_rcugp_fops = { | ||
| 396 | .owner = THIS_MODULE, | ||
| 397 | .open = new_rcugp_open, | ||
| 398 | .read = seq_read, | ||
| 399 | .llseek = no_llseek, | 314 | .llseek = no_llseek, |
| 400 | .release = seq_release, | 315 | .release = seq_release, |
| 401 | }; | 316 | }; |
| @@ -485,57 +400,40 @@ static int __init rcutree_trace_init(void) | |||
| 485 | if (!rspdir) | 400 | if (!rspdir) |
| 486 | goto free_out; | 401 | goto free_out; |
| 487 | 402 | ||
| 488 | retval = debugfs_create_file("rcudata", 0444, | 403 | retval = debugfs_create_file("rcudata", 0444, |
| 489 | rspdir, rsp, &rcudata_fops); | 404 | rspdir, rsp, &rcudata_fops); |
| 490 | if (!retval) | 405 | if (!retval) |
| 491 | goto free_out; | 406 | goto free_out; |
| 492 | 407 | ||
| 493 | retval = debugfs_create_file("rcu_pending", 0444, | 408 | retval = debugfs_create_file("rcu_pending", 0444, |
| 494 | rspdir, rsp, &rcu_pending_fops); | 409 | rspdir, rsp, &rcu_pending_fops); |
| 495 | if (!retval) | 410 | if (!retval) |
| 496 | goto free_out; | 411 | goto free_out; |
| 497 | 412 | ||
| 498 | retval = debugfs_create_file("rcubarrier", 0444, | 413 | retval = debugfs_create_file("rcubarrier", 0444, |
| 499 | rspdir, rsp, &new_rcubarrier_fops); | 414 | rspdir, rsp, &rcubarrier_fops); |
| 500 | if (!retval) | 415 | if (!retval) |
| 501 | goto free_out; | 416 | goto free_out; |
| 502 | 417 | ||
| 503 | #ifdef CONFIG_RCU_BOOST | 418 | #ifdef CONFIG_RCU_BOOST |
| 504 | if (rsp == &rcu_preempt_state) { | 419 | if (rsp == &rcu_preempt_state) { |
| 505 | retval = debugfs_create_file("rcuboost", 0444, | 420 | retval = debugfs_create_file("rcuboost", 0444, |
| 506 | rspdir, NULL, &rcu_node_boost_fops); | 421 | rspdir, NULL, &rcu_node_boost_fops); |
| 507 | if (!retval) | ||
| 508 | goto free_out; | ||
| 509 | } | ||
| 510 | #endif | ||
| 511 | |||
| 512 | retval = debugfs_create_file("rcugp", 0444, | ||
| 513 | rspdir, rsp, &new_rcugp_fops); | ||
| 514 | if (!retval) | 422 | if (!retval) |
| 515 | goto free_out; | 423 | goto free_out; |
| 424 | } | ||
| 425 | #endif | ||
| 516 | 426 | ||
| 517 | retval = debugfs_create_file("rcuhier", 0444, | 427 | retval = debugfs_create_file("rcugp", 0444, |
| 518 | rspdir, rsp, &new_rcuhier_fops); | 428 | rspdir, rsp, &rcugp_fops); |
| 519 | if (!retval) | 429 | if (!retval) |
| 520 | goto free_out; | 430 | goto free_out; |
| 521 | } | ||
| 522 | |||
| 523 | retval = debugfs_create_file("rcubarrier", 0444, rcudir, | ||
| 524 | NULL, &rcubarrier_fops); | ||
| 525 | if (!retval) | ||
| 526 | goto free_out; | ||
| 527 | |||
| 528 | if (rcu_boost_trace_create_file(rcudir)) | ||
| 529 | goto free_out; | ||
| 530 | |||
| 531 | retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops); | ||
| 532 | if (!retval) | ||
| 533 | goto free_out; | ||
| 534 | 431 | ||
| 535 | retval = debugfs_create_file("rcuhier", 0444, rcudir, | 432 | retval = debugfs_create_file("rcuhier", 0444, |
| 536 | NULL, &rcuhier_fops); | 433 | rspdir, rsp, &rcuhier_fops); |
| 537 | if (!retval) | 434 | if (!retval) |
| 538 | goto free_out; | 435 | goto free_out; |
| 436 | } | ||
| 539 | 437 | ||
| 540 | retval = debugfs_create_file("rcutorture", 0444, rcudir, | 438 | retval = debugfs_create_file("rcutorture", 0444, rcudir, |
| 541 | NULL, &rcutorture_fops); | 439 | NULL, &rcutorture_fops); |
