resolve_metric(9)
π 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 toeventsbe 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 theroot_metricholds all the IDs and a list of referenced metrics. and when you're adding a root, this argument isNULL. 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
- 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