[PATCH] D86435: Profiling the code generated by MCJIT engine using Intel VTune profiler

elena via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 02:21:51 PDT 2020


ekovanov created this revision.
ekovanov added reviewers: andrew.w.kaylor, lhames.
Herald added subscribers: llvm-commits, hiraditya, aprantl, mgorny.
Herald added a project: LLVM.
ekovanov requested review of this revision.

Problem:
LLVM already has a feature to profile the JIT-compiled code with VTune. This is done using Intel JIT Profiling API (https://github.com/intel/ittapi). Function information is captured by VTune as soon as the function is JIT-compiled. We tried to use the same approach to report the function information generated by the MCJIT engine – read parsing the debug information for in-memory ELF module and report it using JIT API. As the results, we figured out that it did not work properly for the following cases: inline functions, the functions located in multiple source files, the functions having several bodies (address ranges).

Solution:
To overcome limitations described above, we have introduced new APIs as a part of Intel ITT APIs to report the entire in-memory ELF module to be further processed as regular ELF binaries with debug information.

This patch

1. Switches LLVM to open source version of Intel ITT/JIT APIs ((https://github.com/intel/ittapi) to keep it always up to date
2. Adds support of profiling the code generated by MCJIT engine using Intel VTune profiler

Another separate patch will get rid of obsolete Intel ITT APIs stuff, having LLVM already switched to https://github.com/intel/ittapi

llvm/lib/ExecutionEngine/IntelJITEvents

  ittnotify_config.h
  ittnotify_types.h
  jitprofiling.c
  jitprofiling.h


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86435

Files:
  .gitmodules
  llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
  llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
  llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h
  llvm/lib/ExecutionEngine/IntelJITEvents/ittapi
  llvm/test/IttListener/lit.local.cfg
  llvm/test/IttListener/simple.ll
  llvm/test/JitListener/lit.local.cfg
  llvm/tools/llvm-jitlistener/llvm-jitlistener.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86435.287313.patch
Type: text/x-patch
Size: 26213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/fa53e0af/attachment.bin>


More information about the llvm-commits mailing list