﻿# Explain profiler permission errors before running as root

Identify the exact perf event scope, effective permissions and resource error before widening collector privileges.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-linux-perf-paranoid/
Language: en

A host profiler fails before collecting a sample from tokenization work. The failure can concern Linux performance-monitoring permissions rather than the model, PMU hardware or GPU driver. Identify the requested event scope and exact error before running the entire application with broader privileges or changing a host-wide monitoring policy.

## Preserve the denied request

Record the profiler version, target identity, selected events and whether it requested per-thread, per-process, CPU-wide or kernel-inclusive observation. These scopes have different access consequences. A tool's broad default can exceed what the actual question needs. Preserve errno and diagnostic details instead of reducing every failure to a generic permission-denied label.

## Read the effective access policy

The kernel documents perf_event_paranoid as a control over unprivileged monitoring scope. Record the current value with the running kernel and relevant distribution behavior. Avoid treating a copied numeric setting as a universal description across releases. A process-scoped user-space count can have a different permitted path from system-wide sampling even when both use the same profiler executable.

## Distinguish capability scope

CAP_PERFMON provides a performance-observation permission boundary distinct from broad administrative capability. The actual effective capability sets and execution environment matter. A capability shown in a package document does not prove the launched collector has it. Containers can impose additional syscall or resource restrictions, so one permission adjustment does not establish that every collection prerequisite has been satisfied.

## Separate access from resource failure

Performance events consume file descriptors and sampling buffers. Unsupported events and exhausted collection resources can fail independently of authorization. Compare the exact API error and event configuration with the documented contract. Increasing privileges cannot create a missing PMU event or explain a request that exhausted its allowed descriptor or memory budget before collection began.

## Verify the smallest useful capture

In an isolated harmless workload, request the narrow observation needed for the analysis and confirm both access and a sensible result before adding more scope. Keep diagnostic data restricted to the intended experiment. Acceptance explains the collector boundary; it does not establish model performance, justify unrestricted host sampling or prove that a successful privileged run identifies the specific rule that blocked the original request.

## Primary references

[Linux Performance Monitoring Access Control](https://docs.kernel.org/admin-guide/perf-security.html).

[Linux perf_event_open](https://man7.org/linux/man-pages/man2/perf_event_open.2.html).

[Linux Process Capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html).

Related reading: [Idle GPU, throttled CPU: diagnosing container CPU quota](/journal/cgroup-cpu-throttling-gpu-feeder/); [Inference API telemetry without default prompt capture](/journal/provider-telemetry-content-redaction/).
