evlist__for_each_cpu(9)
๐ 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
__evlist__for_each_entry(9)evlist__for_each_entry(9)__evlist__for_each_entry_continue(9)evlist__for_each_entry_continue(9)__evlist__for_each_entry_from(9)evlist__for_each_entry_from(9)__evlist__for_each_entry_reverse(9)evlist__for_each_entry_reverse(9)__evlist__for_each_entry_safe(9)evlist__for_each_entry_safe(9)
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
- 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