Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 May 2017 13:35:29 +0200
From:      Domagoj Stolfa <domagoj.stolfa@gmail.com>
To:        Beeblebrox <zaphod@berentweb.com>
Cc:        freebsd-dtrace@freebsd.org
Subject:   Re: dtrace noob: How is it used?
Message-ID:  <20170520113529.GA49886@wraith>
In-Reply-To: <20170520121029.708bc827@rsbsd>
References:  <20170520121029.708bc827@rsbsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
>=20
> 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

=46rom my understanding, I don't think there are scripts that can explicltl=
y tell
you that there have been memory leaks somewhere, but FreeBSD, upon unloadin=
g a
module will tell you that a given module has leaked X bytes of memory. Howe=
ver,
DTrace on FreeBSD has a dtmalloc provider, which lets you inspect quite a b=
it of
things based on named memory in the kernel. You could try using that in ord=
er 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 in=
spect
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.

--=20
Best regards,
Domagoj Stolfa

--LZvS9be/3tNcYl/X
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEHQB+y96lmmv+IXofwxT+ikb0YU4FAlkgKf8ACgkQwxT+ikb0
YU5WQQf+LVCPqNDBir/oU/PdWOd8Iz/yXKP39pMOaPQ+PAxBlcjrRrU3sajjn1A9
KOhGYGt377i3m476WDS4bmQ0yTUBVufJBNnYe2QhINjygcC2d9MkFDAV9uZRlFS1
09UiR6tiXWAXMeB9gUoqEGfdEkRzAgShDKjcD4pTzn6nq8IK0TQ8rGdegjyw3/Pf
cmebrnBqe9pCswHXaiWcumJqOJ1VbFMkRYqP29TpLMHg7IPYsLv9qanQkb1c/f62
r4la/6+YnNjDuZveLkhyQPRfg/9cr8duIUckP0Z/5ePOXNOMYWBd9rUzF2CPYbNJ
vHjDeda5EaaD6KQ4bGgSuOUilmReEQ==
=jsB4
-----END PGP SIGNATURE-----

--LZvS9be/3tNcYl/X--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170520113529.GA49886>