LIBPFM(3)
π LIBPFM(3) β the Linux Programmer's Manual, but make it make sense π
okay bestie, so this is a page from the Linux Programmer's Manual, and it's about one lil function that literally just tells you what went wrong. no cap.
β¨ NAME β¨
pfm_strerror β returns a constant string describing an error code π«Ά
πΈ SYNOPSIS πΈ
#include <perfmon/pfmlib.h>
const char *pfm_strerror(int code);
π¦ DESCRIPTION π¦
so like. this function hands you back a string that describes the libpfm error value sitting in code. that's it, that's the whole job. the string it returns is read-only β do NOT go editing it, it's not yours, leave it alone π
β οΈ and here's the tea: you can only use this function with libpfm calls that are documented to return specific error codes. that's the vibe check.
the value -1 is not considered a specific error code. and no, you can't use strings or pfm_pmu_t return values with this function either, sorry bestie. typically NULL gets returned when there's an error for string values, and PFM_PMU_NONE gets returned for pfm_pmu_t values. that's just how it is.
also β and this is important β this function is not designed to handle OS system call errors, aka errno values. so don't come at it with those, it will not know what to do with them π
β RETURN β
it returns a pointer to the constant string that describes the error code π the string is in English, bestie. and if code is invalid? it just gives you a default error message. iconic behaviour honestly.
π ERRORS π
if the error code is invalid, the function returns a pointer to a string that literally says "unknown error code". she said "idk her" π
π AUTHOR π
Stephane Eranian <eranian@gmail.com> β thank you for your service π«‘
aaaand that's the whole page fr fr β¨ this was LIBPFM(3) from the Linux Programmer's Manual, dated September, 2009. mwah, take care of her π π
π¦ where this page comes from
- arch rolling: libpfm 4.14.1-1 Β· MIT
- centos-stream 10: libpfm-devel 4.14.1-1.el10 Β· MIT
- centos-stream 9: libpfm-devel 4.14.1-1.el9 Β· MIT
- centos-stream 9: libpfm-devel 4.14.1-1.el9 Β· MIT
- debian bookworm: libpfm4-dev 4.13.0-1 Β· MIT
- debian trixie: libpfm4-dev 4.13.0+git99-gc5587f9-1 Β· MIT
- fedora 43: libpfm-devel 4.13.0-16.fc43 Β· MIT
- fedora 43: libpfm-devel 4.13.0-16.fc43 Β· MIT
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.13.0-20.fc43
- fedora 43: libpfm-devel 4.14.1-2.fc43 Β· MIT
- fedora 43: libpfm-devel 4.14.1-2.fc43 Β· MIT
- fedora 44: libpfm-devel 4.13.0-19.fc44 Β· MIT
- fedora 44: libpfm-devel 4.13.0-19.fc44 Β· MIT
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.13.0-20.fc44
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- fedora 44: libpfm-devel 4.14.1-2.fc44 Β· MIT
- nixos 26.05: libpfm 4.13.0
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: libpfm 4.14.1
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: libpfm-devel 4.13.0-160000.3.1 Β· MIT
- opensuse-leap 16.0: libpfm-devel 4.13.0-160000.3.1 Β· MIT
- opensuse-leap 16.0: libpfm-devel 4.13.0-160000.3.1 Β· MIT
- opensuse-leap 16.0: libpfm-devel 4.13.0-160000.3.1 Β· MIT
- ubuntu jammy: libpfm4-dev 4.11.1+git32-gd0b85fb-1 Β· BSD-like
- ubuntu jammy: libpfm4-dev 4.11.1+git32-gd0b85fb-1ubuntu0.1 Β· BSD-like
- ubuntu noble: libpfm4-dev 4.13.0+git32-g0d4ed0e-1 Β· MIT
- ubuntu noble: libpfm4-dev 4.13.0+git32-g0d4ed0e-1ubuntu0.1 Β· MIT
- ubuntu questing: libpfm4-dev 4.13.0+git99-gc5587f9-1
- ubuntu resolute: libpfm4-dev 4.13.0+git106-g3e4031b-1 Β· MIT
- ubuntu resolute: libpfm4-dev 4.13.0+git106-g3e4031b-1ubuntu0.1 Β· MIT
- ubuntu stonking: libpfm4-dev 4.13.0+git106-g3e4031b-1ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms