setup_metric_events(9)
β¨ setup_metric_events(9) β¨
okay bestie, this page comes from the Kernel API Manual and it's about one function with serious βmatchmaker for metric eventsβ energy. No cap, it finds a group of events in metric_evlist that correspond to the IDs from a parsed metric expression. π
π NAME π
setup_metric_events β finds a group of events in metric_evlist that correspond to the IDs from a parsed metric expression. That's the whole vibe. π―
π οΈ SYNOPSIS π οΈ
int setup_metric_events (const char *pmu , struct hashmap *ids , struct
evlist *metric_evlist , struct evsel ***out_metric_events );
π ARGUMENTS π
pmuβ the PMU for the IDs. That's it, that's the assignment. β¨idsβ the metric IDs to match. These are the ones we're looking for, bestie. πmetric_evlistβ the list of perf events. This is the pile we're checking through. πout_metric_eventsβ holds the created metric events array. It's the output spot, so the new array has somewhere cute to live. π«Ά
π SEE ALSO π
Kernel file ./tools/perf/util/metricgroup.c and its little friend group:
resolve_metric(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, bestie π it comes from the source/version path ./tools/perf/util, dated October 2026, and the function at the center of it all is setup_metric_events(9) π«Άβ¨
π¦ 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