parse_hwmon_filename(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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