PERFALLOC(1)

πŸ“¦
version 7.2.2 Β· 2 versions
, in arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– PERFALLOC β€” bestie edition πŸ’–

okay so quick vibe check: this is the manual page for perfalloc, from the Performance Co-Pilot family of tools. she's a little command with one job and she does it iconically. let's get into it πŸŽ€


✨ NAME ✨

perfalloc β€” notify pmdaperfevent(1) to disable hardware counter allocation. that's it. that's the whole personality. no cap πŸ’…


🌸 SYNOPSIS 🌸

$PCP_PMDAS_DIR/perfevent/perfalloc [-D] [-d] [-f lockfile] [-h] [-v]
[commandline]

yes she lives way down in $PCP_PMDAS_DIR/perfevent/, she's not out here in your $PATH like some people πŸ™ˆ


πŸ¦‹ DESCRIPTION πŸ¦‹

so perfalloc is a command that pings pmdaperfevent(1) and is like "hey bestie, turn OFF hardware counter event collection." and the whole point of that is this allows unprivileged processes to use the hardware counters. it's giving "sharing is caring" energy fr fr 🫢

here's the tea on how the lifecycle goes:

  • if the reservation request fails, perfalloc dips out immediately with exit code EXIT_FAILURE. no waiting around, no small talk.
  • if it succeeds, perfalloc just chills and runs until it receives a kill signal. and the reservation request persists the entire time perfalloc is running. so like, don't close the tab, babe πŸ’€
heads up: pmdaperfevent is affected by the value of the kernel.perf_event_paranoid setting, which you can adjust with sysctl(8). iykyk πŸ‘‘

and ooh, one more thing: if a commandline is given, it gets executed as a subprocess of the agent. and the way that this works is β€” when the command dies, so does the agent. they're ride or die. literally. πŸ’€πŸ’–

a brief description of the command line options follows (okay she said "brief" but we're gonna be thorough because you deserve the full picture, bestie):

  • -D β€” run in the foreground (this is the default, so it's basically the "i'm already doing this" flag πŸ’…)
  • -d β€” run in the background
  • -f FILE β€” use FILE as the lock file (the default is $PCP_PMDAS_DIR/perfevent/perflock)
  • -h β€” display a help message and exit (our fave, the little "help me help you" πŸ₯Ί)
  • -v β€” output version number and exit (she's telling you who she is ✨)

😭 BUGS 😭

okay so, not everything is perfect and we have to be honest about it:

  • there may be a delay of up to 100 milliseconds between perfalloc requesting the hardware counter disabling and the perfevent PMDA actually processing the request. so like... a tiny little lag. blink and you'll miss it, but it's real. ⏳
  • the perfalloc process does not check the status of the request and therefore is not able to provide a positive confirmation that the request succeeded and the hardware counters are actually disabled. so she asks, and then she just... trusts. bestie has faith in the universe πŸ™ˆ no receipt, no proof, just vibes. and honestly? that's a little scary but we move 🫢

πŸ‘‘ SEE ALSO πŸ‘‘

go read these, they're all part of the lore:


and that's the page, bestie!! πŸŽ€ this little manual is brought to you by Performance Co-Pilot, aka PCP, and it's the PERFALLOC(1) page β€” so now you know her, you love her, you understand her lock file defaults. go forth and allocate responsibly. mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from