classification
Title: Profiling depends on whether **kwargs is given
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jdemeyer, miss-islington, rbcollins, vstinner
Priority: normal Keywords: patch

Created on 2018-07-16 17:16 by jdemeyer, last changed 2019-05-22 10:05 by rbcollins. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8416 merged jdemeyer, 2018-07-23 14:44
Messages (5)
msg321746 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2018-07-16 17:16
Enable profiling for C functions:

    >>> def prof(frame, typ, arg):
    ...     if typ.startswith("c_"):
    ...         print(arg, typ)
    >>> import sys; sys.setprofile(prof)

and notice how profiling depends on **kwargs:

    >>> list.append([], None)
    <built-in method append of list object at 0x7f52da2a2dd0> c_call
    <built-in method append of list object at 0x7f52da2a2dd0> c_return
    
    >>> list.append([], None, **{})

There is no specification of what should be profiled and what not, so it's not clear what is the "correct" behavior. For the record: in Python 3.6, neither of these were profiled.
msg322784 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-31 15:20
I opened a wider discussion: bpo-29502. The discussion didn't go anywhere yet.
msg325740 - (view) Author: miss-islington (miss-islington) Date: 2018-09-19 10:06
New changeset e89de7398718f6e68848b6340830aeb90b7d582c by Miss Islington (bot) (jdemeyer) in branch 'master':
bpo-34125: Enable profiling of method_descriptor in all cases (GH-8416)
https://github.com/python/cpython/commit/e89de7398718f6e68848b6340830aeb90b7d582c
msg343162 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-22 09:40
This is missing a testcase: PR 13461
msg343165 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2019-05-22 10:05
New changeset b892d3ea468101d35e2fb081002fa693bd86eca9 by Robert Collins (Jeroen Demeyer) in branch 'master':
bpo-36994: add test for profiling method_descriptor with **kwargs (GH-13461)
https://github.com/python/cpython/commit/b892d3ea468101d35e2fb081002fa693bd86eca9
History
Date User Action Args
2019-05-22 10:05:14rbcollinssetnosy: + rbcollins
messages: + msg343165
2019-05-22 09:40:57jdemeyersetmessages: + msg343162
2018-09-20 10:04:04jdemeyersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-09-19 10:06:32miss-islingtonsetnosy: + miss-islington
messages: + msg325740
2018-07-31 15:20:22vstinnersetnosy: + vstinner
messages: + msg322784
2018-07-23 14:44:26jdemeyersetkeywords: + patch
stage: patch review
pull_requests: + pull_request7942
2018-07-16 17:16:00jdemeyercreate