Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5106 Discussions

Jit profiling api doc for Amplifier XE

David_Blair
Beginner
1,004 Views
I cannot find documentation for how to use the JIT profiling APIs in Amplifier (specifically for Linux). The header and libraries are installed but there is nothing in the doc set to indicate what has to be done when setting up an activity to enable the profiling of the registered JIT'd methods. There is a document available for VTune 9.x (http://software.intel.com/file/6737) but I haven't found anything available for VTune Amplifier XE 2011. This question was asked during the beta program but the answer apparently went into a private thread.
0 Kudos
4 Replies
Eric_M_Intel2
Employee
1,004 Views
The documentation for the JIT Profiling API was addedto the help files inUpdate 1 of Intel VTune Amplifier XE 2011 for Linux. you can get the updated files at: https://registrationcenter.intel.com/regcenter/Download.aspx?productid=1384&sn=

Regards,
Eric M
0 Kudos
David_Blair
Beginner
1,004 Views
I see that I actually have update 1 already. The help seems to have the API info that was included in VTune 9.x but makes no mention about how to configure analysis (e.g. through amplxe-cl) to include JIT'd methods. There were special command line flags required back in VTune 9.x. I have implemented the appropriate APIs in my code but am not seeing JIT'd methods show up in the report (a bunch of time reported as being in unknown module is likely the JIT'd stuff). Is this just pilot error on my part or is it possible that there are actually command line args that need to be provided?

Thx,
David
0 Kudos
Eric_M_Intel2
Employee
1,004 Views

There are no special command line switches. I have succesfully run VTune Amplifier XE 2011 u1on applications instrumented with the User mode API's.

The only tissues I can think of...

1) You must compile and link against the headers and Libraries in VTune Amplifier XE 2011 u1 (you can't use the headers and libraries supplied with the old version of VTune 9.1)

2) Hardware Event-based Sampling works with the JIT API (Lightweight Hotspots & Advanced Processor Analysis) - but, User-mode Sampling and Tracing Analysis (Hotspots, Concurrency, and Locks and WaitsAnalysis) does not support the JIT API yet.

The Sample Code that ships with VTune 9.1 works with VTune Amplifier XE 2011 u1. Note: This sample points to the wrong Headers and Libs for the JIT API - the project settingsneed to be modified to point to the updated locations in VTune Amplifier XE 2011 u1.

Regards,
Eric M

0 Kudos
zzxxccvv
Beginner
1,004 Views

I've been struggling with this tonight too. Iupdated to VTune Amplifier XE 2011 u1, set the ENABLE_JITPROFILING=1 environment variable (is that still necessary?), and ran a lightweight hotspot analysis, but the JIT symbols aren't coming up in the report. I tried both the GUI and the command-line"amplxe-cl -collect lightweight-hotspots test.exe" with various variations of the belowminimal sample code.

[bash]













#include #include #include iJIT_Method_Load jmethod = {0}; iJIT_Method_NIDS method1, method2; int x = 0; void test1(void) { int i; iJIT_NotifyEvent(iJVM_EVENT_TYPE_ENTER_NIDS, (void*)&method1); for (i=0; i<100000000; i++) x++; iJIT_NotifyEvent(iJVM_EVENT_TYPE_LEAVE_NIDS, (void*)&method1); } void test2(void) { int i; iJIT_NotifyEvent(iJVM_EVENT_TYPE_ENTER_NIDS, (void*)&method2); for (i=0; i<100000000; i++) x++; test1(); iJIT_NotifyEvent(iJVM_EVENT_TYPE_LEAVE_NIDS, (void*)&method2); } int main() { int i; if (iJIT_IsProfilingActive() != iJIT_SAMPLING_ON) { printf("warning: not being profiledn"); } method1.method_id = 0x100000; method2.method_id = 0x100001; method1.method_name = "TeSt1"; method2.method_name = "TeSt2"; jmethod.method_id = method1.method_id; jmethod.method_name = "TeSt1"; jmethod.class_file_name = "JITter"; jmethod.source_file_name = "jitter.cpp"; jmethod.method_load_address = test1; jmethod.method_size = 1000; iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod); jmethod.method_id = method2.method_id; jmethod.method_name = "TeSt2"; jmethod.method_load_address = test2; iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod); for (i=0; i<100; i++) { printf("%dn", i); test1(); test2(); } printf("x=%dn", x); iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, NULL);
return 0; }



[/bash]
0 Kudos
Reply