trace_pid_next(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 +1 situation 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:


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