plan9fox/sys/src/9
cinap_lenrek 08d6b0f043 kernel: improve diagnostics by reversing the roles of Proc.parentpid and Proc.parent
for better system diagnostics, we *ALWAYS* want to record the parent
pid of a user process, regardless of if the child will post a wait
record on exit or not.

for that, we reverse the roles of Proc.parent and Proc.parentpid so
Proc.parentpid will always be set on rfork() and the Proc.parent
pointer will point to the parent's Proc structure or is set to nil
when no wait record should be posted on exit (RFNOWAIT flag).

this means that we can get the pid of the original parent process
from /proc, regardless of the the child having rforked with the
RFNOWAIT flag. this improves the output of pstree(1) somewhat if
the parent is still alive. note that theres no guarantee that the
parent pid is still valid.

the conditions are unchanged:

a user process that will post wait record has:

up->kp == 0 && up->parent != nil && up->parent->pid == up->parentpid

the boot process is:

up->kp == 0 && up->parent == nil && up->parentpid == 0

and kproc's have:

up->kp != 0 && up->parent == nil && up->parentpid == 0
2019-12-01 17:57:14 +01:00
..
bcm bcm: fix software cursor avoidance for loadimage() case (thanks bitmapper) 2019-10-27 23:51:11 +01:00
bcm64 bcm64: add addarchfile() prototype to fns.h (for qeed) 2019-09-15 04:53:45 +02:00
boot bootrc: for wireless netbooting, set the WPA/WPA2 preshard key with wpapsk=password boot parameter 2019-11-17 19:04:38 +01:00
ip devip: use the routing table for local source ip address selection 2019-11-10 19:50:46 +01:00
kw kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
mtx kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
omap kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
pc pc, pc64: merge adjacent e820 map entries of same type 2019-12-01 14:06:30 +01:00
pc64 pc, pc64: merge adjacent e820 map entries of same type 2019-12-01 14:06:30 +01:00
port kernel: improve diagnostics by reversing the roles of Proc.parentpid and Proc.parent 2019-12-01 17:57:14 +01:00
ppc kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
sgi kernel: catch execution read fault on SG_NOEXEC segment (for mips) 2019-08-27 03:48:51 +02:00
teg2 kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
xen kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
zynq kernel: catch execution read fault on SG_NOEXEC segment 2019-08-27 03:47:18 +02:00
mkfile