Mesa (master): gallium: enable intel jitevents profiling

Tim Rowley torowley at kemper.freedesktop.org
Mon May 9 16:29:31 UTC 2016


Module: Mesa
Branch: master
Commit: b65f7ec4507122d2a3f258b7ca7c6809de06f097
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b65f7ec4507122d2a3f258b7ca7c6809de06f097

Author: Tim Rowley <timothy.o.rowley at intel.com>
Date:   Mon Mar 28 14:29:30 2016 -0500

gallium: enable intel jitevents profiling

LLVM when configured with "intel jitevents" enabled can inform
VTune about dynamic code, so individual shaders are attributed
profiling data and the resulting assembly can be examined.

Acked-by: Roland Scheidegger <sroland at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index e47146a..bb08892 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -81,6 +81,11 @@
 #include <llvm/IR/Module.h>
 #include <llvm/Support/CBindingWrapping.h>
 
+#include <llvm/Config/llvm-config.h>
+#if LLVM_USE_INTEL_JITEVENTS
+#include <llvm/ExecutionEngine/JITEventListener.h>
+#endif
+
 // Workaround http://llvm.org/PR23628
 #if HAVE_LLVM >= 0x0307
 #  pragma pop_macro("DEBUG")
@@ -629,6 +634,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
    ExecutionEngine *JIT;
 
    JIT = builder.create();
+#if LLVM_USE_INTEL_JITEVENTS
+   JITEventListener *JEL = JITEventListener::createIntelJITEventListener();
+   JIT->RegisterJITEventListener(JEL);
+#endif
    if (JIT) {
       *OutJIT = wrap(JIT);
       return 0;




More information about the mesa-commit mailing list