__perf_evlis...h_entry_safe(9)
π __perf_evlis...h_entry_safe(9) π
okay so bestie, welcome to the Kernel API Manual β¨ this one's a macro name so long it got its own abbreviated little nickname up top (__perf_evlis...h_entry_safe(9) β yes the header really did give up halfway thru, iconic honestly π). let's get into it.
πΈ NAME πΈ
__perf_evlist__for_each_entry_safe β safely iterate thru all the evsels π¦
like, it walks the whole list, and it does it safely, which is the whole point (more on that vibe below, no cap).
β¨ SYNOPSIS β¨
__perf_evlist__for_each_entry_safe (list , tmp , evsel );
three things go in, that's the whole gig π
π«Ά ARGUMENTS π«Ά
listβ alist_headinstance to iterate. this is the thing you're walking thru, the main character of the operation πtmpβ astruct evseltemp iterator. it's your little sidekick holding onto the next one so nothing gets dropped mid-loop π§evselβ astruct evseliterator. this is the one you actually do stuff with on each pass, the one you're looking at rn π
ngl the whole "safe" thing is the entire personality here β tmp exists so you can keep going even while you're messing with the list as you go. that's the vibe check this macro is passing π₯
π SEE ALSO π
- Kernel file
./tools/lib/perf/include/internal/evlist.h __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)
like the whole friend group fr fr β go read the non-underscore ones too, they're all sitting in the same header being cute together π
π friendly reminder: this page is from./tools/lib/perf/include/internaland it's dated October 2026 β so yeah, sourced from there, dated that, and filed under__perf_evlis...h_entry_safe(9)one more time for the people in the back π£
stay safe out there (literally, it's in the name) β mwah ππ
π¦ 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