resolve_metric(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… resolve_metric(9) πŸ’…

okay so bestie, welcome to the resolve_metric page β€” it's from the Kernel API Manual (section 9, kernel API gang πŸ‘‘) and honestly it's giving "find the metrics, then find the metrics inside those metrics" energy. recursive slay. πŸ¦‹

✨ NAME ✨

resolve_metric β€” locate metrics within the root metric and recursively add references to them. recursion?? in MY kernel tree?? it's more likely than you think πŸ’€

✨ SYNOPSIS ✨

int resolve_metric (struct list_head *metric_list , struct perf_pmu *pmu
, const char *modifier , bool metric_no_group , bool metric_no_threshold
, const char *user_requested_cpu_list , bool system_wide , struct metric
*root_metric , const struct visited_metric *visited , const struct
pmu_metrics_table *table );

yeah she's got a LOT of arguments, but like… main character function, you know? 🌸

✨ ARGUMENTS ✨

here's the whole cast, no skips, we respect every single param 🫢

  • metric_list β€” the list the metric gets added to. that's it, that's the vibe. it's the destination πŸ’–
  • pmu β€” the PMU name to resolve metrics on, or literally the string "all" if you want every PMU in the building. ✨
  • modifier β€” if non-null, event modifiers like "u". classic. πŸŽ€
  • metric_no_group β€” should the events written to events be grouped "{}" or global? grouping is the default, BUT because of multiplexing the user may override it. so yeah, you CAN break the group, just know why you're doing it πŸ™ˆ
  • metric_no_threshold β€” -- undescribed -- 😭 bestie the docs literally said "no thoughts head empty" on this one. it's undescribed in the source, and we're not gonna make something up. periodt. πŸ’€
  • user_requested_cpu_list β€” command line specified CPUs to record on. the "I only care about THESE cores" list 🧚
  • system_wide β€” are events for all processes being recorded? yes/no, iconic boolean moment πŸ¦‹
  • root_metric β€” metrics may reference other metrics to form a tree (a tree!! 🌈). in that case the root_metric holds all the IDs and a list of referenced metrics. and when you're adding a root, this argument is NULL. important detail, don't forget it πŸ’œ
  • visited β€” a singly linked list of metric names being added, used to detect recursion. lowkey the bouncer at the club checking if you've already been let in πŸ‘‘ (recursion detection is SO real)
  • table β€” the table that's searched for metrics β€” most commonly the table for the architecture perf is running upon. iykyk πŸ’…

ngl bestie, this one's a helper deep in perf's metric machinery. every detail above is straight from the source β€” don't @ me if you skip one. πŸ’–

✨ SEE ALSO ✨

go read these next, they're literally the rest of the friend group 🫢

Kernel file ./tools/perf/util/metricgroup.c β€” plus setup_metric_events(9), __add_metric(9), metric_list_cmp(9), default_metricgroup_cmp(9), metricgroup__add_metric(9), metricgroup__add_metric_list(9), find_tool_events(9), build_combined_expr_ctx(9), parse_ids(9). πŸ“


okay that's the page!! mwah πŸ’‹ this one lives over in ./tools/perf/util, dated October 2026, and it's page resolve_metric(9) β€” go forth and resolve your metrics, you absolute icon β­πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from