This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hagen
Recipients hagen
Date 2009-02-21.13:45:48
SpamBayes Score 5.8760774e-12
Marked as misclassified No
Message-id <1235223951.77.0.503159703189.issue5330@psf.upfronthosting.co.za>
In-reply-to
Content
I found the reason for this problem: C function calls with keyword
arguments follow a different path than those without keywords in the
function "call_function" of ceval.c. They end up being handled by
"do_call", but there the call is not wrapped by C_TRACE, so a profiler
function registered through sys.setprofile() doesn't see such calls.

The same problem occurs in "ext_do_call", which gets called in the
handling of the opcodes CALL_FUNCTION_VAR and CALL_FUNCTION_KW, causing
omission of a function call like

>>> [].sort(**{'reverse':True})

from the profiler report.

The attached patch solves the problem, but I don't know if it's the best
solution. Handling calls with keyword arguments at the beginning of
"call_function" seems to have bigger performance drawbacks though.
History
Date User Action Args
2009-02-21 13:45:51hagensetrecipients: + hagen
2009-02-21 13:45:51hagensetmessageid: <1235223951.77.0.503159703189.issue5330@psf.upfronthosting.co.za>
2009-02-21 13:45:50hagenlinkissue5330 messages
2009-02-21 13:45:49hagencreate