[cython/cython] Implement PEP-669 sys.monitoring support (PR #6144)

0 views
Skip to first unread message

scoder

unread,
Apr 17, 2024, 4:21:49 PM4/17/24
to cython/cython, Subscribed

Uses the PyMonitoring C-API that is being developed for Py3.13.

See https://docs.python.org/3/library/sys.monitoring.html
See python/cpython#111997
See python/cpython#116413


You can view, comment on, or merge this pull request online at:

  https://github.com/cython/cython/pull/6144

Commit Summary

  • 2d4374d Implement PEP-669 sys.monitoring support.

File Changes

(9 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144@github.com>

scoder

unread,
Apr 18, 2024, 3:08:20 AM4/18/24
to cython/cython, Push

@scoder pushed 1 commit.

  • 68648bc Fix macro signatures and add missing dummy macros.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18049426649@github.com>

scoder

unread,
Apr 18, 2024, 4:15:16 AM4/18/24
to cython/cython, Push

@scoder pushed 3 commits.

  • 7edef77 Fix long lines.
  • db03c44 Test runner: Use tag instead of >version to exclude pstats tests only on Python 3.12, not later.
  • ddfa12b Re-add dummy macro in Py3.12.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18050370400@github.com>

scoder

unread,
Apr 18, 2024, 12:12:21 PM4/18/24
to cython/cython, Push

@scoder pushed 2 commits.

  • 691d17c Make macro implementation safer.
  • b43394e Start implementing generator tracing.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18058076321@github.com>

scoder

unread,
Apr 18, 2024, 12:43:12 PM4/18/24
to cython/cython, Push

@scoder pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18058506075@github.com>

scoder

unread,
Apr 19, 2024, 3:37:09 AM4/19/24
to cython/cython, Push

@scoder pushed 1 commit.

  • 99af453 Trace coroutine resumes as function start in non-monitoring Python.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18067286133@github.com>

scoder

unread,
Apr 26, 2024, 5:53:28 AM4/26/24
to cython/cython, Push

@scoder pushed 1 commit.

  • a9a280e Fix code object creation for Lambda nodes.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18169901508@github.com>

scoder

unread,
Apr 26, 2024, 3:37:36 PM4/26/24
to cython/cython, Push

@scoder pushed 2 commits.

  • 7eabd35 Disable coverage/tracing tests in Py3.12.
  • b3697c1 Fix fallback declaration.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18177673864@github.com>

scoder

unread,
Apr 27, 2024, 3:27:35 AM4/27/24
to cython/cython, Push

@scoder pushed 1 commit.

  • 6fa7e70 Generally disable monitoring/tracing tests in non-CPython before Py3.13 (not only PyPy).


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18181919722@github.com>

scoder

unread,
Apr 27, 2024, 4:04:02 AM4/27/24
to cython/cython, Push

@scoder pushed 1 commit.

  • 71607ec Implement monitoring for generators and fix return value reporting.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18182095652@github.com>

scoder

unread,
Apr 28, 2024, 9:16:19 AM4/28/24
to cython/cython, Push

@scoder pushed 2 commits.

  • 078cce0 Implement exception monitoring and remove the code in pre-monitoring Python versions since it was never actually used.
  • 219db5f Fix 'skip_dispatch' condition for module level cpdef functions.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18191043505@github.com>

scoder

unread,
Apr 28, 2024, 11:14:06 AM4/28/24
to cython/cython, Push

@scoder pushed 3 commits.

  • 70ddc4d Remove duplicate test code.
  • fb6373a Move import into doctest.
  • b65ac1c Let the Python cpdef wrapper function use the same code object as the underlying implementation function but do not re-initialise the trace so that both run in the same monitoring context.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18191743392@github.com>

scoder

unread,
Apr 29, 2024, 9:41:09 AM4/29/24
to cython/cython, Push

@scoder pushed 6 commits.

  • 151e12c Fix 'return' tracing when only 'linetrace' is enabled.
  • 4ec2249 Add Python comparison test to "line_trace" test.
  • 30882a7 Do not issue start/line/return events from cpdef wrapper.
  • e8ff7c3 Do not generate dead code in Python cpdef wrapper.
  • e49c5b8 Enable line tracing for 'pass' statements.
  • b1caa7e Implement line monitoring, including repeated line events for the loop header.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18203570238@github.com>

scoder

unread,
Apr 29, 2024, 3:43:21 PM4/29/24
to cython/cython, Push

@scoder pushed 2 commits.

  • caa5db0 Delete test that is now invalid.
  • b4aeec4 Fix PassStatNode replacement.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18208829831@github.com>

scoder

unread,
Apr 30, 2024, 8:44:14 AM4/30/24
to cython/cython, Push

@scoder pushed 3 commits.

  • 9079fc8 Make "line_trace" test failures easier to understand.
  • e1ab3ff Undo accidentally committed changes.
  • b38edbe Re-add Return tracing in the exception case for pre-monitoring profiling.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18220000172@github.com>

scoder

unread,
May 3, 2024, 12:53:51 AM5/3/24
to cython/cython, Push

@scoder pushed 5 commits.

  • 6fcea7f Improve test output.
  • ab42d90 Extract common code from __Pyx_TraceLine() macro to reduce the inline code overhead.
  • 6867197 Fix some code issues with generators.
  • 29039bc Clean up the ownership of code objects between functions, their def/cpdef wrappers, and generator def/body. The code object is now owned by the innermost tree node (wrapper/gbody/etc.) and used by the outer syntax node (lambda, generator expression, function).
  • b420e19 Extend the generator monitoring tests.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18260690872@github.com>

scoder

unread,
May 7, 2024, 5:57:37 AM5/7/24
to cython/cython, Push

@scoder pushed 1 commit.

  • 785060c Initial attempts to monitor fused functions and set up their code objects independently (because they are really separate functions in the same code section).


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18310813661@github.com>

scoder

unread,
May 19, 2024, 2:32:04 AM5/19/24
to cython/cython, Push

@scoder pushed 4 commits.

  • 3508eb9 Properly apply declaration analysis to code objects.
  • ade0107 Improve test name output by including the file extension (py/pyx/srctree)
  • 8f9898e Fix crash in error case due to invalid tree structure.
  • 4060977 Clean up various issues with missing or mishandled code objects. We now always treat them as constant and just make sure they have their result code set up.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18487490881@github.com>

scoder

unread,
May 19, 2024, 6:45:18 AM5/19/24
to cython/cython, Push

@scoder pushed 2 commits.

  • aabdaab Use correct code object for fused wrapper functions.
  • eafaeb0 Give all CFuncDefNodes a CodeObjectNode, not just those with a Python wrapper.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <cython/cython/pull/6144/push/18488861815@github.com>

Reply all
Reply to author
Forward
0 new messages