Skip to content

Commit 2e9b980

Browse files
Merge remote-tracking branch 'upstream/main' into resume_tracing
2 parents 62ea35e + e167e06 commit 2e9b980

File tree

4 files changed

+83
-5
lines changed

4 files changed

+83
-5
lines changed

Doc/howto/instrumentation.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,84 @@ Available static markers
341341
.. versionadded:: 3.8
342342

343343

344+
C Entry Points
345+
^^^^^^^^^^^^^^
346+
347+
To simplify triggering of DTrace markers, Python's C API comes with a number
348+
of helper functions that mirror each static marker. On builds of Python without
349+
DTrace enabled, these do nothing.
350+
351+
In general, it is not necessary to call these yourself, as Python will do
352+
it for you.
353+
354+
.. list-table::
355+
:widths: 50 25 25
356+
:header-rows: 1
357+
358+
* * C API Function
359+
* Static Marker
360+
* Notes
361+
* * .. c:function:: void PyDTrace_LINE(const char *arg0, const char *arg1, int arg2)
362+
* :c:func:`!line`
363+
*
364+
* * .. c:function:: void PyDTrace_FUNCTION_ENTRY(const char *arg0, const char *arg1, int arg2)
365+
* :c:func:`!function__entry`
366+
*
367+
* * .. c:function:: void PyDTrace_FUNCTION_RETURN(const char *arg0, const char *arg1, int arg2)
368+
* :c:func:`!function__return`
369+
*
370+
* * .. c:function:: void PyDTrace_GC_START(int arg0)
371+
* :c:func:`!gc__start`
372+
*
373+
* * .. c:function:: void PyDTrace_GC_DONE(Py_ssize_t arg0)
374+
* :c:func:`!gc__done`
375+
*
376+
* * .. c:function:: void PyDTrace_INSTANCE_NEW_START(int arg0)
377+
* :c:func:`!instance__new__start`
378+
* Not used by Python
379+
* * .. c:function:: void PyDTrace_INSTANCE_NEW_DONE(int arg0)
380+
* :c:func:`!instance__new__done`
381+
* Not used by Python
382+
* * .. c:function:: void PyDTrace_INSTANCE_DELETE_START(int arg0)
383+
* :c:func:`!instance__delete__start`
384+
* Not used by Python
385+
* * .. c:function:: void PyDTrace_INSTANCE_DELETE_DONE(int arg0)
386+
* :c:func:`!instance__delete__done`
387+
* Not used by Python
388+
* * .. c:function:: void PyDTrace_IMPORT_FIND_LOAD_START(const char *arg0)
389+
* :c:func:`!import__find__load__start`
390+
*
391+
* * .. c:function:: void PyDTrace_IMPORT_FIND_LOAD_DONE(const char *arg0, int arg1)
392+
* :c:func:`!import__find__load__done`
393+
*
394+
* * .. c:function:: void PyDTrace_AUDIT(const char *arg0, void *arg1)
395+
* :c:func:`!audit`
396+
*
397+
398+
399+
C Probing Checks
400+
^^^^^^^^^^^^^^^^
401+
402+
.. c:function:: int PyDTrace_LINE_ENABLED(void)
403+
.. c:function:: int PyDTrace_FUNCTION_ENTRY_ENABLED(void)
404+
.. c:function:: int PyDTrace_FUNCTION_RETURN_ENABLED(void)
405+
.. c:function:: int PyDTrace_GC_START_ENABLED(void)
406+
.. c:function:: int PyDTrace_GC_DONE_ENABLED(void)
407+
.. c:function:: int PyDTrace_INSTANCE_NEW_START_ENABLED(void)
408+
.. c:function:: int PyDTrace_INSTANCE_NEW_DONE_ENABLED(void)
409+
.. c:function:: int PyDTrace_INSTANCE_DELETE_START_ENABLED(void)
410+
.. c:function:: int PyDTrace_INSTANCE_DELETE_DONE_ENABLED(void)
411+
.. c:function:: int PyDTrace_IMPORT_FIND_LOAD_START_ENABLED(void)
412+
.. c:function:: int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void)
413+
.. c:function:: int PyDTrace_AUDIT_ENABLED(void)
414+
415+
All calls to ``PyDTrace`` functions must be guarded by a call to one
416+
of these functions. This allows Python to minimize performance impact
417+
when probing is disabled.
418+
419+
On builds without DTrace enabled, these functions do nothing and return
420+
``0``.
421+
344422
SystemTap Tapsets
345423
-----------------
346424

Lib/test/libregrtest/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def setup_unraisable_hook() -> None:
150150
sys.unraisablehook = regrtest_unraisable_hook
151151

152152

153-
orig_threading_excepthook: Callable[..., None] | None = None
153+
orig_threading_excepthook: Callable[..., object] | None = None
154154

155155

156156
def regrtest_threading_excepthook(args) -> None:

Tools/clinic/libclinic/clanguage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from operator import attrgetter
77
from collections.abc import Iterable
88

9-
import libclinic
9+
import libclinic.cpp
1010
from libclinic import (
1111
unspecified, fail, Sentinels, VersionTuple)
1212
from libclinic.codegen import CRenderData, TemplateDict, CodeGen

Tools/requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Requirements file for external linters and checks we run on
22
# Tools/clinic, Tools/cases_generator/, and Tools/peg_generator/ in CI
3-
mypy==1.17.1
3+
mypy==1.19.1
44

55
# needed for peg_generator:
6-
types-psutil==7.0.0.20250801
7-
types-setuptools==80.9.0.20250801
6+
types-psutil==7.2.2.20260130
7+
types-setuptools==82.0.0.20260210

0 commit comments

Comments
 (0)