Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12 Aug 2008 10:11 PM by  bmfalme@yahoo.co.uk
Use of oprofile and gprof
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

bmfalme@yahoo.co.uk



New Member


Posts:
New Member


--
11 Aug 2008 09:46 AM
    Hello,

    I've successfully built and booted Linux 2.6.19.2 following the instructions by DrOctavius and others. I am also able to run my application.

    Now I'd like to gather some profiling information on my application; I built it with the -pg option and ran it on the board. After processing the gmon.out with gprof on the host I get correct call graph information but the times for all functions are reported to be 0.00. This is despite running the application for several minutes.

    I also checked and confirmed that I've set the kernel options:
    CONFIG_PROFILING=y
    CONFIG_OPROFILE=y

    Has anybody successfully used gprof on this board with this BSP? Is there anything I'm missing out?

    I have also tried using a cross compiled version of oprofile. However when I try running 'opcontrol --init' and 'opcontrol --start' on the board I get the following error messages:

    grep: /etc/mtab: No such file or directory
    mount: Mounting nodev on /dev/oprofile failed: Device or resource busy
    Kernel support not available, missing opcontrol --init as root?

    I checked and the /dev/oprofile directory does exist and looks to be populated with reasonable data.

    Does anyone have suggestions on what I can try?

    Regards
    M.

    DrOctavius



    New Member


    Posts:
    New Member


    --
    11 Aug 2008 10:07 PM
    You need to configure the kernel but you need to select the oprofile package in LTIB too:

    Kernel:
    CONFIG_OPROFILE - This is the configuration option for the oprofile driver. In the menuconfig this option is found under Instrumentation Support -> Profiling support -> OProfile system profiling. By default it is Y for all i.MX platforms.

    Ltib:
    • Must add Oprofile support with ARM11 PMU events for i.MX platforms: <ltib dir>/.ltib -cpackage list -> oprofile.
    • Must add ARM11 L2 Cache EVTMON support to oprofile for i.MX platforms <ltib dir>/.ltib -c Configure the kernel
    --> Instrumentation Support.
    • Must add Oprofile timer interrupt mode support.

    For more Info download this document:
    https://www.freescale.com/webapp/sps/download/license.jsp?colCode=PDK_IMX31_LINUXDOCS_BUNDLE&appType=file1&location=null&DOWNLOAD_ID=null

    And check in RerenceManual the chapter 49 (oprofile)

    bmfalme@yahoo.co.uk



    New Member


    Posts:
    New Member


    --
    12 Aug 2008 10:11 PM
    Thanks for the tip DrOctavius I completely missed out on adding oprofile support in LTIB; oprofile is working now.

    And thanks also for the link to the document, it will definitely come in handy!
    You are not authorized to post a reply.