Page MenuHomeFreeBSD

procctl: add state flags to PROC_REAP_GETPIDS reports
ClosedPublic

Authored by val_packett.cool on Apr 15 2023, 6:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 30, 2:09 PM
Unknown Object (File)
Wed, Dec 25, 9:32 AM
Unknown Object (File)
Dec 6 2024, 12:50 AM
Unknown Object (File)
Nov 28 2024, 1:59 PM
Unknown Object (File)
Nov 26 2024, 9:11 AM
Unknown Object (File)
Oct 15 2024, 9:29 PM
Unknown Object (File)
Sep 5 2024, 9:36 AM
Unknown Object (File)
Aug 27 2024, 4:46 AM

Details

Summary

For a process supervisor using the reaper API to track process subtrees,
it is very useful to know which processes on the list are zombies.

Sponsored by: https://www.patreon.com/valpackett

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I do not object. IMO it would make sense to also report stopped and exiting processes too?

Yeah, agreed.

BTW, is the only difference between P_WEXIT and zombie state is that P_WEXIT gets set earlier in the process?

val_packett.cool retitled this revision from procctl: add a REAPER_PIDINFO_ZOMBIE flag to PROC_REAP_GETPIDS reports to procctl: add state flags to PROC_REAP_GETPIDS reports.Apr 15 2023, 8:07 PM

BTW, is the only difference between P_WEXIT and zombie state is that P_WEXIT gets set earlier in the process?

P_WEXIT processes are not zombies (sometimes).

sys/kern/kern_procctl.c
242

Note that P_WEXIT is kept even for zombies, the flag is not cleared on transition. Perhaps it makes sense to not set EXITING flag for processes that already exited.

Yeah, I guess it would make sense to only report "exiting" when not yet exited.

Please mail me git-formatted patch with all metadata. Also please bump the man page date.

This revision is now accepted and ready to land.Apr 15 2023, 9:14 PM