Hello,

The output of  /bin/sh -x /usr/bin/opcontrol --start is as follows:

Using default event: CPU_CLK_UNHALTED:100000:0:1:1

Using 2.6+ OProfile kernel interface.

Reading module info.

+ SYSCTL=do_sysctl

+ OBJDUMP=objdump

+ test -z ''

+ BINDIR=/usr/bin

++ /usr/bin/which /usr/bin/opcontrol

+ OPCONTROL=/usr/bin/opcontrol

++ /usr/bin/dirname /usr/bin/opcontrol

+ OPDIR=/usr/bin

+ PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

+ check_options_early --start

+ OPHELP=/usr/bin/ophelp

+ for i in '$@'

++ printf %s --start

++ awk -F= '{print $1}'

+ arg=--start

++ printf %s --start

++ awk -F= '{print $2}'

+ val=

+ case "$arg" in

+ test -z --start

++ id -u

+ test 0 = 0

+ load_module

+ OPROFILE_AVAILABLE=no

+ load_module_26

+ grep oprofilefs /proc/filesystems

+ test 0 -ne 0

+ mkdir /dev/oprofile

+ grep oprofilefs /etc/mtab

+ test 0 -ne 0

+ KERNEL_SUPPORT=yes

+ OPROFILE_AVAILABLE=yes

+ test yes '!=' yes

+ test yes '!=' yes

+ check_version

+ OPROFILE_AVAILABLE=no

+ grep oprofilefs /etc/mtab

+ test 0 -eq 0

+ KERNEL_SUPPORT=yes

+ OPROFILE_AVAILABLE=yes

+ return

+ do_init

+ BUF_SIZE=0

+ BUF_WATERSHED=0

+ CPU_BUF_SIZE=0

+ NOTE_SIZE=0

+ VMLINUX=

+ XENIMAGE=none

+ VERBOSE=

+ SEPARATE_LIB=0

+ SEPARATE_KERNEL=0

+ SEPARATE_THREAD=0

+ SEPARATE_CPU=0

+ CALLGRAPH=0

+ OPROFILED=/usr/bin/oprofiled

+ SETUP_DIR=/etc/oprofile

+ SETUP_FILE=/etc/oprofile/daemonrc

+ decide_oprofile_device_mount

+ test yes = yes

+ MOUNT=/dev/oprofile

++ cat /dev/oprofile/cpu_type

+ CPUTYPE=i386/piii

++ ls /dev/oprofile/

++ grep '^[0-9]\+$'

++ tr '\n' ' '

+ OP_COUNTERS='0 1 '

+ NR_CHOSEN=0

+ do_init_daemon_vars

+ test -n ''

+ do_load_setup

+ test -f /etc/oprofile/daemonrc

+ . /etc/oprofile/daemonrc

++ SESSION_DIR=/var/lib/oprofile

++ NR_CHOSEN=0

++ SEPARATE_LIB=0

++ SEPARATE_KERNEL=0

++ SEPARATE_THREAD=0

++ SEPARATE_CPU=0

++ VMLINUX=vmlinux

++ IMAGE_FILTER=

++ CPU_BUF_SIZE=0

++ CALLGRAPH=0

++ KERNEL_RANGE=ffffffff80200000,ffffffff80266330

++ XENIMAGE=none

+ test -n ''

+ test -z /var/lib/oprofile

+ LOCK_FILE=/var/lib/oprofile/lock

+ SAMPLES_DIR=/var/lib/oprofile/samples

+ LOG_FILE=/var/lib/oprofile/samples/oprofiled.log

+ CURRENT_SAMPLES_DIR=/var/lib/oprofile/samples/current

+ decide_oprofile_device

+ test yes = yes

+ DEVICE_FILE=/dev/oprofile/buffer

++ /usr/bin/ophelp --get-default-event

+ DEFAULT_EVENT=CPU_CLK_UNHALTED:100000:0:1:1

+ IS_TIMER=0

+ IS_PERFMON=0

+ test i386/piii = timer

+ case "$CPUTYPE" in

+ vecho 'Parameters used:'

+ test -n ''

+ vecho 'SESSION_DIR /var/lib/oprofile'

+ test -n ''

+ vecho 'LOCK_FILE   /var/lib/oprofile/lock'

+ test -n ''

+ vecho 'SAMPLES_DIR /var/lib/oprofile/samples'

+ test -n ''

+ vecho 'CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current'

+ test -n ''

+ vecho 'CPUTYPE i386/piii'

+ test -n ''

+ test 0 '!=' 0

+ vecho 'BUF_SIZE default value'

+ test -n ''

+ test 0 '!=' 0

+ vecho 'BUF_WATERSHED default value'

+ test -n ''

+ test yes = yes

+ test 0 '!=' 0

