MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dump_lock_prof_stats

Function dump_lock_prof_stats

freebsd/kern/subr_lock.c:455–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455static int
456dump_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
491static int
492enable_lock_prof(SYSCTL_HANDLER_ARGS)

Callers

nothing calls this directly

Calls 9

sysctl_wire_old_bufferFunction · 0.85
sbuf_new_for_sysctlFunction · 0.85
sbuf_printfFunction · 0.85
cpus_fence_seq_cstFunction · 0.85
quiesce_all_criticalFunction · 0.85
lock_prof_type_statsFunction · 0.85
sbuf_finishFunction · 0.85
sbuf_deleteFunction · 0.85
atomic_thread_fence_relFunction · 0.50

Tested by

no test coverage detected