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)
Wed, May 27, 1:15 PM
Unknown Object (File)
Wed, May 27, 8:23 AM
Unknown Object (File)
Tue, May 26, 1:14 AM
Unknown Object (File)
Tue, May 19, 6:35 PM
Unknown Object (File)
Tue, May 19, 9:16 AM
Unknown Object (File)
Mon, May 18, 10:33 PM
Unknown Object (File)
Mon, May 18, 11:16 AM
Unknown Object (File)
Sun, May 17, 10:35 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 50928
Build 47819: arc lint + arc unit

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