parse_hwmon_filename(9)
π parse_hwmon_filename(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this is the page for parse_hwmon_filename, and it's literally the tiny little decoder ring for hwmon filenames. no cap, it's giving "small function, big responsibility" π
πΈ NAME πΈ
parse_hwmon_filename β Parse filename into constituent parts. π§©
β¨ SYNOPSIS β¨
bool parse_hwmon_filename (const char *filename , enum hwmon_type *type
, int *number , enum hwmon_item *item , bool *alarm );
π¦ ARGUMENTS π¦
okay so here's everyone in the cast, and yes each one gets their moment π
filenameβ the thing getting parsed, and it's gotta be shaped like<type><number>_<item>. that's the vibe check it has to pass β¨typeβ this gets filled in with the type that was figured out from the parsed file name πnumberβ the number belonging to that type. think of it like: there could be more than 1 fan, so we gotta know which one, iykyk πitemβ because a single hwmon<type><number>can have multiple items attached to it, and this is where that item lands πalarmβ is this filename for an alarm value? that's the whole question, and this bool says yes or no π
π DESCRIPTION π
so picture a hwmon filename like "temp1_input" β iconic, honestly. let's break it down fr fr π
the type is temp, for a temperature value. the number is 1. and the item inside the file is an input value, aka the temperature itself π‘οΈ. and this particular file does not contain an alarm value. π
lowkey important note: this is Exposed for testing. π§ͺ
π SEE ALSO π
go check these out too bestie, they're all in the same friend group π«Ά
- Kernel file
./tools/perf/util/hwmon_pmu.h enum hwmon_type(9)enum hwmon_item(9)union hwmon_pmu_event_key(9)hwmon_pmu__new(9)
and that's the whole page! β¨ sign-off time: this one lives under ./tools/perf/util π, dated October 2026 ποΈ β mwah, slay, go parse some filenames π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms