oprofile 0.9.8 failing under Ubuntu 12.10 with Pentium D - linux

I am trying to use oprofile 0.9.8 under Ubuntu 12.10 running on a Pentium D processor (Dell OptiPlex-GX620 desktop). When I try something simple like "operf ls" I get
perf_event_open failed with Invalid argument
Caught runtime_error: Internal Error. Perf event setup failed.
Error running profiler
I have success running oprofile in legacy mode using opcontrol commands under sudo by installing the module with timer=1 (see below).
It appears that operf is unhappy in this configuration - which is the new preferred method.
I have verified that all the dependent packages are loaded.
On the oprofile website they do not call out pentium D as a seperate architucture so not sure if it is using regular Pentium architecture.
I have searched everywhere and can't find anything like this reported. Any help would be appreciated in identifying the problem here.
P.S. When I run with legacy mode using opcontrol I have some success:
denham#denham-OptiPlex-GX620:~$ sudo opcontrol --start
ATTENTION: Use of opcontrol is discouraged. Please see the man page for operf.
Using default event: GLOBAL_POWER_EVENTS:100000:1:1:1
Error: counter 0 not available nmi_watchdog using this resource ? Try:
opcontrol --deinit
echo 0 > /proc/sys/kernel/nmi_watchdog
**When I force the module to be installed with timer=1**
denham#denham-OptiPlex-GX620:~$ sudo opcontrol --deinit
Unloading oprofile module
denham#denham-OptiPlex-GX620:~$ sudo modprobe oprofile timer=1
denham#denham-OptiPlex-GX620:~$ sudo opcontrol --no-vmlinux
denham#denham-OptiPlex-GX620:~$ sudo opcontrol --start
ATTENTION: Use of opcontrol is discouraged. Please see the man page for operf.
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
denham#denham-OptiPlex-GX620:~$ ./a
^C
denham#denham-OptiPlex-GX620:~$ sudo opcontrol --shutdown
Stopping profiling.
Killing daemon.
denham#denham-OptiPlex-GX620:~$ opreport --callgraph
Using /var/lib/oprofile/samples/ for samples directory.
warning: /no-vmlinux could not be found.
warning: [vdso] (tgid:1697 range:0xb77ab000-0xb77ac000) could not be found.
warning: [vdso] (tgid:1728 range:0xb77b6000-0xb77b7000) could not be found.
warning: [vdso] (tgid:3310 range:0xb7702000-0xb7703000) could not be found.
CPU: CPU with timer interrupt, speed 2992.41 MHz (estimated)
Profiling through timer interrupt
samples % image name app name symbol name
-------------------------------------------------------------------------------
31878 81.1868 no-vmlinux no-vmlinux /no-vmlinux
31878 100.000 no-vmlinux no-vmlinux /no-vmlinux [self]
-------------------------------------------------------------------------------
2820 7.1820 a a main
2820 100.000 a a main [self]
-------------------------------------------------------------------------------
1065 2.7123 vino-server vino-server /usr/lib/vino/vino-server
1065 100.000 vino-server vino-server /usr/lib/vino/vino-server [self]
-------------------------------------------------------------------------------
1056 2.6894 a a b
1056 100.000 a a b [self]
-------------------------------------------------------------------------------
1013 2.5799 a a c
1013 100.000 a a c [self]
-------------------------------------------------------------------------------
968 2.4653 a a d
968 100.000 a a d [self]
-------------------------------------------------------------------------------
264 0.6724 libc-2.15.so libc-2.15.so /lib/i386-linux-gnu/libc-2.15.so
. . . . .

Don't know if this is the main problem but the error message says -
"Error: counter 0 not available nmi_watchdog using this resource.
Try: opcontrol --deinit echo 0 > /proc/sys/kernel/nmi_watchdog".
To get rid of this you have to disable NMI watchdog kernel parameter. On Ubuntu it is done via grub -
Edit /etc/default/grub and add “nmi_watchdog=0” to the GRUB_CMDLINE_LINUX.
Then run sudo update-grub and check the value with
cat /proc/sys/kernel/nmi_watchdog (should be "0"). Reboot to install new config if needed.

Related

How to debug this issue. chrt: failed to set pid 14490's policy: Operation not permitted

chrt -p 14490
pid 14490's current scheduling policy: SCHED_OTHER
pid 14490's current scheduling priority: 0`
I am trying to change the the scheduling priority of this process to SCHED_RR using the below command and running into the following error.
chrt -r -p 25 14490
chrt: failed to set pid 14490's policy: Operation not permitted
How can I debug why this is failing ?
You failed to specify your Linux version...
... but here are a few options:
https://unix.stackexchange.com/questions/114643/chrt-failed-to-set-pid-xxxs-policy-on-one-machine-but-not-others
sysctl -w kernel.sched_rt_runtime_us=-1
https://lists.opensuse.org/opensuse-security/2011-04/msg00015.html
... and ...
https://www.linuxquestions.org/questions/slackware-14/chrt-from-shell-scripts-operation-not-permitted-4175590174/
I tested on a virtualized slackware 14.2. No error. I upgraded to
util-linux-2.28.2 from current and then I had that error.
Upstream commit: https://github.com/karelzak/util-lin...ec919bec94089f
Marking thread as solved.
In other words:
You can try sysctl -w kernel.sched_rt_runtime_us=-1
But there are at least two reported instances where this was a bug: in slackware, and in util-linux. The solution in both cases was to update the Linux version.

DPDK Error: "Cause: No Ethernet ports - bye"

The title is the last line of an error while trying to run a sample application of dpdk, named l2fwd. When I run the app by ./build/l2fwd -l 0-3 -n 4 -- -q 8 -p ffff but at last lines this error occurs:
EAL: Error - exiting with code: 1
Cause: No Ethernet ports - bye
According to dpdk documentation before running app I must execute a command: modprobe ixgbe max_vfs=2,2
I also have a problem with this command, but I'm not sure this is the main reason of failing app execution.
Error of modprobe command relates to ixgbe driver which I can't install it. The error after make of ixgbe is
cc1: error: code model kernel does not support PIC mode
Makefile:197: * * Aborting the build. *** This driver is not supported on kernel versions older than 2.4.0. Stop.
To you a NIC with DPDK we need to bind it to UIO or VFIO driver.
Please have a look at Binding and Unbinding Network Ports to/from the Kernel Modules in DPDK's getting started guide.

ejabberd show error while configure at time of installation

I am trying to configure eJabberd on my server.
I have installed all dependencies and other needed things. ERL also installed success fully through RPM with run result
root#sXX-XX-XX-XX [~]# erl -smp disable
Erlang/OTP 18 [erts-7.1] [source-2882b0c] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.1 (abort with ^G)
1>
For final installation of eJabberd i have followed below link :
http://docs.ejabberd.im/admin/guide/installation/
I have tried make clean also for it and after try ./configure --enable-mysql than also i am facing continue below error.
root#sXX-XX-XX-XX [/etc/ejabberd_downloads/ejabberd]# ./configure
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a sed that does not truncate output... /bin/sed
checking for erl... /usr/bin/erl
checking for erlc... /usr/bin/erlc
checking for erl... /usr/bin/erl
checking for erlc... /usr/bin/erlc
checking Erlang/OTP version...
Crash dump is being written to: erl_crash.dump...
Failed to create aux thread
./configure: line 2523: 1636 Aborted $ERLC conftest.erl
configure: error: "Could not compile Erlang/OTP version check program using '/usr/bin/erlc'"
For erl_crash.dump few lines as below from top
=erl_crash_dump:0.3
Thu Nov 19 01:31:57 2015
Slogan: Failed to create aux thread
System version: Erlang/OTP 18 [erts-7.1] [source-2882b0c] [64-bit] [smp:64:24] [async-threads:0] [hipe] [kernel-poll:false]
Compiled: Wed Sep 23 15:34:00 2015
Taints:
Atoms: 2005
Calling Thread: beam.smp
=scheduler:1
Scheduler Sleep Info Flags: SLEEPING | TSE_SLEEPING
Scheduler Sleep Info Aux Work: SET_TMO
Current Port:
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 1
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: NONEMPTY_NORMAL | NONEMPTY
Current Process:
=scheduler:2
which erl result as below :
/usr/bin/erl
I am not able to trace the issue, Any reference will be very helpful. Thanks in advence.
It seems that your Erlang version is corrupted or Old, Reinstall it and try again. For Ejabberd 16.x version 6.1 (Erlang/OTP 17.1) is required.
You can uninstall Erlang with following command:
$ sudo apt-get purge erlang*
And install latest Erlang from http://www.erlang.org/

