Re: Error cross compiling oprofile

William Cohen <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 05/05/2015 10:41 AM, Paul Fine wrote:
> Thanks Andrew,
> 
> That allowed me to compile.  When I try to run operf or ocount on my target I got an error:
> 
> root@dm816x-evm:~# operf
> Unexpected error running operf: Invalid argument
> root@dm816x-evm:~#
> 
> I need to go back and do some cleaning.  I may have some libraries left over from installing oprofile 0.9.8, although I think I would have seen some sort of library version mismatch error.
> 
> For the moment, my boss is looking for me to find out where all our cycles have gone missing, and oprofile 0.9.8 using opcontrol seems to be working, so I will come back to this issue in a few days after the fire is out.
> 
> Thanks for your help.
> 
> --Paul

Hi Paul,

operf leverages the perf support in the linux kernel.  It is possible that the kernel's perf support doesn't support this particular architecture.  Do a quick check is to see whether the following works:

perf stat ls

According to http://www.ti.com/lit/ds/symlink/tms320dm8168.pdf  the processor is cortex a8.  And it looks like there is support in the 2.6.37 kernel for cortex a8 support (http://lxr.linux.no/#linux+v2.6.37/arch/arm/kernel/perf_event.c#L78).  Does the kernel .config have the following line?

CONFIG_HW_PERF_EVENTS=y

Also does the device tree have information in there for the hardware to be setup.  I did have an experience on the trimeslice where the device tree was missing information to setup the pmu hardware and perf wasn't working (https://bugzilla.redhat.com/show_bug.cgi?id=741325).  If the kernel supports perf you should see something like the following lines in the dmesg output:

[    0.716474] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available


-Will

> 
> On Tue, May 5, 2015 at 8:46 AM, Andrew Haley <[email protected] <mailto:[email protected]>> wrote:
> 
>     On 05/05/2015 11:57 AM, Paul Fine wrote:
>     > Thanks for the quick reply Andrew.
>     >
>     > unistd.h is being included in the build.  The only reference to pipe2() I
>     > find in unistd.h is:
>     >
>     > /opt/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/libc/usr/include/asm/
>     >
>     >       #define __NR_pipe2 (__NR_SYSCALL_BASE+359)
>     >
>     > and also in my linux kernel packages.
>     >
>     > Is this macro suppose to resolve to pipe2()? Am I suppose to build glibc
>     > for my target?  I am not really sure what to do here.  I was able to build
>     > oprofile-0.9.8 once I was able to get the configure parameters for cross
>     > compile correct.
> 
>     Clearly your libc headers are broken.  I don't know why, and will not
>     speculate!
> 
>     I'd just do this:
> 
>        syscall(__NR_pipe2, int pipefd[2], int flags);
> 
>     Andrew.
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> 
> 
> 
> _______________________________________________
> oprofile-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oprofile-list
> 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.