+ vecho 'CPU_BUF_SIZE default value'

+ test -n ''

+ vecho 'SEPARATE_LIB 0'

+ test -n ''

+ vecho 'SEPARATE_KERNEL 0'

+ test -n ''

+ vecho 'SEPARATE_THREAD 0'

+ test -n ''

+ vecho 'SEPARATE_CPU 0'

+ test -n ''

+ vecho 'CALLGRAPH 0'

+ test -n ''

+ vecho 'VMLINUX vmlinux'

+ test -n ''

+ vecho 'KERNEL_RANGE ffffffff80200000,ffffffff80266330'

+ test -n ''

+ vecho 'XENIMAGE none'

+ test -n ''

+ vecho 'XEN_RANGE '

+ test -n ''

++ id -u

+ test 0 '!=' 0

+ do_options --start

+ EXCLUSIVE_ARGC=0

+ SETUP=no

+ NEED_SETUP=no

+ SEEN_EVENT=0

+ '[' 1 -ne 0 ']'

++ printf %s --start

++ awk -F= '{print $1}'

+ arg=--start

++ printf %s --start

++ awk -F= '{print $2}'

+ val=

+ shift

+ test -z ''

+ local possibleval=

+ printf %s ''

+ grep '^-'

+ test 1 '!=' 0

+ val=

+ '[' 0 -ge 1 ']'

+ case "$arg" in

+ START=yes

++ expr 0 + 1

+ EXCLUSIVE_ARGC=1

+ EXCLUSIVE_ARGV=--start

+ '[' 0 -ne 0 ']'

+ normalise_events

+ test 0 -le 0

+ return

+ verify_counters

+ test 0 = 1

+ OPHELP_ARGS=

+ test 0 '!=' 0

+ test 1 -gt 1

+ test no = yes -a '' '!=' yes

+ test -n ''

+ test '' = yes

+ test 1 -eq 1 -a no = yes

+ do_operations

+ test '' = yes

+ test no = yes

+ test '' = yes

+ test yes = yes

+ do_start_daemon

+ test -f /var/lib/oprofile/lock

+ do_setup

+ create_dir /var/lib/oprofile

+ test '!' -d /var/lib/oprofile

+ test yes '!=' yes

+ create_dir /var/lib/oprofile/samples/current

+ test '!' -d /var/lib/oprofile/samples/current

+ check_valid_args

+ test -z vmlinux

+ test -f vmlinux

+ return

+ get_image_range linux

+ test linux = xen

+ test '!' -z ffffffff80200000,ffffffff80266330

+ return

+ get_image_range xen

+ test xen = xen

+ test '!' -z ''

+ FILE_IMAGE=none

+ test none = none

+ return

+ do_param_setup

+ test 0 '!=' 0

+ test 0 '!=' 0

+ test 0 '!=' 0

+ test -n ''

+ test 0 '!=' 0

+ test yes = yes -a -f /dev/oprofile/backtrace_depth

+ set_param backtrace_depth 0

+ test yes = yes

+ echo 0

/usr/bin/opcontrol: line 1016: echo: write error: Invalid argument

+ test 0 = 1

+ test 0 = 0

+ set_event 0 CPU_CLK_UNHALTED:100000:0:1:1

+ eval CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1

++ CHOSEN_EVENTS_0=CPU_CLK_UNHALTED:100000:0:1:1

+ NR_CHOSEN=1

++ /usr/bin/ophelp --check-events CPU_CLK_UNHALTED:100000:0:1:1 --callgraph=0

+ HW_CTRS='0 '

+ echo 'Using default event: CPU_CLK_UNHALTED:100000:0:1:1'

Using default event: CPU_CLK_UNHALTED:100000:0:1:1

+ for f in '$OP_COUNTERS'

+ set_ctr_param 0 enabled 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 0 event 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 0 count 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ for f in '$OP_COUNTERS'

+ set_ctr_param 1 enabled 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 1 event 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ set_ctr_param 1 count 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ verify_counters

+ test 0 = 1

+ OPHELP_ARGS=

+ test 1 '!=' 0

++ seq 0 0

+ for f in '`seq 0 $(($NR_CHOSEN - 1))`'

+ get_event 0

++ eval 'echo $CHOSEN_EVENTS_0'

+++ echo CPU_CLK_UNHALTED:100000:0:1:1

+ GOTEVENT=CPU_CLK_UNHALTED:100000:0:1:1

+ test CPU_CLK_UNHALTED:100000:0:1:1 '!=' ''

+ OPHELP_ARGS=' CPU_CLK_UNHALTED:100000:0:1:1'

++ /usr/bin/ophelp --check-events CPU_CLK_UNHALTED:100000:0:1:1 --callgraph=0

+ HW_CTRS='0 '

