Author: Maciej Fijalkowski <[email protected]>
Branch: even-more-jit-hooks
Changeset: r55970:89681dd1c3b0
Date: 2012-07-07 18:29 +0200
http://bitbucket.org/pypy/pypy/changeset/89681dd1c3b0/
Log: misunderstanding, fix. also fix the test
diff --git a/pypy/jit/metainterp/jitprof.py b/pypy/jit/metainterp/jitprof.py
--- a/pypy/jit/metainterp/jitprof.py
+++ b/pypy/jit/metainterp/jitprof.py
@@ -100,14 +100,14 @@
def get_counter(self, num):
if num == Counters.TOTAL_COMPILED_LOOPS:
- return float(self.cpu.total_compiled_loops)
+ return self.cpu.total_compiled_loops
elif num == Counters.TOTAL_COMPILED_BRIDGES:
- return float(self.cpu.total_compiled_bridges)
+ return self.cpu.total_compiled_bridges
elif num == Counters.TOTAL_FREED_LOOPS:
- return float(self.cpu.total_freed_loops)
+ return self.cpu.total_freed_loops
elif num == Counters.TOTAL_FREED_BRIDGES:
- return float(self.cpu.total_freed_bridges)
- return float(self.counters[num])
+ return self.cpu.total_freed_bridges
+ return self.counters[num]
def count_ops(self, opnum, kind=Counters.OPS):
from pypy.jit.metainterp.resoperation import rop
diff --git a/pypy/jit/metainterp/test/test_jitiface.py
b/pypy/jit/metainterp/test/test_jitiface.py
--- a/pypy/jit/metainterp/test/test_jitiface.py
+++ b/pypy/jit/metainterp/test/test_jitiface.py
@@ -170,7 +170,9 @@
assert jit_hooks.stats_get_counter_value(stats,
Counters.TOTAL_COMPILED_BRIDGES) == 1
assert jit_hooks.stats_get_counter_value(stats,
- Counters.TRACING) >= 0
+ Counters.TRACING) == 2
+ assert jit_hooks.stats_get_times_value(stats,
+ Counters.TRACING) >= 0
self.meta_interp(main, [], ProfilerClass=Profiler)
diff --git a/pypy/jit/metainterp/test/test_jitprof.py
b/pypy/jit/metainterp/test/test_jitprof.py
--- a/pypy/jit/metainterp/test/test_jitprof.py
+++ b/pypy/jit/metainterp/test/test_jitprof.py
@@ -1,9 +1,9 @@
from pypy.jit.metainterp.warmspot import ll_meta_interp
-from pypy.rlib.jit import JitDriver, dont_look_inside, elidable
+from pypy.rlib.jit import JitDriver, dont_look_inside, elidable, Counters
from pypy.jit.metainterp.test.support import LLJitMixin
from pypy.jit.metainterp import pyjitpl
-from pypy.jit.metainterp.jitprof import *
+from pypy.jit.metainterp.jitprof import Profiler
class FakeProfiler(Profiler):
def start(self):
@@ -46,10 +46,10 @@
assert res == 84
profiler = pyjitpl._warmrunnerdesc.metainterp_sd.profiler
expected = [
- TRACING,
- BACKEND,
- ~ BACKEND,
- ~ TRACING,
+ Counters.TRACING,
+ Counters.BACKEND,
+ ~ Counters.BACKEND,
+ ~ Counters.TRACING,
]
assert profiler.events == expected
assert profiler.times == [2, 1]
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit