evlist__for_each_cpu(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

okay so bestie, this page is evlist__for_each_cpu(9) from the Kernel API Manual, and itโ€™s giving iterator realness for evlists. Without affinity, it iterates over the evlist. With affinity, it iterates over all CPUs and then the evlist for each evsel on that CPU. When switching between CPUs, the affinity is set to the CPU to avoid IPIs during syscalls. The affinity is set up and removed automatically, but if the loop is broken, a call to evlist_cpu_iterator__exit is necessary โ€” thatโ€™s the rule, no cap. ๐Ÿ’…

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

evlist__for_each_cpu (evlist_cpu_itr , evlist );

๐Ÿ’… ARGUMENTS ๐Ÿ’…

  • evlist_cpu_itr โ€” the iterator instance. the little iterator main character.
  • evlist โ€” evlist instance to iterate. the collection youโ€™re looping over, bestie.
โš ๏ธ breaking out of the loop? you must call evlist_cpu_iterator__exit. not optional. periodt. ๐Ÿ’€

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

Kernel file: ./tools/perf/util/evlist.h


mwah ๐Ÿ’‹ this pageโ€™s source/version is ./tools/perf/util, dated October 2026, and itโ€™s for evlist__for_each_cpu(9).

๐Ÿ“ฆ where this page comes from