Using repr() generates entries that the current stats package can't

collate, so setting it back to the function name
This commit is contained in:
Nicholas Bastin 2004-07-12 23:38:02 +00:00
parent b1027643d5
commit 12ac3e1f49
2 changed files with 7 additions and 7 deletions

View file

@ -216,7 +216,7 @@ def trace_dispatch(self, frame, event, arg):
t = t[0] + t[1] - self.t - self.bias
if event == "c_call":
self.c_func_name = repr(arg)
self.c_func_name = arg.__name__
if self.dispatch[event](self, frame,t):
t = timer()
@ -233,7 +233,7 @@ def trace_dispatch_i(self, frame, event, arg):
t = timer() - self.t - self.bias
if event == "c_call":
self.c_func_name = repr(arg)
self.c_func_name = arg.__name__
if self.dispatch[event](self, frame, t):
self.t = timer()
@ -248,7 +248,7 @@ def trace_dispatch_mac(self, frame, event, arg):
t = timer()/60.0 - self.t - self.bias
if event == "c_call":
self.c_func_name = repr(arg)
self.c_func_name = arg.__name__
if self.dispatch[event](self, frame, t):
self.t = timer()/60.0
@ -262,7 +262,7 @@ def trace_dispatch_l(self, frame, event, arg):
t = get_time() - self.t - self.bias
if event == "c_call":
self.c_func_name = repr(arg)
self.c_func_name = arg.__name__
if self.dispatch[event](self, frame, t):
self.t = get_time()

View file

@ -4,9 +4,9 @@ test_profile
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
12 0.000 0.000 0.012 0.001 :0(<built-in function hasattr>)
8 0.000 0.000 0.000 0.000 :0(<built-in function range>)
1 0.000 0.000 0.000 0.000 :0(<built-in function setprofile>)
12 0.000 0.000 0.012 0.001 :0(hasattr)
8 0.000 0.000 0.000 0.000 :0(range)
1 0.000 0.000 0.000 0.000 :0(setprofile)
1 0.000 0.000 1.000 1.000 <string>:1(?)
0 0.000 0.000 profile:0(profiler)
1 0.000 0.000 1.000 1.000 profile:0(testfunc())