+ test 0 '!=' 0

+ OPROFILED_EVENTS=

++ seq 0 0

+ for f in '`seq 0 $(($NR_CHOSEN - 1))`'

+ get_event 0

++ eval 'echo $CHOSEN_EVENTS_0'

+++ echo CPU_CLK_UNHALTED:100000:0:1:1

+ GOTEVENT=CPU_CLK_UNHALTED:100000:0:1:1

+ test CPU_CLK_UNHALTED:100000:0:1:1 '!=' ''

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $1}'

+ EVENT=CPU_CLK_UNHALTED

++ /usr/bin/ophelp CPU_CLK_UNHALTED

+ EVENT_STR=121

+ check_event_mapping_data

+ is_non_cell_ppc64_variant i386/piii

+ case "$1" in

+ return 0

+ test 0 -ne 0

+ '[' i386/piii = ppc64/cell-be ']'

++ echo 121

++ awk '{print $1}'

+ EVENT_VAL=121

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $2}'

+ COUNT=100000

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $3}'

+ UNIT_MASK=0

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $4}'

+ KERNEL=1

++ echo CPU_CLK_UNHALTED:100000:0:1:1

++ awk -F: '{print $5}'

+ USER=1

++ echo 0

++ awk '{print $1}'

+ CTR=0

+ test CPU_CLK_UNHALTED = SPU_CYCLES

+ test CPU_CLK_UNHALTED = RTC_INTERRUPTS

+ set_ctr_param 0 enabled 1

+ test 0 = yes

+ test yes = yes

+ echo 1

+ set_ctr_param 0 event 121

+ test 0 = yes

+ test yes = yes

+ echo 121

+ loop_count=1

+ for i in '${EVENT_STR}'

+ test 1 -gt 1

+ loop_count=2

+ set_ctr_param 0 count 100000

+ test 0 = yes

+ test yes = yes

+ echo 100000

+ set_ctr_param 0 kernel 1

+ test 0 = yes

+ test yes = yes

+ echo 1

+ set_ctr_param 0 user 1

+ test 0 = yes

+ test yes = yes

+ echo 1

+ set_ctr_param 0 unit_mask 0

+ test 0 = yes

+ test yes = yes

+ echo 0

+ OPROFILED_EVENTS=CPU_CLK_UNHALTED:121:

+ OPROFILED_EVENTS=CPU_CLK_UNHALTED:121:0:100000:0:

+ OPROFILED_EVENTS=CPU_CLK_UNHALTED:121:0:100000:0:1:1,

+ OPD_ARGS='            --session-dir=/var/lib/oprofile           --separate-lib=0        --separate-kernel=0             --separate-thread=0           --separate-cpu=0'

+ OPD_ARGS='            --session-dir=/var/lib/oprofile           --separate-lib=0        --separate-kernel=0             --separate-thread=0           --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1,'

+ test vmlinux = none

+ OPD_ARGS='            --session-dir=/var/lib/oprofile           --separate-lib=0        --separate-kernel=0             --separate-thread=0           --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux --kernel-range=ffffffff80200000,ffffffff80266330'

+ test none = none

+ test -z ''

+ test -n ''

+ vecho 'executing oprofiled              --session-dir=/var/lib/oprofile           --separate-lib=0          --separate-kernel=0           --separate-thread=0           --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux --kernel-range=ffffffff80200000,ffffffff80266330'

+ test -n ''

+ /usr/bin/oprofiled --session-dir=/var/lib/oprofile --separate-lib=0 --separate-kernel=0 --separate-thread=0 --separate-cpu=0 --events=CPU_CLK_UNHALTED:121:0:100000:0:1:1, --vmlinux=vmlinux --kernel-range=ffffffff80200000,ffffffff80266330

Failed to open profile device: Operation not permitted

Using 2.6+ OProfile kernel interface.

Reading module info.

+ COUNT=0

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 0 + 1

+ COUNT=1

+ test 1 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 1 + 1

+ COUNT=2

+ test 2 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 2 + 1

+ COUNT=3

+ test 3 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 3 + 1

+ COUNT=4

+ test 4 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 4 + 1

+ COUNT=5

+ test 5 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 5 + 1

+ COUNT=6

+ test 6 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 6 + 1

+ COUNT=7

+ test 7 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 7 + 1

+ COUNT=8

+ test 8 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 8 + 1

+ COUNT=9

+ test 9 -eq 10

+ test -f /var/lib/oprofile/lock

+ sleep 1

++ expr 9 + 1

+ COUNT=10

+ test 10 -eq 10

+ echo 'Couldn'\''t start oprofiled.'

Couldn't start oprofiled.

+ echo 'Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog'

Check the log file "/var/lib/oprofile/samples/oprofiled.log" and kernel syslog

