Skip to content

bpo-29676: fix lsprof can't profile C method call.#523

Merged
methane merged 1 commit into
python:masterfrom
methane:trace-loadmethod
Mar 7, 2017
Merged

bpo-29676: fix lsprof can't profile C method call.#523
methane merged 1 commit into
python:masterfrom
methane:trace-loadmethod

Conversation

@methane

@methane methane commented Mar 6, 2017

Copy link
Copy Markdown
Member

When LOAD_METHOD is used for calling C mehtod, PyMethodDescrObject
was passed to profilefunc from 5566bbb.
But lsprof traces only PyCFunctionObject. Additionally, there can be
some third party extensions which assumes passed arg is
PyCFunctionObject without calling PyCFunction_Check().

So make PyCFunctionObject from PyMethodDescrObject when
tstate->c_profilefunc is set.

@mention-bot

Copy link
Copy Markdown

@methane, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @Haypo, @serhiy-storchaka, @1st1 and @tim-one to be potential reviewers.

@1st1 1st1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

When LOAD_METHOD is used for calling C mehtod, PyMethodDescrObject
was passed to profilefunc from 5566bbb.
But lsprof traces only PyCFunctionObject. Additionally, there can be
some third party extension which assumes passed arg is
PyCFunctionObject without calling PyCFunction_Check().

So make PyCFunctionObject from PyMethodDescrObject when
tstate->c_profilefunc is set.
@methane methane force-pushed the trace-loadmethod branch from 97039af to cded9bd Compare March 7, 2017 04:15
@methane methane merged commit 93fac8d into python:master Mar 7, 2017
@methane methane deleted the trace-loadmethod branch March 7, 2017 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants