MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / configure_performance_counters

Function configure_performance_counters

src/process/prctl.rs:514–522  ·  view source on GitHub ↗
(enable: bool)

Source from the content-addressed store, hash-verified

512#[doc(alias = "PR_TASK_PERF_EVENTS_ENABLE")]
513#[doc(alias = "PR_TASK_PERF_EVENTS_DISABLE")]
514pub fn configure_performance_counters(enable: bool) -> io::Result<()> {
515 let option = if enable {
516 PR_TASK_PERF_EVENTS_ENABLE
517 } else {
518 PR_TASK_PERF_EVENTS_DISABLE
519 };
520
521 unsafe { prctl_1arg(option) }.map(|_r| ())
522}
523
524//
525// PR_MCE_KILL_GET/PR_MCE_KILL

Callers

nothing calls this directly

Calls 1

prctl_1argFunction · 0.85

Tested by

no test coverage detected