Peter McCormick <pe...@pdmccormick.com> added the comment:

I would like to propose the following patch[0] which generalizes the 
`PyDTrace_*` definitions to a more generic `PyProbe` structure, in anticipation 
of including LTTng support side-by-side with the existing DTrace support.

A couple of argument types in `Include/pydtrace.h` were also changed to match 
those in `Include/pydtrace.d`. I can split that out to a separate, pre-PyProbe 
patch if that would be preferred.

Some of the `*_ENABLED()` calls were reorganized such that they will actually 
be invoked twice (specifically in `Python/ceval.c` were the enabled check was 
used prior to calling helper functions, which then eventually invoked the 
DTrace macros.) If this won't work, we could add a sequence of 
guarded-by-ifdef-instead-of-enabled calls to ensure that there will only ever 
be one instance of any given `PyDTrace_*_ENABLED()` call.

I've tested compilation on macOS with and without DTrace configured.

Feedback and comments would be most welcome!

Thanks,
Peter

[0] 
https://github.com/pdmccormick/cpython/commit/1e399f5ec381276b52e6a4f5a755fc0f23bd6d97
[1] https://github.com/pdmccormick/cpython/tree/bpo-28909-pyprobe-refactor

----------
versions: +Python 3.8 -Python 3.7
Added file: 
https://bugs.python.org/file47715/bpo-28909-pyprobe-refactor-20180727.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue28909>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to