[New-bugs-announce] [issue5330] profile and cProfile do not report C functions called with keyword arguments
Hagen Fürstenau
report at bugs.python.org
Fri Feb 20 14:10:20 CET 2009
New submission from Hagen Fürstenau <hfuerstenau at gmx.net>:
A C function or method call without keyword arguments gets reported by
the profiler as expected (in the line with "{method 'sort' of 'list'
object}"):
>>> cProfile.run("[].sort()")
4 function calls in 0.000 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.000 0.000 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 {built-in method exec}
1 0.000 0.000 0.000 0.000 {method 'disable' of
'_lsprof.Profiler' objects}
1 0.000 0.000 0.000 0.000 {method 'sort' of 'list'
objects}
However, once a keyword argument is given, the relevant line is missing:
>>> cProfile.run("[].sort(reverse=True)")
3 function calls in 0.000 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.000 0.000 <string>:1(<module>)
1 0.000 0.000 0.000 0.000 {built-in method exec}
1 0.000 0.000 0.000 0.000 {method 'disable' of
'_lsprof.Profiler' objects}
This happens with profile and cProfile in 2.6 and 3.0.
----------
components: Library (Lib)
messages: 82530
nosy: hagen
severity: normal
status: open
title: profile and cProfile do not report C functions called with keyword arguments
type: behavior
versions: Python 2.6, Python 3.0
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5330>
_______________________________________
More information about the New-bugs-announce
mailing list