Hello Maynard,

Thank you again for all your help, to answer your questions below:

1. Kernel headers -- i have kernel headers installed for the kernel version i'm running:
yum install kernel-headers
uname -a yields 2.6.32-358.2.1.el6.x86_64 and /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/ has the headers

2. strace -- i ran the command you suggested and the number after syscall (298) matches what's in the one in the kernel headers:

From strace ===
syscall_298(0x7fff3530a0f0, 0x5b77, 0, 0xffffffff, 0, 0x4800000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = -1 (errno 2)
write(2, "Your kernel's Performance Events"..., 59Your kernel's Performance Events Subsystem does not support) = 59

From greping for __NR_perf_event_open in the /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/ folder ===

arch/x86/include/asm/unistd_64.h:#define __NR_perf_event_open 298

3. Pathname of asm/unistd in -save-temps:

# 90 "../libperf_events/operf_utils.h"
# 1 "/usr/include/asm/unistd.h" 1 3 4


# 1 "/usr/include/asm/unistd_64.h" 1 3 4
# 16 "/usr/include/asm/unistd_64.h" 3 4

Does this mean there's a discrepancy? Thanks again for your help

-Bow-Nan




On Fri, Apr 5, 2013 at 3:04 PM, Maynard Johnson <maynardj@us.ibm.com> wrote:
On 04/05/2013 01:27 PM, Bow-Nan Cheng wrote:
> Hello,
>
> Thanks for your quick response!
>
> I rebooted into the latest stock kernel -- 2.6.32-358.2.1.el6.x86_64
>
> Recompiled oprofile:
> make clean
> ./configure
> make
> sudo make install
>
> Then tried to re-run operf, and it gave me this error:
> Your kernel's Performance Events Subsystem does not support your processor type. Please use the opcontrol command instead of operf.
>
> cat /proc/cpuinfo says my processor is:
> model: 23
> model name: Intel(R) Core(TM)2 Duo CPU     T9900  @ 3.06GHz
>
> Which.. according to this site: http://web.eece.maine.edu/~vweaver/projects/perf_events/support.html should support the perf_event.
>
> When i run:
>
> /usr/local/bin/opcontrol --start
> It seems to update the /var/lib/oprofile/samples folder once, but then it doesn't touch it again. The result is that "opreport -l" gives the same error about being too strict. Perhaps i'm doing something wrong in my compile or setup?
>
> Thanks for your help again!
Do you have the CentOS 6.3 kernel headers package installed -- i.e., with version that matches your running kernel?

Try 'strace operf --help > out 2>&1' and search for a syscall. You should see a number associated with that syscall entry in the strace output which should match the number for the '#define __NR_perf_event_open' in unistd.h (will need to grep /usr/include for '__NR_perf_event_open' to find the actual unistd.h file that has this #define).

It may also be instructive to cd into oprofile/pe_profiling and do the following:
        'touch operf.cpp'
        'make'
        Copy the g++ command onto the command line, add '-save-temps', then run 'make' again.
        Look at the operf.ii file that is generated by -save-temps option and look for "asm/unistd".  What's the pathname?

-Maynard


>
>
>
>
> On Fri, Apr 5, 2013 at 1:48 PM, Maynard Johnson <maynardj@us.ibm.com <mailto:maynardj@us.ibm.com>> wrote:
>
>     On 04/05/2013 12:22 PM, Bow-Nan Cheng wrote:
>     > Hello,
>     >
>     > I'm having a bit of difficulty getting oprofile to correctly profile my custom kernel module (or even profile the current kernel in general). I'm running CentOS 6.3 with a custom 3.2 kernel. Here's the process i used to install oprofile-0.9.8:
>     >
>     > ./configure --with-kernel=/home/username/linux-3.2.32
>     > make
>     > sudo make install
>     >
>     > Then i run operf to profile the entire system:
>     >
>     > sudo /usr/local/bin/operf -s
>     >
>     > However, when i check the oprofile_data/current folder, it's empty and the "opreport" command throws a "no samples found" error
>     >
>     > Any suggestions? I'm sure its just something small..
>     The first thing I would suggest is to boot back to your stock CentOS 6.3 kernel and build oprofile without the --with-kernel configure option. I'm quite certain that 6.3 uses a kernel version that supports operf, so as long as you have the CentOS kernel headers package installed, oprofile (with operf) will build just fine.  So try that, and see how operf runs.  Try operf in both single app mode and system-wide mode (see operf man page -- and since you're building it yourself, you'll need to do: 'export MANPATH=<oprof-install-dir>/share/man:$MANPATH').
>
>     If operf built with the stock CentOS kernel works OK, then you may be running into the bug with the '--with-kernel' option that another user recently encountered.  If so, apply my patch that I posted to the list on Wednesday of this week -- subject "[PATCH] Fix broken --with-kernel configure option".
>
>     Good luck!
>
>     -Maynard
>     >
>     >
>     > ------------------------------------------------------------------------------
>     > Minimize network downtime and maximize team effectiveness.
>     > Reduce network management and security costs.Learn how to hire
>     > the most talented Cisco Certified professionals. Visit the
>     > Employer Resources Portal
>     > http://www.cisco.com/web/learning/employer_resources/index.html
>     >
>     >
>     >
>     > _______________________________________________
>     > oprofile-list mailing list
>     > oprofile-list@lists.sourceforge.net <mailto:oprofile-list@lists.sourceforge.net>
>     > https://lists.sourceforge.net/lists/listinfo/oprofile-list
>     >
>
>