metricgroup__add_metric(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… metricgroup__add_metric(9) β€” like, the Kernel API Manual one, bestie

okay so picture this: you're deep in perf land, you've got a PMU, you've got a metric name, and you need somebody to find that metric (or a whole metric group, no big deal) and add it. That somebody is metricgroup__add_metric. It's giving main character energy in the metrics department, fr fr. ✨


πŸŽ€ NAME πŸŽ€

metricgroup__add_metric β€” finds and adds a metric, or a metric group. That's it, that's the whole vibe. 🫢


🌸 SYNOPSIS 🌸

int metricgroup__add_metric (const char *pmu , const char *metric_name ,
const char *modifier , bool metric_no_group , bool metric_no_threshold ,
const char *user_requested_cpu_list , bool system_wide , struct
list_head *metric_list , const struct pmu_metrics_table *table );

like, yes, that's a lot of parameters. She's thorough. We respect it. πŸ‘‘


✨ ARGUMENTS ✨ (the whole cast, icon by icon)

  • pmu β€” the PMU name you're searching for metrics on. Or literally just pass "all" and she'll go look at every PMU for you. queen behaviour. 🌈
  • metric_name β€” the name of the metric or the metric group, your pick. For example, "IPC" could be the name of a single metric, and "TopDownL1" could be the name of a metric group. iykyk. πŸ’œ
  • modifier β€” if non-null event modifiers like "u". that's the whole description bestie, she's a simple girl. πŸ’…
  • metric_no_group β€” should the events written to events be grouped "{}" or global? Grouping is the default ✨ but because of multiplexing the user is allowed to override it. so like, it's a default, not a cage. πŸ¦‹
  • metric_no_threshold β€” -- undescribed -- 😭 the original manpage literally has nothing here. not me leaving it exactly as I found it. no cap, there is no description. πŸ’€
  • user_requested_cpu_list β€” the CPUs that were specified on the command line to record on. 🎯
  • system_wide β€” are the events being recorded for all processes? that's the question this one's asking. 🌟
  • metric_list β€” the list that the metric (or metric group) actually gets added to. the destination, the final form, the moment of arrival. πŸ“₯
  • table β€” the table that gets searched for metrics. most commonly it's the table for the architecture perf is running upon. πŸ–₯️✨
lowkey reminder: every single one of those has to be passed exactly as written, don't go getting creative with the names. that's not the vibe check we're doing today. πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

honestly go read these next, they're all part of the same little friend group:


that's the whole page bestie, you ate it up πŸ’…βœ¨

source location: ./tools/perf/util 🌸 date: October 2026 πŸŽ€ β€” mwah, go forth and add those metrics πŸ’–πŸ¦‹β­

πŸ“¦ where this page comes from