Quantcast
Channel: C#
Viewing all articles
Browse latest Browse all 1853

Building and Managing the Sampling Driver

$
0
0

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, displays an error message, and automatically enables a driverless event-based sampling collection with a limited set of analysis options. But you still may build and load the sampling driver as a root user after product installation and enable a full-scale sampling collection.

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 properly on Linux:

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

  2. Make sure the following options are enabled in the kernel configuration for hardware event-based sampling (EBS) collection:

    • CONFIG_MODULES=y

    • CONFIG_MODULE_UNLOAD=y

    • CONFIG_PROFILING=y

    • CONFIG_OPROFILE=m (or CONFIG_OPROFILE=y)

    • CONFIG_HAVE_OPROFILE=y

  3. Make sure that following options are enabled in the kernel configuration for EBS collection with stacks:

    • CONFIG_MODULES=y

    • CONFIG_SMP=y

    • CONFIG_MODULE_UNLOAD=y

    • CONFIG_KPROBES=y

    • CONFIG_RING_BUFFER=y

    • CONFIG_TRACEPOINTS=y (optional but recommended)

    • CONFIG_FRAME_POINTER=y (optional but recommended for kernel stack analysis)

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.

Inglese

Viewing all articles
Browse latest Browse all 1853

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>