Page MenuHomeFreeBSD

dtrace: stop using eventhandlers for the part compiled into the kernel
ClosedPublic

Authored by mjg on Nov 22 2020, 4:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 4:33 PM
Unknown Object (File)
Sep 20 2024, 6:23 AM
Unknown Object (File)
Sep 19 2024, 3:41 PM
Unknown Object (File)
Sep 18 2024, 9:05 PM
Unknown Object (File)
Sep 17 2024, 2:35 PM
Unknown Object (File)
Sep 16 2024, 3:28 PM
Unknown Object (File)
Sep 16 2024, 3:28 PM
Unknown Object (File)
Sep 16 2024, 3:28 PM
Subscribers

Details

Summary

Side note is that allocations sizes seem also out of whack, will be sorted out separately.

Duplication in creation of proc/thread0 will have to be sorted out as well but that's beyond the scope.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg requested review of this revision.Nov 22 2020, 4:01 AM
mjg created this revision.

I am fine with conversion.

What surprises me is that just the presence of the hooks implies mallocs.

That said, why not piggy-back dtrace memory on struct thread, as we already have the scheduler data placed that way, see sched_sizeof_thread() and sched_sizeof_proc(). Just put one more addend into the zone creation size argument.

sys/kern/kern_dtrace.c
87 ↗(On Diff #79844)

(void) while you are there

markj added inline comments.
sys/kern/kern_proc.c
68 ↗(On Diff #79844)

If we are going to unconditionally include this header, it would be better to define the hooks for both KDTRACE_HOOKS and !KDTRACE_HOOKS, to avoid further polluting the code with ifdefs.

This revision is now accepted and ready to land.Nov 22 2020, 6:46 PM

threads are NOFREE so this would add more memory which can't be reclaimed until reboot