Antonio Cuni  committed b693c61

add a warning in case oprofile has been explicitly enabled but it is not found

  • Participants
  • Parent commits 08c404a

Comments (0)

Files changed (1)

File pypy/jit/backend/x86/

+import py
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
 from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.rpython.llinterp import LLInterpreter
 from pypy.jit.backend.x86 import regloc
 import sys
+from pypy.tool.ansi_print import ansi_log
+log = py.log.Producer('jitbackend')
+py.log.setconsumer('jitbackend', ansi_log)
 class AbstractX86CPU(AbstractLLCPU):
     debug = True
     supports_floats = True
             config = rtyper.annotator.translator.config
             if config.translation.jit_profiler == "oprofile":
                 from pypy.jit.backend.x86 import oprofile
+                if not oprofile.OPROFILE_AVAILABLE:
+                    log.WARNING('oprofile support was explicitly enabled, but oprofile headers seem not to be available')
                 profile_agent = oprofile.OProfileAgent()
         self.profile_agent = profile_agent