From: Sabra G. <sab...@ya...> - 2014-10-07 14:00:07
|
Hi, Thank you Maynard for your support! I have first executed make command from within my kernel source tree: make headers_install INSTALL_HDR_PATH=<kernel-hdrs-install-dir> and then pass <kernel-hdrs-install-dir> to oprofile's '--with-kernel' configure option. ./configure --with-kernel-support --with-kernel=/home/sdk-test/Downloads/kernel-headers --host=i686-linux --build=arm-cortex-linux-gnueabi --with-extra-libs=/home/sdk-test/Downloads/popt-1.16/.libs/:/home/sdk-test/Downloads/binutils-2.24/libiberty/:/home/sdk-test/Downloads/binutils-2.24/bfd/ --with-binutils=/home/sdk-test/Downloads/binutils-2.24/ --with-extra-includes=/home/sdk-test/Downloads/popt-1.16/:/home/sdk-test/Downloads/binutils-2.24/bfd/ Le Mardi 7 octobre 2014 14h48, Maynard Johnson <may...@us...> a écrit : On 10/07/2014 08:10 AM, Sabra Gargouri wrote: > Hi, > I downloaded oprofile-1.0, built and install it on my embedded environment. When I run ./configure I did not get the warning about perf_events.h, so normally it was able to build perf staff. > But when I tried to run operf on my target, operf could not execute correctly: > # operf > Unexpected error running operf: Invalid argument > # operf -h > Unexpected error running operf: Invalid argument > What is the problem? Sabra, You're not giving enough information. When doing a cross-compile, there are many non-standard configure options that usually come into play, so you need to tell us what your configure command is. If you haven't done so already, do './configure --help' to see all available configure options. At the very least, you would normally need to use the "--with-kernel" option for cases where your host and target are not exactly the same platform -- that is, you need to point the configure script at the kernel headers for the target system. Failure to do so could result in the error you're seeing. I'm adding Will Deacon into the conversation since, as I already stated, I don't have any personal experience with cross-compiling, and Will does. -Maynard > > Br, > Sabra > > > > Le Lundi 6 octobre 2014 19h17, Maynard Johnson <may...@us...> a écrit : > > > On 10/06/2014 10:45 AM, Sabra Gargouri wrote: >> Many thanks for your support! I will test with oprofile1.0 too. >> I was able to successfully build and install oprofile0.9.8 in my environment. I generate samples with opcontrol and I noticed that the abi file (under /var/lib/oprofile) id a little bit different from 0.9.7. >> I don't know yet what is the utility of this abi file, but I would like to be sure that this file is effectively different from oprofile 0.9.7 to 0.9.8 and why? > The abi file is used when analyzing profile data that was collected on a different system. See the user manual section titled "Analyzing profile data on another system (oparchive)" for details. > > -Maynard > >> >> thanks in advance >> >> >> >> Le Lundi 6 octobre 2014 15h33, Maynard Johnson <may...@us... <mailto:may...@us...>> a écrit : >> >> >> On 10/06/2014 06:04 AM, Sabra Gargouri wrote: >>> Hi, >>> I'am cross compiling Oprofile for Armv7. For that I have downloaded Oprofile sources and built it first in my fedora machine as mentionned in some tuto: >>> >>> ./configure --with-kernel-support --with-kernel=/home/sdk-test/sdk2/repo_SDK2-14.0/build/build/build-b2120-h410_cut1_a9/kernel/ --host=i686-linux --build=arm-cortex-linux-gnueabi --with-extra-libs=/home/sdk-test/Downloads/popt-1.16/.libs/:/home/sdk-test/Downloads/binutils-2.24/libiberty/:/home/sdk-test/Downloads/binutils-2.24/bfd/ --with-binutils=/home/sdk-test/Downloads/binutils-2.24/ --with-extra-includes=/home/sdk-test/Downloads/popt-1.16/:/home/sdk-test/Downloads/binutils- >>> 2.24/bfd/ >>> at the end I had those warning : >>> >>> Warning: QT version 3 was requested but not found. No GUI will be built. >>> Warning: The user account 'oprofile:oprofile' does not exist on the system. >>> To profile JITed code, this special user account must exist. >>> Please ask your system administrator to add the following user and group: >>> user name : 'oprofile' >>> group name: 'oprofile' >>> The 'oprofile' group must be the default group for the 'oprofile' user. >>> Warning: perf_event.h not found. Please install the kernel headers package if you >>> want non-root support built into OProfile. >>> >>> and then compile it with make. >>> >>> Should I add some other options to resolve warnings? And after having built Oprofile how can I test it in my environment? Should I generate an rpm to be able to install Oprofile in my onvironment? >> Warning #1: Most users don't care about this. >> Warning #2: Unless you want to profile Java applications (in particular, the JITed code of Java apps), then you can ignore this warning. >> Warning #3: If the kernel version on your target (Armv7) system is 2.6.32 or higher, it would be beneficial for you to resolve this issue in order to build the newer profiling tool, operf. If you do not resolve this issue, then only the "legacy" opcontrol-based profiler will be built. The opcontrol-based profiler requires root authority to run and only performs system-wide profiling. See the oprofile user manual for more details. (After you build and install oprofile, you can access the user manual at <oprof-install-dir/share/doc/oprofile/oprofile.html.). >> >> By the way, from the text of these warning messages, I can tell that you are building oprofile 0.9.8, which is now two years old. Why not use the latest 1.0.0 release? Be aware that the 1.0.0 release no longer includes the legacy opcontrol-based profiler, so in order to use that release, your target system *must* have a kernel version of 2.6.32 or higher, and the configure script *must* be able find the perf_event.h file. >> >> As for testing, there is a testsuite you can download and run (git clone git://git.code.sf.net/p/oprofile/oprofile-tests) -- or just read the man pages and try various options you think might be useful. If you have any specific questions, post a message. >> >> Finally, as for an rpm for your target, that's up to you. I don't do embedded development, so I don't know what's usually done. But if you don't build an rpm, then when you configure oprofile, use the "--prefix" option to identify a unique oprofile install directory so it's easy to tar-up the entire oprofile installation and move it to your target. >> >> -Maynard >> >>> >>> BR >>> >> >> >> > > > |