We use the JIT Profiling API to be able to see dynamically generated code in the profile. This works well when the process is started by VTune. However, it does not work for an already running process, e.g., with the --target-pid argument.
It appears that iJIT_IsProfilingActive() returns iJIT_NOTHING_RUNNING in that case. I am sure that this function was called after the profiler has attached to the process.
Is it a supported scenario use the JIT profiling API for attached processes? Thanks.
Have you tried setting the INTEL_LIBITTNOTIFY64 environment variable to the location of libittnotify_collector.so before launching the application? More information here:
Setting INTEL_LIBITNOTIFY64 did not help.
However, this led me to looking into other variables that VTune sets in the launched application and I found that setting INTEL_JIT_PROFILER64 actually makes the JIT interface to work on an attached process!
I will do some additional testing, but it seems to work on a simple application, at least.