trace_pid_next(9)
β¨ trace_pid_next(9) β¨
okay so bestie, welcome to trace_pid_next(9) from the Kernel API Manual β this is the little function that does the "next" dance for kernel tracing pid lists π
πΈ NAME πΈ
trace_pid_next β literally the function that's used for seq_file to get to the next pid of a pid_list π
π¦ SYNOPSIS π¦
void * trace_pid_next (struct trace_pid_list *pid_list , void *v ,
loff_t *pos );
π ARGUMENTS π
pid_listβ the pid list to show π this is the lineup you're scrolling through.vβ the last pid that was shown. and bestie, listen: it's +1 the actual pid, and that whole+1situation exists specifically so that a pid of zero can still be displayed. genius behavior fr fr.posβ the position of the file π
π DESCRIPTION π
So this is what the seq_file "next" operation calls to iterate the pids listed in a trace_pid_list structure. that's the whole vibe β¨
It returns pid+1, because we want to be able to display a pid of zero β but NULL would stop the iteration π so the +1 is doing the actual emotional labor here. iconic, honestly.
lowkey important: return NULL and the iteration just ends. no more pids for you π
π«Ά SEE ALSO π«Ά
Kernel file ./kernel/trace/trace_pid.c, plus all these besties:
trace_find_filtered_pid(9)trace_ignore_this_task(9)trace_filter_add_remove_task(9)trace_pid_start(9)trace_pid_show(9)
and that's the page! π sign-off time: this one's from the <pink>./kernel/trace</pink> source, dated <purple>October 2026</purple>, hanging out in the Kernel API Manual. go read your kernel source bestie, ily ππ§
π¦ 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