Wind River Support Network

HomeDefectsLIN6-39
Not to be fixed

LIN6-39 : The profile agent can not apply the unit mask which send by the workbench UI.

Created: Dec 2, 2013    Updated: Mar 5, 2016
Resolved Date: Dec 24, 2015
Found In Version: 6.0
Severity: Severe
Applicable for: Wind River Linux 6
Component/s: Analysis

Description

The user can select sub-categories of a performance monitor event when running oprofile from either the command line or via workbench.  For example, for the dell390n or any target that identifies itself to oprofile (/dev/oprofile/cpu_type) as i386/core_2 the events listed for this processor using 'ophelp -d' show
RESOURCE_STALLS: (counter: all)
        Cycles during which resource stalls occur (min count: 3000)
        Unit masks (default 0xf)
        ----------
        0x01: when the ROB is full
        0x02: during which the RS is full
        0x04: during which the pipeline has exceeded the load or store limit or
              commit all stores
        0x08: due to FPU control word write
        0x10: due to branch misprediction
This means that when oprofle is started like:
   /usr/bin/opcontrol --start -e RESOURCE_STALLS:45000:31:1:1
then the PMU events register is set to the numeric value of RESOURCE_STALLS and the mask is set to all of the options, 0x1f or 31 in decimal.

This command works from the command line.  

In workbench, to change an event and it's options:
Click on "Open the dialog to modify the prefernces for the current profile data editor" in a running profiler view.
For the core_2, select RESOURCE_STALLS and then click Configure
You correctly see all 5 options.  However, if you select the last option, it is incorrectly passed to the target in the next opcontrol --start command as 
/usr/bin/opcontrol --start --enhanced-backtrace -e RESOURCE_STALLS:45000:15:1:1
the '16' bit is always downsized to '15'.

This can be noticed by changing the event and masks as noted above and then either
   cat /dev/oprofile/0/unit_mask
or FIRST change /usr/bin/opcontrol  to log the arguments to it's call ay adding
.   echo $0 $* >> /root/opcontrol_args.txt
as the first line.
.

Steps to Reproduce

configure --enable-board=intel-x86-64 --enable-rootfs=glibc-small --enable-build=profiling --with-template=feature/analysis,feature/debug
Edit the file bitbake/conf/local.conf
    Add to the end (for backwards compatibility with the wrlinux 5 version)
    PREFERRED_VERSION_oprofile = "0.9.8"

make fs
deploy to a dell390n target (one is in the vlm DFWZone).
Follow the instructions in Symptom Details
Live chat
Online