Page MenuHomeFreeBSD

kern: move the vnode user coredumper out into its own file
AcceptedPublic

Authored by kevans on Wed, Jul 16, 4:11 PM.
Tags
None
Referenced Files
F124185330: D51349.id158615.diff
Wed, Jul 23, 10:51 AM
F124181388: D51349.id158651.diff
Wed, Jul 23, 9:32 AM
F124178891: D51349.id158615.diff
Wed, Jul 23, 8:42 AM
Unknown Object (File)
Tue, Jul 22, 12:27 AM
Unknown Object (File)
Mon, Jul 21, 11:47 PM
Unknown Object (File)
Thu, Jul 17, 9:13 PM
Unknown Object (File)
Thu, Jul 17, 12:33 PM
Unknown Object (File)
Thu, Jul 17, 10:46 AM
Subscribers

Details

Reviewers
markj
kib
Summary

This more cleanly contains the bits that are specifically relevant to
dumping coredumps out to a vnode, which will make future changes a bit
easier to review. This also makes the scope of the relevant sysctls
easier to reason about in the process, as they're not visible outside of
the vnode dumper file -- this will mostly become relevant when we allow
pluggable dumpers.

While we're here, move all of the coredump-related stuff out into its
own sys/coredump.h. We have enough that it's useful to separate it out
and de-clutter sys/exec.h a bit.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65501
Build 62384: arc lint + arc unit

Event Timeline

I would also move rest of generic core dump bits into e.g. kern_ucoredump.c (from kern_sig.c).

sys/kern/coredump_vnode.c
30

No need in param.h it is provided by systm.h

59

Use _Static_assert?

62

and below

77

I suggest getting rid of this define, it does not add any value, only obfuscates the real use of the lock.

79
kevans marked 5 inline comments as done.

Address review commentary, and split further bits out of kern_sig.c

sys/coredump.h -> sys/ucoredump.h for symmetry with kern_ucoredump.c. The vnode
dumper remains in coredump_vnode.c for the time being to mirror the historical
naming of coredump().

share/man/man5/core.5
119

This could probably use a rewrite in general... the below options correspond directly to values of kern.compress_uesr_cores below being usable, but it's not really tied in that well. I have a draft re-flow of some of the above text prepared for the next review in the stack, because it's a little messy: we talk about the core filename, segue over to signals blocked, then return back to discussing filename configuration. My edit will move the middle bit down to keep all of the naming stuff together, particularly because it's more useful as those two or three paragraphs around and including it are describing the default vnode dumper.

sys/kern/kern_sig.c
3636

I would move sigexit() to kern_ucoredump.c as well.

Take sigexit() with us

sig_do_core() is added for the one conditional in sigexit() that wants to check
a sigprop, rather than opening up sigprops more widely -- this is the only
change to the function in the move. Blank line at the beginning of
sig_do_core() is retained for consistency with the rest of the file.

This revision is now accepted and ready to land.Thu, Jul 17, 4:14 AM
markj added inline comments.
sys/kern/kern_sig.c
48

This include of compressor.h can probably go away.

sys/kern/kern_ucoredump.c
214

Extra newline.