Bug 5634

Summary: systemtap in kepler doesn't recognize the kernel build
Product: [Yocto Project Subprojects] Eclipse Plugin Reporter: Alexandru Georgescu <alexandru.c.georgescu>
Component: eclipse-pluginAssignee: Jessica <jessica.zhang>
Status: VERIFIED FIXED QA Contact: Andra Necula <andrax.g.necula>
Severity: normal    
Priority: Medium CC: andrax.g.necula, ioanax.grigoropol, sgw, yp.ep.watcher, yp.watcher
Version: 1.6   
Target Milestone: 1.6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
systap eclise
none
systap term none

Description Alexandru Georgescu 2013-12-05 15:36:08 UTC
eclipse-plugin for kepler: http://autobuilder.yoctoproject.org/pub/releases/1.6_M1.rc1/eclipse-plugin/kepler/org.yocto.sdk-development-201312032314-archive.zip
eclipse-poky-kepler 3dd620d9f89e297ee9e22d5ba9fe741a5f40ac82

poky: c51730aaa91066cfb51ad6ec2920fb4f9d9ea94c



STEPS TO REPRODUCE

1. Build a local core-image-sato-sdk image (qemux86-64)
2. Run the image 
3. Launch eclipse (with eclipse-plugin installed)
4. Fill in all the fields for the systemtap tool to work (the ones used in step [1]):
* metadata location
* remote user id
* remote host ip
* systemtap script

5. press OK

EXPECTED RESULTS
5. After pressing ok, the plugin runs the crosstap script that connects to QEMU and displays the script output

ACTUAL RESULTS
5. The following errors appear in the eclipse console: 


Last login: Thu Dec  5 17:11:48 2013 from localhost
export TERM=vt100;cd /media/ubu/240/poky;source oe-init-build-env;crosstap root@192.168.7.4 /home/ubu/Documents/trac
e.stp
ubu@ubu-v:~$ export TERM=vt100;cd /media/ubu/240/poky;source oe-init-build-env;crosstap root@192.168.7.4 /home/ubu/
Documents/trace.stp

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'
/media/ubu/240/poky/build /media/ubu/240/poky/build
/media/ubu/240/poky/build

Error: No target kernel build found.
Did you forget to create a local build of your image?

'crosstap' requires a local sdk build of the target system
(or a build that includes 'tools-profile') in order to build
kernel modules that can probe the target system.

Practically speaking, that means you need to do the following:
  - If you're running a pre-built image, download the release
    and/or BSP tarballs used to build the image.
  - If you're working from git sources, just clone the metadata
    and BSP layers needed to build the image you'll be booting.
  - Make sure you're properly set up to build a new image (see
    the BSP README and/or the widely available basic documentation
    that discusses how to build images).
  - Build an -sdk version of the image e.g.:
      $ bitbake core-image-sato-sdk
  OR
  - Build a non-sdk image but include the profiling tools:
      [ edit local.conf and add 'tools-profile' to the end of
        the EXTRA_IMAGE_FEATURES variable ]
      $ bitbake core-image-sato

  [ NOTE that 'crosstap' needs to be able to ssh into the target
    system, which isn't enabled by default in -minimal images. ]

Once you've build the image on the host system, you're ready to
boot it (or the equivalent pre-built image) and use 'crosstap'
to probe it (you need to source the environment as usual first):

    $ source oe-init-build-env
    $ cd ~/my/systemtap/scripts
    $ crosstap root@192.168.1.xxx myscript.stp

ubu@ubu-v:/media/ubu/240/poky/build$ 



OTHER COMMENTS
Running locally the crosstap script using the same build dir doesn't have the error. (the core-image-sato-sdk for qemux86-64 was built and it's booting, so the kernel is definetly built :) ). E.g: 

ubu@ubu-v:/media/ubu/240/poky/build$ crosstap root@92.168.7.4 ~/Documents/trace.stp 
/media/ubu/240/poky/build /media/ubu/240/poky/build
/media/ubu/240/poky/build
Comment 1 Jessica 2013-12-13 23:38:02 UTC
Alex,

This can't be true, since the output from eclipse is running from a localshell.  Can you bring up eclipse in a clean shell like you run from command line?

I've tested on my end the behavior in Eclipse is the same as from command line.  But if you have run couple other things in the terminal before you bring up eclipse, then there maybe problem. 

I've attached the screen shot for things running on my machine.
Comment 2 Jessica 2013-12-13 23:40:07 UTC
Created attachment 1668 [details]
systap eclise
Comment 3 Jessica 2013-12-13 23:40:36 UTC
Created attachment 1669 [details]
systap term
Comment 4 Alexandru Georgescu 2013-12-16 15:07:09 UTC
Will retest this tomorrow.
Thanks for the follow up!
Comment 5 Alexandru Georgescu 2013-12-17 09:31:08 UTC
(In reply to comment #1)
> Alex,
> 
> This can't be true, since the output from eclipse is running from a
> localshell.  Can you bring up eclipse in a clean shell like you run from
> command line?
> 
> I've tested on my end the behavior in Eclipse is the same as from command
> line.  But if you have run couple other things in the terminal before you
> bring up eclipse, then there maybe problem. 
> 
> I've attached the screen shot for things running on my machine.

I could reproduce it using a clean environment, though there is a catch. For this particular build the error appears, but for example using a dora build, this doesn't happen. I will try again with the latest master and see if I can reproduce this.
Comment 6 Andra Necula 2014-08-27 11:09:08 UTC
Verified with eclipse Kepler, on master branch
commit 2d1660112e54653f7bb763939d0416472c49fe01
Ubuntu 14.04
x86_64

Cheers! Andra N.