Mounting ceph fails with "mount error 5 = Input/output error"

I have tried to create a ceph filesystem in a single host, for testing purposes, with the following conf file
[global]
log file = /var/log/ceph/$name.log
pid file = /var/run/ceph/$name.pid
[mon]
mon data = /srv/ceph/mon/$name
[mon.mio]
host = penny
mon addr = 127.0.0.1:6789
[mds]
[mds.mio]
host = penny
[osd]
osd data = /srv/ceph/osd/$name
osd journal = /srv/ceph/osd/$name/journal
osd journal size = 1000 ; journal size, in megabytes
[osd.0]
host = penny
devs = /dev/loop1
/dev/loop1 is formatted with XFS and is actually a file with 500Mbs (although that shouldn't matter much) Everything works pretty much OK, and health shows:
sudo ceph -s
2013-12-12 21:14:44.387240 pg v111: 198 pgs: 198 active+clean; 8730 bytes data, 79237 MB used, 20133 MB / 102 GB avail
2013-12-12 21:14:44.388542 mds e6: 1/1/1 up {0=mio=up:active}
2013-12-12 21:14:44.388605 osd e3: 1 osds: 1 up, 1 in
2013-12-12 21:14:44.388738 log 2013-12-12 21:14:32.739326 osd.0 127.0.0.1:6801/8834 181 : [INF] 2.30 scrub ok
2013-12-12 21:14:44.388922 mon e1: 1 mons at {mio=127.0.0.1:6789/0}
but when I try to mount the filesystem
sudo mount -t ceph penny:/ /mnt/ceph
mount error 5 = Input/output error
Usual answers point to ceph-mds not running, but it's actually working:
root 8771 0.0 0.0 574092 4376 ? Ssl 20:43 0:00 /usr/bin/ceph-mds -i mio -c /etc/ceph/ceph.conf
In fact, I managed to make it work previously using these instructions http://blog.bob.sh/2012/02/basic-ceph-storage-kvm-virtualisation.html verbatim previously, but after I tried again I obtained the same problem. Any idea of what might have failed?
Update as indicated by the comment, dmesg shows a problem
[ 6715.712211] libceph: mon0 [::1]:6789 connection failed
[ 6725.728230] libceph: mon1 127.0.1.1:6789 connection failed
Try to use 127.0.0.1. It looks like the kernel is resolving the hostname, but 127.0.1.1 is weird, and maybe it isn't responding to IPv6 loopback.

oprofile isn't sampling LLC_MISSES cache events

I'm trying to use oprofile to record cache misses in a large realtime app:
$ sudo opcontrol --no-vmlinux --event=LLC_MISSES:100000 --session-dir=/var/tmp/oprofile -c=5 --start
But when I look at the reports, it doesn't mention the cache misses. It only samples CPU_CLK_UNHALTED:
$ sudo opreport -l --session-dir=/var/tmp/oprofile
CPU: Intel Architectural Perfmon, speed 1596 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
samples % image name app name symbol name
63243 92.2946 no-vmlinux no-vmlinux /no-vmlinux
564 0.8231 libc-2.13.so libc-2.13.so /lib32/libc-2.13.so
(etc)
But --status claims that oprofile is sampling L2 misses:
$ sudo opcontrol --status
Daemon running: pid 3220
Event 0: LLC_MISSES:500000:65:1:1
Separate options: library
vmlinux file: none
Image filter: none
Call-graph depth: 5
What am I doing wrong? I can't get it to sample any of the other counters listed in ophelp either.
This is with oprofile 0.9.6 on Ubuntu, kernel version 2.6.38.
Turns out you need to actually kill and restart the oprofile daemon with
sudo opcontrol --stop
sudo opcontrol --reset
sudo opcontrol --shutdown
sudo opcontrol --start-daemon
sudo opcontrol --start
when changing sampled events. Simply stopping and starting the profile isn't enough. Not that this is documented anywhere.

Resources