[Python-Dev] DTRACE support

Jesus Cea jcea at jcea.es
Fri Sep 6 17:55:52 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/09/13 17:29, Charles-François Natali wrote:
> IMO, that's a large, intrusive patch, which distracts the reader
> from the main code and logic.

Yes, the patch is intrusive. It must be, to get its goals. Could be
improved, nevertheless. Help and suggestions welcome.

I want to write a probe for the GIL, but I didn't because I know
adding the cost of an extra single machine code branch would be
anathema here :-) (lets do baby steps), but I would love to be able to
watch with detail all interaction between the GIL, threads, and OS
scheduling on my Solaris :). That is very valuable information to
have, for instance, to guide future improvements of the GIL. How can
you get that kind of information with any other tool?

> IMO it's not worth it (personally strace/gdb/valgrind are more
> than enough for me, and we''re about to gain memory tracing with
> Victor's tracemalloc).

The main value of DTrace is systemwide observability. You can see
something "strange" at kernel level and trace it to a particular line
of code in a random Python script. There is no other tool that can do
that. You have complete transversal observability of ALL the code
running in your computer, kernel or usermode, clean reports with
threads, etc.

Valgrind doesn't work on Solaris and *BSD support is unclean.

You can run a dtrace script in a long running python process if you
need it, after launching it, at runtime, and when the dtrace script is
done, the python program keeps running without any penalty. Just
poking around, for instance. I do it constantly for, for instance,
profiling covering both Python as any C code/libraries called from it.

Maybe the biggest objection would be that most python-devs are running
Linux, and you don't have dtrace support on linux unless you are
running Oracle distribution. But world is larger than linux, and there
are some efforts to port DTrace to Linux itself. DTrace is available
on Solaris and derivatives, MacOS X and FreeBSD.

- -- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQCVAwUBUin7CJlgi5GaxT1NAQKbfwP+PjOqf3pjlHHq78ggA8qyNkjPFXEoRVj9
9PKslZ7FiU+JWxzXY52k1GNspHhIox+PAcvdBL/gWU3rOiqjEm5fU8FX61Lh6FMj
bB+QRyZLpLfmANrLX43sBvwDbG9gTuq8FVUvqmtSme615vX2ygITwNZysQ7xPoD/
jXbeOAF0LZU=
=asEC
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list