Page MenuHomeFreeBSD

dtrace_dtmalloc.4: Document the DTrace dtmalloc provider
Changes PlannedPublic

Authored by 0mp on Jul 17 2025, 8:56 PM.
Referenced Files
Unknown Object (File)
Tue, Nov 4, 12:44 AM
Unknown Object (File)
Mon, Nov 3, 8:18 PM
Unknown Object (File)
Mon, Oct 27, 2:57 PM
Unknown Object (File)
Mon, Oct 27, 5:09 AM
Unknown Object (File)
Sun, Oct 26, 11:36 PM
Unknown Object (File)
Sun, Oct 26, 11:36 PM
Unknown Object (File)
Sun, Oct 26, 11:15 PM
Unknown Object (File)
Wed, Oct 22, 1:12 AM
Subscribers

Details

Diff Detail

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

Event Timeline

0mp requested review of this revision.Jul 17 2025, 8:56 PM
share/man/man4/dtrace_dtmalloc.4
20

This could go on one line.

share/man/man4/dtrace_dtmalloc.4
12

I think the "9" in malloc(9) makes "kernel memory" redundant.

20
20

I think "type" can be explained a bit.

31
44
59

I am not really sure I understand this section.

102

Maybe "trace" instead of "instrument"? Not sure to be honest.

share/man/man4/dtrace_dtmalloc.4
24

I think explaining briefly what a malloc "type" is would be useful.

49

The probe argument types are already listed by dtrace -lv so I'm not sure it's useful to list them here unless you also describe what they are.

Briefly, the first three arguments for each probe provide references to the malloc type internals; size is the size of the allocation; zindx is the index into the kmemzones[] array used for the allocation.

In practice, size is the most useful parameter.

59

It means that if the malloc type was defined by

MALLOC_DEFINE(M_FOO_BAR, "foo bar", "FooBar subsystem");

the probes will be called dtmalloc::foo_bar:.

share/man/man4/dtrace_dtmalloc.4
59

Right, I think it'd be good to make that more explicit. I'm not sure it is immediately obvious.

0mp marked 8 inline comments as done.
  • address feedback (I answered some of the comments directly or at least marked them as done)
  • sort copyright header
0mp marked an inline comment as done.Fri, Oct 24, 8:14 PM
0mp added inline comments.
share/man/man4/dtrace_dtmalloc.4
12

@ziaee wants us to avoid cross-references in Nd, so I removed malloc(9) completely.

49

Thanks, Mark! I've added that to the manual.

59

I'll include an example to make it clearer.

Remove password prompt from the example

share/man/man4/dtrace_dtmalloc.4
12

Plz no xref in titles

12

Just to clarify/remove myself as the issue, Xr in Nd does not work with apropos, and probably many other things.

When I asked the author of apropos, he said this was not a bug, and changed mdoc(7) to say:

"The Nd macro technically accepts child macros and terminates with a subsequent Sh invocation. Do not assume this behaviour: "

0mp marked 2 inline comments as done.Mon, Nov 3, 2:21 PM
0mp added inline comments.
share/man/man4/dtrace_dtmalloc.4
12

Yup, thanks for making sure that we do not add more xrefs to titles :)

0mp planned changes to this revision.Mon, Nov 3, 3:45 PM
0mp marked an inline comment as done.

I need to add a explanation of malloc types