Date: Mon, 19 Dec 2016 22:54:25 +0100 From: Domagoj Stolfa <domagoj.stolfa@gmail.com> To: freebsd-arch@FreeBSD.org Cc: adrian.chadd@gmail.com, freebsd-current@freebsd.org Subject: RFC: DTrace probes for debugging or testing in userland programs Message-ID: <20161219215425.GB42198@freebsd-laptop> In-Reply-To: <20161220.060542.16356944875657261.hrs@allbsd.org> References: <20161220.043646.1181938468712455328.hrs@allbsd.org> <CAJ-Vmon3%2BjMyfgBcVORyMoXX3JEAFCWtK2VPo9wWLN2hsS%2BrNA@mail.gmail.com> <20161219204719.GE65993@freebsd-laptop> <20161220.060542.16356944875657261.hrs@allbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--+xNpyl7Qekk2NvDX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, > To be clear: my proposal is to replace only debug logging (i.e. for > developers), not the other logging in general, as the subject line > says. Although I agree that DTrace is not lightweight, I think > impact of just adding tracing probes is small. >=20 > -- Hiroki I believe this would indeed be beneficial for debugging. My main concern is the way that we would have to attach to probes should we use SDT provider as it works now. If we were to create probes for each of the daemons, which we would then run individually, and if I'm not mistaken, that would spawn 2 times the amount of processes than are currently=20 spawned due to each ``dtrace'' call from the command line spawns a process. Currently, I'm personally leaning towards a different provider, or perhaps a generalization of some operating principles in the SDT provider, so that code duplication can be avoided. Implementing a different provider would allow for a way to automatically log and fire the probes(this can be done quite easily in the provider). Additionally, the user could attach to the probes and perform some different operations in them as well. If we say that the logging level is 0, we could use a linker set and patch up the daemons to nops, so that there is no overhead. If we want to log something, we could simply patch them back in(this could be a sysctl). If the user wants to log something, one could attach to the probe using ``dtrace'', which would cause the provider to then patch up only that probe in the daemons, resulting in no overhead in other daemons. The sole purpose of this is to have a way to toggle logging and avoid spawning many processes of dtrace in order to log. The functionality could also be implemented in the way that Adrian was talking about, we could just say that the log is a debug log, and we only want to trigger it when a certain flag is set. --=20 Best regards, Domagoj Stolfa. --+xNpyl7Qekk2NvDX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEHQB+y96lmmv+IXofwxT+ikb0YU4FAlhYVxAACgkQwxT+ikb0 YU6lKwf+PhS9G+GvTsY3TcXq42B2XlCGl2crE4KCjkd18LJXyJ6ENvK6PsD1U7w4 DqifvCCfWy7IxJY1vYuxPVJiZEDbgecEMqnUgXj/BTGjCYJ85pwKm52q7D7HPTir 3yNhnWQTR3INg1EU+kpKV5S/1OxzCBKS7Sd9asAOxuXIY0ofGFg+Yu38xOAFLism YwcVr4qXlJB9dVp/GyVh3CxT2T0E9NIu1YpgUiiHZLj1yxyBhudzvEUd6ccvsoUU jVyQizC3fTe1uDgd/U0E+O5mou+oAvyGNnEsnJAt3wMYttNCaKibp0UQmbrrYZ45 UeapOVWu7Kgzs0P6oqI2us9Hu7U+UQ== =tTaz -----END PGP SIGNATURE----- --+xNpyl7Qekk2NvDX--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161219215425.GB42198>