GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-42197: Disable automatic update of frame locals during tracing by fabioz · Pull Request #23028 · python/cpython

bpo-42197: Disable automatic update of frame locals during tracing #23028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fabioz wants to merge 1 commit into python:main from fabioz:issue42197

Uh oh!

There was an error while loading. Please reload this page.

Closed

bpo-42197: Disable automatic update of frame locals during tracing #23028

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
50fe523
bpo-42197: Disable automatic update of frame locals during profiling …
fabioz Dec 20, 2020
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

11 changes: 11 additions & 0 deletions 11 Doc/library/sys.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,11 @@ always available.
``'c_exception'``
A C function has raised an exception. *arg* is the C function object.

.. versionchanged:: 3.10
`PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer
called before and after the profile function (they must now be explicitly
called when manipulating `PyFrameObject.f_locals`).

.. function:: setrecursionlimit(limit)

Set the maximum depth of the Python interpreter stack to *limit*. This limit
Expand Down Expand Up @@ -1417,6 +1422,12 @@ always available.
``'opcode'`` event type added; :attr:`f_trace_lines` and
:attr:`f_trace_opcodes` attributes added to frames

.. versionchanged:: 3.10
`PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer
called before and after the trace function (they must now be
explicitly called when manipulating `PyFrameObject.f_locals`).


.. function:: set_asyncgen_hooks(firstiter, finalizer)

Accepts two optional keyword arguments which are callables that accept an
Expand Down
9 changes: 9 additions & 0 deletions 9 Doc/whatsnew/3.10.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ Optimizations
bytecode level. It is now around 100% faster to create a function with parameter
annotations. (Contributed by Yurii Karabas and Inada Naoki in :issue:`42202`)

* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
(Contributed by Fabio Zadrozny in :issue:`issue42197`)

Deprecated
==========

Expand Down Expand Up @@ -656,6 +659,12 @@ Porting to Python 3.10
bugs like ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` test.
(Contributed by Zackery Spytz and Victor Stinner in :issue:`30459`.)

* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer
called before and after the trace or profile function, so, they must now
be explicitly called when manipulating `PyFrameObject.f_locals`.
(Contributed by Fabio Zadrozny in :issue:`issue42197`)


Deprecated
----------

Expand Down
4 changes: 4 additions & 0 deletions 4 Misc/NEWS.d/next/C API/2020-10-29-12-58-58.bpo-42197.-7wLUI.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
`PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer
called during profile nor tracing. To inspect the `PyFrameObject.f_locals` member,
debuggers and profilers implemented in C must now call `PyFrame_FastToLocalsWithError`
to update locals and `PyFrame_LocalsToFast` after `PyFrameObject.f_locals` are updated.
5 changes: 0 additions & 5 deletions 5 Python/sysmodule.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -950,10 +950,6 @@ static PyObject *
call_trampoline(PyThreadState *tstate, PyObject* callback,
PyFrameObject *frame, int what, PyObject *arg)
{
if (PyFrame_FastToLocalsWithError(frame) < 0) {
return NULL;
}

PyObject *stack[3];
stack[0] = (PyObject *)frame;
stack[1] = whatstrings[what];
Expand All @@ -962,7 +958,6 @@ call_trampoline(PyThreadState *tstate, PyObject* callback,
/* call the Python-level function */
PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3);

PyFrame_LocalsToFast(frame, 1);
if (result == NULL) {
PyTraceBack_Here(frame);
}
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.