Skip to contentSkip to conversation

proc, coredump: add CoreDumping flag to /proc/pid/status

RFC Alexey Dobriyan 2 participants 4 messages Sep 13, 2017

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines

To provide an ability to detect if a process is in the state of being coreduped, we can expose a boolean CoreDumping flag in /proc/pid/status.

Or add "State: C" ?

#1 lore raw
Quoted 5 lines · Alexey Dobriyan
Quoted 3 lines

To provide an ability to detect if a process is in the state of being coreduped, we can expose a boolean CoreDumping flag in /proc/pid/status.

Or add "State: C" ?

A program in such state can also sleep and run, so it's not a state in terms of process states.

#2 lore raw
Quoted 9 lines · Roman Gushchin
Quoted 5 lines · Alexey Dobriyan
Quoted 3 lines

To provide an ability to detect if a process is in the state of being coreduped, we can expose a boolean CoreDumping flag in /proc/pid/status.

Or add "State: C" ?

A program in such state can also sleep and run, so it's not a state in terms of process states.

Well, maybe something will break from seeing unknown process state.

Regardless, symlink /proc/$PID/coredump pointing to either "0" or "1" is faster than open+read+parse+close.

#3 lore raw
Quoted 8 lines · Alexey Dobriyan
Quoted 7 lines · Roman Gushchin
Quoted 5 lines · Alexey Dobriyan
Quoted 3 lines

To provide an ability to detect if a process is in the state of being coreduped, we can expose a boolean CoreDumping flag in /proc/pid/status.

Or add "State: C" ?

Quoted 7 lines
Quoted 2 lines

A program in such state can also sleep and run, so it's not a state in terms of process states.

Well, maybe something will break from seeing unknown process state.

Regardless, symlink /proc/$PID/coredump pointing to either "0" or "1" is faster than open+read+parse+close.

Performance doesn't really matter in this case: nobody should check this flag often. An expected usecase is described above: check the flag once before killing the process by timeout.
So, it doesn't look deserving a separate entity in procfs.