Building and Managing the Sampling Driver

To verify the sampling driver is installed correctly:

  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* OS 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, run:

./rmmod-sep3 -s

To verify the sampling driver is configured for stack collection:

  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

  3. Optionally, enable the following option (recommended):

    • CONFIG_TRACEPOINTS=y

See Also


Submit feedback on this help topic

Studio-specific supplemental documentation may be available at <install-dir>/<studio>/documentation/.