perf_evlist_...h_entry_safe(9)
π perf_evlist__for_each_entry_safe β NAME β¨
okay so bestie, welcome to the Kernel API Manual π β this one's a macro called perf_evlist__for_each_entry_safe, and it's literally here to safely iterate thru all the evsels π no cap, that's the whole vibe: safe iteration, all the evsels, one macro.
πΈ SYNOPSIS πΈ
perf_evlist__for_each_entry_safe (evlist , tmp , evsel );
that's it. three things in, the whole list comes out the other side π¦ (and yes, the spaces before those commas are exactly how the manpage wrote it β copy it verbatim, iykyk π )
π«Ά ARGUMENTS π«Ά
evlistβ the evlist instance you're iterating through, bestie. this is the main character π the thing you're walking over, one evsel at a time.tmpβ astruct evseltemp iterator. think of it as the lil scratch pad π the macro needs so it can hold onto where it's going while it's busy letting go of where it's been. lowkey the whole reason this one's "safe" fr fr.evselβ astruct evseliterator. this is your actual cursor, the one doing the strolling β¨ your current evsel, your moment, your time to shine.
π quick note:tmpandevselare bothstruct evselthings β one's the temp, one's the iterator. don't get them twisted, bestie, that's the entire plot.
π¦ SEE ALSO π¦
- Kernel file
./tools/lib/perf/include/internal/evlist.hβ the source of truth, go touch grass in there π± __perf_evlist__for_each_entry(9)__perf_evlist__for_each_entry_reverse(9)perf_evlist__for_each_entry_reverse(9)__perf_evlist__for_each_entry_safe(9)
the whole friend group π β forward, reverse, safe, double-underscore secret-menu versions β they all hang out together, go say hi to each one.
π§ sign-off π«
and that's the page, bestie! π this slice of the Kernel API Manual lives in ./tools/lib/perf/include/internal, dated October 2026 β and the macro's own header/title was perf_evlist__...h_entry_safe(9) if you were wondering, which you so were ππ periodt, go iterate safely β¨π«Ά
π¦ 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