Re: dtrace noob: How is it used?

2017-05-20 Thread Domagoj Stolfa
Hello,

> Trying to use dtrace on my drm-next kernel that leaks memory to the
> extent that all swap space gets filled.
> easy enogh: kldload dtraceall
> 
> But which parameters and exactly how am I supposed to capture
> afterwards? I assume most useful info would be a) memory leaks per
> minute and b) source of leak. Wiki page was not much help for
> understanding usage: https://wiki.freebsd.org/DTrace/One-Liners

From my understanding, I don't think there are scripts that can explicltly tell
you that there have been memory leaks somewhere, but FreeBSD, upon unloading a
module will tell you that a given module has leaked X bytes of memory. However,
DTrace on FreeBSD has a dtmalloc provider, which lets you inspect quite a bit of
things based on named memory in the kernel. You could try using that in order to
detect which memory hasn't been freed based on the expected code flow in the
kernel.

To do this, you would have to look at the kernel code of interest, use the fbt
provider in order to instrument the problems you want, and based on that inspect
whether or not a given dtmalloc probe has fired with a given memory region (if
you have access to it).

Aside from that, I'm not aware of any other way to go about it.

> * /usr/share/dtrace has scirpts, are those sufficient for the problem
> or should I add sysutils/DTraceToolkit?
> * Which script(s) would provide adequate info for this problem and how
> could I log a per minute (or perhaps per event) output from the probes?

The DTrace Toolkit is largely written with Solaris (now illumos) in mind, so
there is a chance that some scripts in there might not work.

-- 
Best regards,
Domagoj Stolfa


signature.asc
Description: PGP signature


dtrace noob: How is it used?

2017-05-20 Thread Beeblebrox via freebsd-dtrace
Hello, simple noob question.

Trying to use dtrace on my drm-next kernel that leaks memory to the
extent that all swap space gets filled.
easy enogh: kldload dtraceall

But which parameters and exactly how am I supposed to capture
afterwards? I assume most useful info would be a) memory leaks per
minute and b) source of leak. Wiki page was not much help for
understanding usage: https://wiki.freebsd.org/DTrace/One-Liners

* /usr/share/dtrace has scirpts, are those sufficient for the problem
or should I add sysutils/DTraceToolkit?
* Which script(s) would provide adequate info for this problem and how
could I log a per minute (or perhaps per event) output from the probes?

Thanks
-- 
FreeBSD_amd64_12-Current_RadeonKMS
Please CC my email when responding, mail from list is not delivered.
___
freebsd-dtrace@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
To unsubscribe, send any mail to "freebsd-dtrace-unsubscr...@freebsd.org"