diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -946,9 +946,22 @@ auto J = ExitOnErr(Builder.create()); auto *ObjLayer = &J->getObjLinkingLayer(); - if (auto *RTDyldObjLayer = dyn_cast(ObjLayer)) + if (auto *RTDyldObjLayer = dyn_cast(ObjLayer)) { RTDyldObjLayer->registerJITEventListener( *JITEventListener::createGDBRegistrationListener()); +#if LLVM_USE_OPROFILE + RTDyldObjLayer->registerJITEventListener( + *JITEventListener::createOProfileJITEventListener()); +#endif +#if LLVM_USE_INTEL_JITEVENTS + RTDyldObjLayer->registerJITEventListener( + *JITEventListener::createIntelJITEventListener()); +#endif +#if LLVM_USE_PERF + RTDyldObjLayer->registerJITEventListener( + *JITEventListener::createPerfJITEventListener()); +#endif + } if (PerModuleLazy) J->setPartitionFunction(orc::CompileOnDemandLayer::compileWholeModule);