| 453 | } |
| 454 | |
| 455 | static int |
| 456 | dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) |
| 457 | { |
| 458 | struct sbuf *sb; |
| 459 | int error, cpu, t; |
| 460 | int enabled; |
| 461 | |
| 462 | error = sysctl_wire_old_buffer(req, 0); |
| 463 | if (error != 0) |
| 464 | return (error); |
| 465 | sb = sbuf_new_for_sysctl(NULL, NULL, LPROF_SBUF_SIZE, req); |
| 466 | sbuf_printf(sb, "\n%8s %9s %11s %11s %11s %6s %6s %2s %6s %s\n", |
| 467 | "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); |
| 468 | enabled = lock_prof_enable; |
| 469 | lock_prof_enable = 0; |
| 470 | /* |
| 471 | * See the comment in lock_prof_reset |
| 472 | */ |
| 473 | cpus_fence_seq_cst(); |
| 474 | quiesce_all_critical(); |
| 475 | t = ticks; |
| 476 | CPU_FOREACH(cpu) { |
| 477 | lock_prof_type_stats(&LP_CPU(cpu)->lpc_types[0], sb, 0, t); |
| 478 | lock_prof_type_stats(&LP_CPU(cpu)->lpc_types[1], sb, 1, t); |
| 479 | } |
| 480 | atomic_thread_fence_rel(); |
| 481 | lock_prof_enable = enabled; |
| 482 | |
| 483 | error = sbuf_finish(sb); |
| 484 | /* Output a trailing NUL. */ |
| 485 | if (error == 0) |
| 486 | error = SYSCTL_OUT(req, "", 1); |
| 487 | sbuf_delete(sb); |
| 488 | return (error); |
| 489 | } |
| 490 | |
| 491 | static int |
| 492 | enable_lock_prof(SYSCTL_HANDLER_ARGS) |
nothing calls this directly
no test coverage detected