Building and Managing the Sampling Driver

Intel® VTune™ Amplifier uses a sampling driver to enable the hardware event-based sampling analysis. The sampling driver is installed by default during product installation.

If the driver was not properly installed or unavailable for the current system, the VTune Amplifier cannot run a hardware event-based sampling analysis type and displays an error message.

To verify the sampling driver is installed correctly on a Microsoft Windows* OS:

Open the command prompt as an administrator and run the amplxe-sepreg utility located at <install_dir>\bin32 .

Note

The default installation path for the VTune Amplifier XE is [Program Files]\Intel\VTune Amplifier XE <version>. For the VTune Amplifier for Systems, the installation path is [Program Files]\Intel\System Studio <version>\VTune Amplifier <version> for Systems.

To make sure your system meets all the requirements necessary for the hardware event-based sampling collection, enter:

> amplxe-sepreg -c

This command performs the following dependency checks required to install the sampling driver:

  • platform, architecture, and OS environment

  • availability of the sampling driver binaries: sep3drv.sys and sepdal.sys

  • administrative privileges

  • 32/64-bit installation

To check whether the sampling driver is loaded, enter:

> amplxe-sepreg -s

If the sampling driver is not installed but the system is supported by the VTune Amplifier, execute the following command with the administrative privileges to install the driver:

> amplxe-sepreg -i

To verify the sampling driver is installed correctly on a Linux* OS:

Note

The default installation path for the VTune Amplifier XE is /opt/intel/vtune_amplifier_xe_<version>. For the VTune Amplifier for Systems, the installation path is /opt/intel/system_studio_<version>/vtune_amplifier_<version>_for_systems.

  1. Run the following commands to check whether the product drivers are installed:

    > cd <install_dir>/sepdk/src

    > ./insmod-sep3 -q

    This provides information on whether the drivers are currently loaded and, if so, what the group ownership and file permissions are on the driver devices.

  2. If drivers are loaded, but you are not a member of the group listed in the query output, request your system administrator to add you to the group. To check which groups you belong to, type groups at the command line.
  3. If the drivers are missing, build them for your kernel as follows:

    > cd <install_dir>/sepdk/src

    > ./build-driver -ni --install-dir=../src

    If you are building a driver for an embedded platform, for example, with Yocto* 1.2 build of the fri2-noemgd board support package, your build command may look like the following:

    > ./build-driver -ni --c-compiler=i586-poky-linux-gcc \
    --kernel-src-dir=~/yocto/poky-denzil-7.0/build/tmp/work/fri2_noemgd-poky-linux/linux-yocto-3.2.11+git1+5b4c9dc78b5ae607173cc3ddab9bce1b5f78129b_1+76dc683eccc46804729a76b9d2fd425ba540a483-r1/linux-fri2-noemgd-standard-build \
    --kernel-version=3.2.18-yocto-standard \
    --make-args="PLATFORM=x32 ARITY=smp" \
    --install-dir=../src
    

    Note

    • To find the kernel-version, explore:

      >kernel-src-dir/include/linux/utsrelease.h

      or, depending on the kernel version:

      >kernel-src-dir/include/generated/utsrelease.h

    • To build the driver with the per-user event-based sampling collection on, use the -pu (-per-user) option as follows:

      > ./build-driver -ni -pu --install-dir=../src

  4. If building the drivers fails, check to make sure proper kernel build environment is present. See <install_dir>/sepdk/src/README.txt for details.
  5. If building the drivers succeeds, load them manually:

    > cd <install_dir>/sepdk/src

    > ./insmod-sep3 -r -g <group>

    where <group> is one of the groups you are a member of.

    Note

    To install the driver that is built with the per-user event-based sampling collection on, use the -pu (-per-user) option as follows:

    > ./insmod-sep3 -g <group> -pu

  6. To have the Linux system automatically load the drivers at boot time, run:

    > cd <install_dir>/sepdk/src

    > ./boot-script --install -g <group>

    where <group> is one of the groups you are a member of.

To remove the driver on a Linux system, run:

./rmmod-sep3 -s

To verify the sampling driver is configured for stack collection on Linux:

  1. Make sure the kernel version is 2.6.28 or later.

  2. Make sure that following options are enabled in the kernel configuration:

    • CONFIG_MODULES=y

    • CONFIG_SMP=y

    • CONFIG_MODULE_UNLOAD=y

    • CONFIG_KPROBES=y

    • CONFIG_RING_BUFFER=y

  3. Optionally, enable the following option:

To build the sampling driver as RPM using build services as Open Build Service (OBS):

use the sepdk.spec file located at the <install_dir>/sepdk/src directory.

如需更全面地了解编译器优化,请参阅优化注意事项