User Guide

  • 2020
  • 06/18/2020
  • Public Content
Contents

Using JIT Profiling API

To include JIT Profiling support, do one of the following:
  • Include the following files to your source tree:
    • jitprofiling.h
      , located under
      <install-dir>\include
      (Windows*) or
      <install-dir>/include
      (Linux*)
    • ittnotify_config.h
      ,
      ittnotify_types.h
      and
      jitprofiling.c
      , located under
      <install-dir>\sdk\src\ittnotify
      (Windows*) or
      <install-dir>/sdk/src/ittnotify
      (Linux*)
    The default installation path for the VTune
    Profiler
    varies with the product shipment:
  • Use the static library provided with the product:
    1. Include
      jitprofiling.h
      file, located under the
      <install-dir>\include
      (Windows*) or
      <install-dir>/include
      (Linux*) directory, in your code. This header file provides all API function prototypes and type definitions.
    2. Link to
      jitprofiling.lib
      (Windows*) or
      jitprofiling.a
      (Linux*), located under
      <install-dir>\lib32
      or
      <install-dir>\lib64
      (Windows*) or
      <install-dir>/lib32
      or
      <install-dir>/lib32
      (Linux*).
Use This Primitive
To Do This
int iJIT_NotifyEvent( iJIT_JVM_EVENT event_type, void *EventSpecificData );
Use this API to send a notification of
event_type
with the data pointed by
EventSpecificData
to the agent. The reported information is used to attribute samples obtained from any
Intel® VTune™
Profiler
collector.
unsigned int iJIT_GetNewMethodID( void );
Generate a new method ID. You must use this function to assign unique and valid method IDs to methods reported to the profiler.
This API returns a new unique method ID. When out of unique method IDs, this API function returns 0.
iJIT_IsProfilingActiveFlags iJIT_IsProfilingActive( void );
Returns the current mode of the profiler: off, or sampling, using the
iJIT_IsProfilingActiveFlags
enumeration.
This API returns
iJIT_SAMPLING_ON
by default, indicating that Sampling is running. It returns
iJIT_NOTHING_RUNNING
if no profiler is running.

Lifetime of Allocated Data

You send an event notification to the agent (
VTune
Profiler
) with event-specific data, which is a structure. The pointers in the structure refer to memory you allocated and you are responsible for releasing it. The pointers are used by the
iJIT_NotifyEvent
method to copy your data in a trace file, and they are not used after the
iJIT_NotifyEvent
method returns.

JIT Profiling API Sample Application

VTune
Profiler
is installed with a sample application in the
jitprofiling_vtune_amp_xe.zip
(Windows*) or
jitprofiling_vtune_amp_xe.tgz
(Linux*) that emulates the creation and execution of dynamic code. In addition, it uses the JIT profiling API to notify the
VTune
Profiler
when it transfers execution control to dynamic code.
To install and set up the sample code:
  1. Copy the
    jitprofiling_vtune_amp_xe.zip
    (Windows*) or
    jitprofiling_vtune_amp_xe.tgz
    (Linux*) file from the
    <install-dir>\samples\<locale>\C++
    (Windows*) or
    <install-dir>/samples/<locale>/C++
    (Linux*)directory to a writable directory or share on your system.
  2. Extract the sample from the archive file.

Build jitprofiling.c in Microsoft Visual Studio*

  1. Copy the
    jitprofiling_vtune_amp_xe.zip
    file from the
    <install-dir>\samples\<locale>\C++
    directory to a writable directory or share on your system.
  2. Extract the sample from the
    .zip
    file.
  3. Open the
    jitprofiling.sln
    file with Microsoft Visual Studio.
  4. Right-click
    jitprofiling
    in the
    Solution Explorer
    and select
    Properties
    . The
    jitprofiling Property Pages
    window opens.
  5. Set the
    Platform
    (top of the window) to
    x64
    .
  6. Select
    Configuration Properties
    C/C++
    General
    and add the path to the headers (
    <install-dir>
    /include
    ) to
    Additional Include Directories
    .
  7. Select
    Configuration Properties
    C/C++
    Linker
    General
    and add the path to the library (
    <install-dir>
    /lib32
    or
    <install-dir>
    /lib64
    ) to
    Additional Library Directories
    .
  8. Click
    OK
    to apply the changes and close the window.
  9. Rebuild the solution with the new project settings.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804