+ exit 1

Thanks and Regards,
Nupur Garg
Computer Science,Graduate Student, University of California, SantaBarbara
805 708 7593


On Fri, Oct 16, 2009 at 7:23 PM, Robert Richter <robert.richter@amd.com> wrote:
On 16.10.09 10:37:30, nupur garg wrote:
> Hello,
> I wish to know that will compiling the kernel be of any use for this issue
> as I had pointed out in my previous post.

Could you send also the last lines of the following, I want to see
which parameters opcontrol tries to write:

 /bin/sh -x /usr/bin/opcontrol --start

It seems there is some incompatibility between oprofile userland and
the xendriver. Actually we do not support and test this, so there can
be some flaw with it.

-Robert

>
> Thanks for the help in advance.
>
> Nupur Garg
>
>
> On Fri, Oct 16, 2009 at 5:10 AM, nupur garg <nupurgarg@cs.ucsb.edu> wrote:
>
> > Hello Robert,
> > The answers are inline.
> >
> >  # uname -a
> > Linux domU-12-31-39-07-7A-71 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28
> > EST 2008 x86_64 GNU/Linux
> >
> >  # zgrep -i oprofile /proc/config.gz
> > gzip: /proc/config.gz: No such file or directory
> >
> >  # dmesg | grep -i oprofile
> > xenoprofile_init: ret 0, events 2, xenoprof_is_primary 0
> >
> > # find /dev/oprofile/
> > /dev/oprofile/
> > /dev/oprofile/1
> > /dev/oprofile/1/user
> > /dev/oprofile/1/kernel
> > /dev/oprofile/1/unit_mask
> > /dev/oprofile/1/count
> >  /dev/oprofile/1/event
> > /dev/oprofile/1/enabled
> > /dev/oprofile/0
> > /dev/oprofile/0/user
> > /dev/oprofile/0/kernel
> > /dev/oprofile/0/unit_mask
> > /dev/oprofile/0/count
> > /dev/oprofile/0/event
> > /dev/oprofile/0/enabled
> > /dev/oprofile/stats
> > /dev/oprofile/stats/bt_lost_no_mapping
> > /dev/oprofile/stats/event_lost_overflow
> > /dev/oprofile/stats/sample_lost_no_mapping
> > /dev/oprofile/stats/sample_lost_no_mm
> > /dev/oprofile/stats/cpu1
> > /dev/oprofile/stats/cpu1/backtrace_aborted
> > /dev/oprofile/stats/cpu1/sample_lost_overflow
> > /dev/oprofile/stats/cpu1/sample_received
> > /dev/oprofile/stats/cpu0
> > /dev/oprofile/stats/cpu0/backtrace_aborted
> > /dev/oprofile/stats/cpu0/sample_lost_overflow
> > /dev/oprofile/stats/cpu0/sample_received
> > /dev/oprofile/pointer_size
> > /dev/oprofile/backtrace_depth
> > /dev/oprofile/cpu_type
> > /dev/oprofile/cpu_buffer_size
> > /dev/oprofile/buffer_watershed
> > /dev/oprofile/buffer_size
> > /dev/oprofile/buffer
> > /dev/oprofile/passive_domains
> > /dev/oprofile/active_domains
> > /dev/oprofile/dump
> > /dev/oprofile/enable
> >
> >
> > # echo $(cat /dev/oprofile/cpu_type)
> > i386/piii
> >
> > Thanks and Regards,
> > Nupur Garg
> >
> >
> >
> > On Fri, Oct 16, 2009 at 4:17 AM, Robert Richter <robert.richter@amd.com>wrote:
> >
> >> On 15.10.09 23:21:36, nupur garg wrote:
> >> > Hello,
> >> > The oprofile device is mounted.
> >>
> >> Nupur,
> >>
> >> what gives the following on your system with oprofile mounted?
> >>
> >>  # uname -a
> >>  # zgrep -i oprofile /proc/config.gz
> >>  # dmesg | grep -i oprofile
> >>  # find /dev/oprofile/
> >>  # echo $(cat /dev/oprofile/cpu_type)
> >>
> >> > I had one xen image also, I tried on it and oprofile worked perfectly
> >> fine
> >> > on it. The difference between the ec2 image and this image I found was
> >> that
> >> > in /sys/devices/system/ directory oprofile directory was not there.
> >> Looking
> >> > around more I found that while compiling the kernel, Oprofile has to be
> >> set.
> >>
> >> This happens if CONFIG_PM is not set and is only needed for
> >> suspend/resume.
> >>
> >> -Robert
> >>
> >> --
> >> Advanced Micro Devices, Inc.
> >> Operating System Research Center
> >> email: robert.richter@amd.com
> >>
> >>
> >

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com