This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

is oprofile supported on 8148 EVM?

Other Parts Discussed in Thread: STRIKE

I am running on Linux PSP 04.01.00.07 on an 8148EVM and would like to use oprofile. I note that the kernel has a configuration constant named CONFIG_HAVE_OPROFILE and there is oprofile code in the kernel source tree, but I see nothing (no code, no header files, no Makefile constructs) that pays attention to CONFIG_HAVE_OPROFILE.

But I went ahead anyway and used menuconfig to turn on oprofile and then built my kernel and added idle=poll to the bootline (per Documentation/basic_profiling.txt), but no oprofile module was built and oprofile is not in the kernel. That is, the oprofile toolkit is not yet working on my platform.

I notice that for some TI ARM Linux builds, the defconfig file specifies CONFIG_PROFILING as "y" and for some, it's not set. For the 8148, it's not set. Why would this be? Can't the default always by "y" for TI ARM devices?

Any help with pointing out what I need to do or what I've overlooked is appreciated. Thanks.

bob

  • Bob,

    Can you please confirm if you have followed the steps similar to the ones below and rebuilt the kernel?

    1. Generate default config for ti8148
    2. Enter the kernel configuration menu and enable Kernel Performance events and timers
          General setup  ---> Kernel Performance Events And Counters  ---> [*] Kernel performance events and counters
    3. Also, enable Profiling Support as shown below:
          General setup  ---> [ ] Profiling support
    4. Pressing 'Y' on "Profiling Support" will show another menu entry "OProfile system profiling". Press 'Y' again to build OProfile into kernel:
          [*] Profiling support
          <*> OProfile system profiling (NEW)

       Hemant

  • Hemant,

    Thanks much for your prompt and helpful reply.

    I did all the above (well, not exactly as the menuconfig prompt is now "Kernel Performance events and counters" and not "...events and timers") and I generate a .config file which looks fit and trim (with all the PROFILE-related constants set in a desired way).

    Ah, but then I do "make linux" from my SDK directory (per TI's instructions) and BOOM! one of the rules performed by "make linux" is "make ti8148_evm_defconfig" which obliterates the .config file I just so nicely created and replaces it with a copy of the default config file (from arch/arm/configs/ti8148_evm_defconfig).

    I am not sure what the point is of creating a .config file only to have it replaced with something else...so I thought I'd replace the defconfig file with the .config file I just created and then do "make linux" again. That way, the build system would be replacing the .config file with what-I-want.

    Did that, but then got a compile error in the ti81xxhdmi directory as the include file plat/display.h could not be found.

    So, yes, I did what you ask and the .config results of those actions looked good, but trying to actually use the .config file seemed an exercise in frustration as the build system seems determined to ignore what I just created.

    Clearly I am missing some important step(s). I am, for the moment, clueless as to what those might be. All help is welcome.

    bob

  • Bob.

    Can you please try the reverse way:

    1) do "make linux",

    2) Enable oprofile etc

    3) Now replace .config file as ti8148_evm_defconfig

    4) do "make linux"

    Btw, do you see the display.h file in arch/arm/plat-omap/include/plat?

       Hemant

  • Hi Bob,

    robert schulman said:

    Ah, but then I do "make linux" from my SDK directory (per TI's instructions) and BOOM! one of the rules performed by "make linux" is "make ti8148_evm_defconfig" which obliterates the .config file I just so nicely created and replaces it with a copy of the default config file (from arch/arm/configs/ti8148_evm_defconfig).

    I am not sure what the point is of creating a .config file only to have it replaced with something else...so I thought I'd replace the defconfig file with the .config file I just created and then do "make linux" again. That way, the build system would be replacing the .config file with what-I-want.

    A quick way to get around this is to add 'menuconfig' to the EZSDK Makefile's linux: target.

    1. Edit the EZSDK Makefile and scroll to the linux: target. It should read -

    linux:
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) $(DEFAULT_LINUXKERNEL_CONFIG)
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) uImage
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) modules

    Now change that to run menuconfig after the default configuration.

    linux:
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) $(DEFAULT_LINUXKERNEL_CONFIG)
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) menuconfig
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) uImage
        $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) modules

    Now, when you run make linux, it will copy over the default configuration and then run menuconfig. Post that the uImage and modules will be built.

  • Sid,

    This works...thanks much for the help.

    However...this changes the "make linux" process from "fire and forget" (at least, until the build is done) to an interactive process. Yuck.

    It seems to me the way to make this "fire and forget" is to have two rules for making linux kernels: one would be the revised rule as you have it and the other (obviously with some other target name) would be to just make the uImage and modules targets. Does this strike you as correct? I really would like to avoid an interactive build process.

    Thanks again.

    bob 

  • robert schulman said:
    Ah, but then I do "make linux" from my SDK directory (per TI's instructions) and BOOM! one of the rules performed by "make linux" is "make ti8148_evm_defconfig" which obliterates the .config file I just so nicely created and replaces it with a copy of the default config file (from arch/arm/configs/ti8148_evm_defconfig).

    My approach here would be to copy your oprofile-enabled .config as (say) "ti8148_evmperf_defconfig" and then select that instead of the normal config if you passed a 'profile' parameter (or bash env variable) in.

    eg.

    DEFAULT_LINUXKERNEL_PROFILE_CONFIG=ti8148_evmperf_defconfig
    ...
    [ -n "$PROFILE" ] && DEFAULT_LINUXKERNEL_CONFIG=$(DEFAULT_LINUXKERNEL_PROFILE_CONFIG)
    $(MAKE) -C $(LINUXKERNEL_INSTALL_DIR) $(LINUXKERNEL_BUILD_VARS) $(DEFAULT_LINUXKERNEL_CONFIG)