FudCon Success – Systemtap meets Python
At FudCon, David Malcolm, Jon VanAlten, Will Cohen and I sat down, had some fun and made tracing python methods through systemtap possible:
0 python(20122): => search_function in Lib/encodings/__init__.py:71
15 python(20122): => normalize_encoding in Lib/encodings/__init__.py:49
37 python(20122): <= normalize_encoding
170 python(20122): => <module> in Lib/encodings/utf_8.py:8
193 python(20122): => IncrementalEncoder in Lib/encodings/utf_8.py:18
206 python(20122): <= IncrementalEncoder
251 python(20122): => IncrementalDecoder in Lib/encodings/utf_8.py:22
264 python(20122): <= IncrementalDecoder
310 python(20122): => StreamWriter in Lib/encodings/utf_8.py:25
323 python(20122): <= StreamWriter
340 python(20122): => StreamReader in Lib/encodings/utf_8.py:28
353 python(20122): <= StreamReader
367 python(20122): <= <module>
391 python(20122): => getregentry in Lib/encodings/utf_8.py:33
410 python(20122): => __new__ in Lib/codecs.py:77
429 python(20122): <= __new__
440 python(20122): <= getregentry
462 python(20122): <= search_function
The coolest part is that it works through the existing patch to python for adding dtrace support. Some small tweaks to the autoconf detection was needed, but the rest was used as is.
If you want to learn how to add static user space probes to your program/package please see Will’s excellent guide. Adding User Space Probing to an Application: A simple example adding markers to a user-space application with SystemTap.
