Bug 94

Summary: oprofile related package is not included in the qemu rootfs even if selected
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: liping Ke <liping.ke>
Component: meta-yoctoAssignee: Dexuan Cui <dexuan.cui>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: High CC: dexuan.cui, jessica.zhang, josh, lianhao.lu, liping.ke, poky.bs.watcher, poky.watcher, sgw
Version: unspecified   
Target Milestone: ---   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---

Description liping Ke 2010-05-25 02:41:11 UTC
Repeated Steps:
1. modify local.conf, make sure tools-profile and dbg-packages are in the "EXTRA_IMAGE_FEATURES" and also set DEBUG_BUILD="1". 
2. Rerun bitbake poky-image-sdk, bitbake qemu-native, I found the image is much bigger. And I check meta/classes/poky-image.bbclass, it does contains (tools-profile) related information in base IMAGE_FEATURES.
3. runqemu qemux86, Only oprofile-server is installed in the target image. No oprofile related packages installed in the target image.


ENV:
Ubuntu9.10 Karmic, poky 3.2.1 purple.

Thanks& Regards,
criping
Comment 1 liping Ke 2010-05-25 02:42:20 UTC
(In reply to comment #0)
I do see those related packages are in the deploy/ipk folders.
Comment 2 Joshua Lock - Disabled 2010-06-17 08:09:37 UTC
What other tools are you expecting to see? The task-poky-tools.bb only includes oprofile and oprofile-ui-server, it's generally expected that you will run the visualisation tools from your workstation but you can add oprofileui-viewer to EXTRA_IMAGE_FEATURES if you want that to be included in your image.
Comment 3 Joshua Lock - Disabled 2010-06-17 15:41:59 UTC
Ahh, my bad - misunderstanding on my part here. Something's going wrong because the poky-image-sdk doesn't contain any oprofile binaries either.

I'm investigating.
Comment 4 Saul Wold 2010-07-19 17:04:23 UTC
*** Bug 122 has been marked as a duplicate of this bug. ***
Comment 5 Dexuan Cui 2010-07-19 19:02:41 UTC
(In reply to comment #4)
> *** Bug 122 has been marked as a duplicate of this bug. ***

Thanks to Kevin's help! He helped to find out the root cause:

In meta/packages/tasks/task-poky-tools.bb:

RDEPENDS_task-poky-tools-profile = "\
    oprofile \
    oprofileui-server \
    powertop \
    lttng-control \
    lttng-viewer"

RDEPENDS_task-poky-tools-profile_qemux86 += "valgrind"    # dexuan: ====> this line causes the issue! The 5 packages in RDEPENDS_task-poky-tools-profile aren't built into the target at all and only valgrind is built into the target!

I tried to change the line to

RDEPENDS_append_task-poky-tools-profile_qemux86 = "valgrind"

, and after 

for i in task-poky-tools poky-image-sdk; do bitbake $i -c clean ; done
for i in task-poky-tools poky-image-sdk; do bitbake $i ; done

I can successfully built all the 6 packages into the target!.

The below is Kevin's analysis:
----------------------------------------------------------------------
I think it's related to the sequence of how a variable is parsed:

RDEPENDS_task-poky-tools-profile_qemux86 += "valgrind"

For above line, the whole " RDEPENDS_task-poky-tools-profile_qemux86" is a variable
when handling "+=". As this variable is not defined earlier, it's equal to:

RDEPENDS_task-poky-tools-profile_qemux86 = "valgrind"

Then later bitbake will handle overrides, which then overrides with previous 
RDEPENDS_task-poky-tools-profile with valgrind.

Bitbake handles append/prepend after overrides, in that way after handling overrides,
we actually get two variables:

RDEPENDS = "\
    oprofile \
    oprofileui-server \
    powertop \
    lttng-control \
    lttng-viewer"

and

RDEPENDS_append = "valgrind"

Finally you'll get the desired effect for a combined RDEPENDS. :-)
----------------------------------------------------------------------


I'm working with Liping to try oprifile in notebook.
I will send out the fix and update patches in a couple of hours.
Comment 6 Dexuan Cui 2010-07-19 23:10:15 UTC
Only installing the oprofile things into the target image is not enought: we need also to build the linux kernel with oprofile support(CONFIG_OPROFILE=y) --meta/packages/linux/linux-2.6.33.2/qemux86/defconfig it's there, but in 
meta-moblin/packages/linux/linux-moblin-2.6.33.2/defconfig-{netbook, menlow}, it's not there. So I did the following:

1) ensure there is CONFIG_OPROFILE=y in meta-moblin/packages/linux/linux-moblin-2.6.33.2/defconfig-netbook;

2) 
bitbake linux-moblin -c clean
bitbake poky-image-sato-live -c clean
bitbake linux-moblin
bitbake poky-image-sato-live.

After the above, Liping can use the oprofile fine in her Netbook box.
I suppose emenlow should be the similar.
Comment 7 liping Ke 2010-07-19 23:18:25 UTC
find another thing:
seems network driver is not in by default, we need to enable network driver in the similar way. I guess it should be e1000, I will try it.

Thanks& Regards,
criping
Comment 8 liping Ke 2010-07-28 02:04:50 UTC
this bug has been fixed. Now oprofile tools are included in sdk packages.
Comment 9 Dexuan Cui 2010-07-28 17:50:26 UTC
(In reply to comment #8)
> this bug has been fixed. Now oprofile tools are included in sdk packages.
Thanks for the testing! 
So let me mark it FIXED.

Liping, pls mark it VERIFIED. :-)