Skip to content

bpo-31618: Move opcode tracing to occur after the possible update to f_lineno.#3798

Merged
ncoghlan merged 1 commit into
python:masterfrom
gwk:opcode-trace-after-line-update
Oct 19, 2017
Merged

bpo-31618: Move opcode tracing to occur after the possible update to f_lineno.#3798
ncoghlan merged 1 commit into
python:masterfrom
gwk:opcode-trace-after-line-update

Conversation

@gwk

@gwk gwk commented Sep 28, 2017

Copy link
Copy Markdown
Contributor

This patch moves the new opcode tracing added in commit 5a85167 to happen after frame->f_lineno is updated. With this patch, when both f_trace_lines and f_trace_opcodes are enabled the trace function will see the same line number for both the 'line' and 'opcode' events.

A side effect of this patch is that the order of event emission has been switched; 'line' now happens before 'opcode'. Maintaining the current order would require more elaborate logic.

https://bugs.python.org/issue31618

@gwk gwk changed the title Move opcode tracing to occur after the possible update to f_lineno. bpo-31618: Move opcode tracing to occur after the possible update to f_lineno. Sep 28, 2017
@gwk

gwk commented Oct 18, 2017

Copy link
Copy Markdown
Contributor Author

@ncoghlan any thoughts on this? I'd really like to begin using the feature on master. Thanks!

@ncoghlan ncoghlan merged commit 20faa68 into python:master Oct 19, 2017
@ncoghlan

Copy link
Copy Markdown
Contributor

Ugh, and having added the "Skip News" label, I just realised that isn't right - this should have its own news entry, because the feature already shipped in the first two alpha releases.

@gwk Would you mind preparing a PR with a suitable NEWS snippet based on what you wrote in the opening PR comment?

@ncoghlan

Copy link
Copy Markdown
Contributor

Thanks for the fix though, and sorry for neglecting the PR for so long :)

@gwk gwk deleted the opcode-trace-after-line-update branch October 19, 2017 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants