| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
* stop the world when setting local events
|
|
|
|
| |
counts. (#119179)
|
| |
|
|
|
|
| |
(#119216)
|
|
|
|
| |
function (#118496)
|
| |
|
|
|
|
|
|
| |
* Check tracing in RESUME_CHECK
* Only change to RESUME_CHECK if not tracing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code for Tier 2 is now only compiled when configured
with `--enable-experimental-jit[=yes|interpreter]`.
We drop support for `PYTHON_UOPS` and -`Xuops`,
but you can disable the interpreter or JIT
at runtime by setting `PYTHON_JIT=0`.
You can also build it without enabling it by default
using `--enable-experimental-jit=yes-off`;
enable with `PYTHON_JIT=1`.
On Windows, the `build.bat` script supports
`--experimental-jit`, `--experimental-jit-off`,
`--experimental-interpreter`.
In the C code, `_Py_JIT` is defined as before
when the JIT is enabled; the new variable
`_Py_TIER2` is defined when the JIT *or* the
interpreter is enabled. It is actually a bitmask:
1: JIT; 2: default-off; 4: interpreter.
|
|
|
| |
Small TSAN fixups for instrumentation
|
| |
|
|
|
|
|
|
|
| |
(#116775)
Makes sys.settrace, sys.setprofile, and monitoring generally thread-safe.
Mostly uses a stop-the-world approach and synchronization around the code object's _co_instrumentation_version. There may be a little bit of extra synchronization around the monitoring data that's required to be TSAN clean.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a unified 16-bit backoff counter type (``_Py_BackoffCounter``),
shared between the Tier 1 adaptive specializer and the Tier 2 optimizer. The
API used for adaptive specialization counters is changed but the behavior is
(supposed to be) identical.
The behavior of the Tier 2 counters is changed:
- There are no longer dynamic thresholds (we never varied these).
- All counters now use the same exponential backoff.
- The counter for ``JUMP_BACKWARD`` starts counting down from 16.
- The ``temperature`` in side exits starts counting down from 64.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#115856)
A previous commit introduced a bug to `interpreter_clear()`: it set
`interp->ceval.instrumentation_version` to 0, without making the corresponding
change to `tstate->eval_breaker` (which holds a thread-local copy of the
version). After this happens, Python code can still run due to object finalizers
during a GC, and the version check in bytecodes.c will see a different result
than the one in instrumentation.c causing an infinite loop.
The fix itself is straightforward: clear `tstate->eval_breaker` when clearing
`interp->ceval.instrumentation_version`.
|
|
|
|
|
|
|
| |
(GH-114986)" (GH-116178)
Revert "gh-107674: Improve performance of `sys.settrace` (GH-114986)"
This reverts commit 0a61e237009bf6b833e13ac635299ee063377699.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds an `eval_breaker` field to `PyThreadState`. The primary
motivation is for performance in free-threaded builds: with thread-local eval
breakers, we can stop a specific thread (e.g., for an async exception) without
interrupting other threads.
The source of truth for the global instrumentation version is stored in the
`instrumentation_version` field in PyInterpreterState. Threads usually read the
version from their local `eval_breaker`, where it continues to be colocated
with the eval breaker bits.
|
|
|
|
| |
classes. (GH-113680)
|
|
|
|
|
|
|
| |
* Use local monitoring for opcode trace
* Remove f_opcode_trace_set
* Add test for setting f_trace_opcodes after settrace
|
| |
|
| |
|
|
|
|
| |
and globally. (GH-110384)
|
|
|
|
| |
word. (GH-109846)
|
|
|
|
| |
(GH-109420)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a 16-bit inline cache entry to the conditional branch instructions POP_JUMP_IF_{FALSE,TRUE,NONE,NOT_NONE} and their instrumented variants, which is used to keep track of the branch direction.
Each time we encounter these instructions we shift the cache entry left by one and set the bottom bit to whether we jumped.
Then when it's time to translate such a branch to Tier 2 uops, we use the bit count from the cache entry to decided whether to continue translating the "didn't jump" branch or the "jumped" branch.
The counter is initialized to a pattern of alternating ones and zeros to avoid bias.
The .pyc file magic number is updated. There's a new test, some fixes for existing tests, and a few miscellaneous cleanups.
|
|
|
|
| |
during callback. (GH-109131)
|
|
|
|
| |
instrumentation functions (#109076)
|
| |
|
|
|
|
| |
`sys.monitoring.set_local_events()` (GH-108420)
|
| |
|
|
|
|
| |
(#108367)
|
| |
|
|
|
|
| |
performance. (GH-108036)
|
|
|
|
| |
opcode (#107978)
|
|
|
|
| |
opcode is defined (#107882)
|
|
|
|
| |
(GH-107780)
|
| |
|
| |
|
|
|
|
| |
cannot be disabled. (GH-107337)
|
|
|
| |
* Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
|
|
|
|
| |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
| |
Rename private C API constants:
* Rename PY_MONITORING_UNGROUPED_EVENTS to _PY_MONITORING_UNGROUPED_EVENTS
* Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS
|
|
|
|
|
|
|
|
|
|
| |
Remove the following functions from the C API, move them to the internal C
API: add a new pycore_modsupport.h internal header file:
* PyModule_CreateInitialized()
* _PyArg_NoKwnames()
* _Py_VaBuildStack()
No longer export these functions.
|
|
|
|
| |
Replace PyInterpreterState_Get() with inlined
_PyInterpreterState_GET().
|
|
|
|
| |
Replace calls to the (removed) slow _PyInterpreterState_Get() with
fast inlined _PyInterpreterState_GET() function.
|
| |
|
| |
|