Commits

Maciej Fijalkowski  committed 89681dd Draft

misunderstanding, fix. also fix the test

  • Participants
  • Parent commits 87726e7
  • Branches even-more-jit-hooks

Comments (0)

Files changed (3)

File pypy/jit/metainterp/jitprof.py

 
     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

File pypy/jit/metainterp/test/test_jitiface.py

             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)
 

File pypy/jit/metainterp/test/test_jitprof.py

 
 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):
         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]