<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3672</bug_id>
          
          <creation_ts>2013-01-03 22:37:19 +0000</creation_ts>
          <short_desc>Adopt crosstap script for systemtap</short_desc>
          <delta_ts>2013-04-16 08:43:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Eclipse Plugin</product>
          <component>eclipse-plugin</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.4 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jessica">jessica.zhang</reporter>
          <assigned_to name="Ioana Grigoropol">ioanax.grigoropol</assigned_to>
          <cc>adrian.dudau</cc>
    
    <cc>alexandru.c.georgescu</cc>
    
    <cc>ioanax.grigoropol</cc>
    
    <cc>yp.ep.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28542</commentid>
    <comment_count>0</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-01-03 22:37:19 +0000</bug_when>
    <thetext>The eclipse plug-in for systemtap should adopt the latest crosstap script for remote systemtap interaction to be consistent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28786</commentid>
    <comment_count>1</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-01-11 23:40:04 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/eclipse-poky/commit/?id=1be3c5bd38913ec298263d2e36315e2211aca01b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29962</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-02-19 14:41:54 +0000</bug_when>
    <thetext>Hi Jessica, 
Can you help me verify this work with a test scenario or what should I expect to happen?

Thanks,
Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31341</commentid>
    <comment_count>3</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-02 08:16:47 +0000</bug_when>
    <thetext>Hi Jessica,
With the help of profiling wiki: https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap , I have tried to run the tool, but I have the following output


1. Added the poky location for the metadata (e.g.: /home/yocto/0327-1/userbuilt/poky)
2. configured the other fields (user, host, systemtap script).
3. Pressed OK.

On the console output I have the following output which I believe is wrong: 



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

You can now run &apos;bitbake &lt;target&gt;&apos;

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 &apos;runqemu qemux86&apos;

~/0327-1/userbuilt/poky/build ~/0327-1/userbuilt/poky/build
~/0327-1/userbuilt/poky/build




The output should be the same as in the wiki: 
$ crosstap root@192.168.7.2 trace_open.stp 
root@192.168.7.2&apos;s password: 
matchbox-termin(1036) open (&quot;/tmp/vte3FS2LW&quot;, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600)
matchbox-termin(1036) open (&quot;/tmp/vteJMC7LW&quot;, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31559</commentid>
    <comment_count>4</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-04-04 18:16:24 +0000</bug_when>
    <thetext>Alex,

I&apos;ve tried and think probably you truncate the error messages that you got, which should be as following.  It explains in detail that you didn&apos;t run a kernel build with your metadata, please read how to use systemtap crosstap script on wiki carefully.

Thanks,
Jessica

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

You can now run &apos;bitbake &lt;target&gt;&apos;

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 &apos;runqemu qemux86&apos;

~/poky/build ~/poky/build
~/poky/build

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

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

Practically speaking, that means you need to do the following:
  - If you&apos;re running a pre-built image, download the release
    and/or BSP tarballs used to build the image.
  - If you&apos;re working from git sources, just clone the metadata
    and BSP layers needed to build the image you&apos;ll be booting.
  - Make sure you&apos;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 &apos;tools-profile&apos; to the end of
        the EXTRA_IMAGE_FEATURES variable ]
      $ bitbake core-image-sato

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

Once you&apos;ve build the image on the host system, you&apos;re ready to
boot it (or the equivalent pre-built image) and use &apos;crosstap&apos;
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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31616</commentid>
    <comment_count>5</comment_count>
    <who name="Adrian Dudau">adrian.dudau</who>
    <bug_when>2013-04-05 14:59:56 +0000</bug_when>
    <thetext>Hi Alex,

Even if you build the kernel/image, you need to make sure that you do that in the poky/build folder. At the moment the plugin uses that folder by default. (It sources oe-init-build-env from poky without a builddir parameter, which leads to the creation of a new poky/build folder if not available). Maybe we should modify the plugin so that the user can choose the build folder as well. 
What do you think Jessica?

Best regards,
--Adrian</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31624</commentid>
    <comment_count>6</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-04-05 22:40:34 +0000</bug_when>
    <thetext>Hi Andrian,

Then probably that&apos;s a separate enhancement bug.  If no futher issue with this bug, please close it since we&apos;re working on trending down for 1.4 bugs for the release.

Thanks,
Jessica</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31671</commentid>
    <comment_count>7</comment_count>
    <who name="Adrian Dudau">adrian.dudau</who>
    <bug_when>2013-04-08 12:45:35 +0000</bug_when>
    <thetext>Hi

I created bug https://bugzilla.yoctoproject.org/show_bug.cgi?id=4223 to deal with this. I will start working on a solution for that.

I guess we can close this bug now.

best regards,
--Adrian</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31783</commentid>
    <comment_count>8</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-04-09 22:21:14 +0000</bug_when>
    <thetext>Please refer to comments below...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31835</commentid>
    <comment_count>9</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-10 15:41:23 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; Please refer to comments below...

Hi Jessica,
I am sorry but I have to reopen this.

Here is the steps I have tested.

1. clone a poky and checkout the RC3 commit: fe336b149552b1f4f24d979c40302653298b98cc
2. added tools-profile to the local.conf for EXTRA_IMAGE_FEATURES parameter.
3. bitbake linux-yocto
4. bitbake core-image-sato-sdk
5. After all finnished, I started the qemu:
$ runqemu qemux86-64 core-image-sato-sdk

6. Started eclipse and filled in all the data for systemtap script. Then pressed OK.

Now, I don&apos;t get the kernel build not found error. Instead, it stops at: 


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

You can now run &apos;bitbake &lt;target&gt;&apos;

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 &apos;runqemu qemux86&apos;
~/0403-2/poky/build-systemtap ~/0403-2/poky/build-systemtap
~/0403-2/poky/build-systemtap


Adrian, Jessica: Have you tried to run this way the plugin and did that work?
 Is there something that I am not doing right?

Regards,
Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31838</commentid>
    <comment_count>10</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-04-10 15:47:17 +0000</bug_when>
    <thetext>where you run bitbake? inside the meta data build dir or outside? and what are the info you filled in the plugin? please be more specific since they&apos;re the key infos for this bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31843</commentid>
    <comment_count>11</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-10 16:04:28 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; where you run bitbake? inside the meta data build dir or outside? and what
&gt; are the info you filled in the plugin? please be more specific since they&apos;re
&gt; the key infos for this bug


I ran &quot;bitbake core-image-sato-sdk&quot; inside poky folder (after I have sourced it into build-systemtap dir). 
I created a symlink in order to use the build directory inside poky dir (so that I don&apos;t have to rebuild all over again):
[yocto@localhost poky]$ ln -s build-systemtap build

The folder used now is the default one (build)

Started up Eclipse again and set the following settings to systemtap:
Metadata location:
/home/yocto/0403-2/poky/build

User ID: root
remote host: 192.168.7.6

systemtap script: /home/yocto/0403-2/trace.stp

The trace.stp file is:

[yocto@localhost 0403-2]$ cat trace.stp 
probe syscall.open
{
        printf (&quot;%s(%d) open (%s)\n&quot;, execname(), pid(), argstr)
}

probe timer.ms(4000) # after 4 seconds
{
        exit ()
}
[yocto@localhost 0403-2]$ 




Please note that now the error for the kernel build does not appear, so the plugin recognizes the kernel build.


In order to make sure, I will try to reproduce this from scratch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31851</commentid>
    <comment_count>12</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-04-10 17:38:12 +0000</bug_when>
    <thetext>Alex,

Don&apos;t do the symlink for your build directory, you either stick with the outside meta-data build dir or the default build dir within the meta-data directory.  The issue you found is really a corner case which is not typically people doing things.

I&apos;m closing this bug since it&apos;s workig as designed.  Please open a separate bug to track your issue which in my mind is a low.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31868</commentid>
    <comment_count>13</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-11 07:24:23 +0000</bug_when>
    <thetext>I am sorry but I have tried with a new clean build using the default dir: &quot;build&quot;.
The issue remains the same: nothing happens.

I will paste again the eclipse console output:


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

You can now run &apos;bitbake &lt;target&gt;&apos;

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 &apos;runqemu qemux86&apos;
~/0403-2/poky2/build ~/0403-2/poky2/build
~/0403-2/poky2/build


Tested with: 
eclipse-poky   dylan         e5172830f61b7dcc3ac03d18a03e63389c6b4629</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31954</commentid>
    <comment_count>14</comment_count>
    <who name="Adrian Dudau">adrian.dudau</who>
    <bug_when>2013-04-11 13:50:35 +0000</bug_when>
    <thetext>Hi Alex,

From the look of it, it seems that your stap script goes through alright. Your code snipped looks a bit odd, are you sure it&apos;s correct? Try to run it against your host machine. Or you could also try to manually run the crosstap script with the -v option.

Best regards,
--Adrian</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31990</commentid>
    <comment_count>15</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-11 16:09:23 +0000</bug_when>
    <thetext>Hi Adrian, Jessica,

Doing further investigation, the problem is the bug Adrian filed some stap scripts freeze Eclipse when ran from the System Tap plugin https://bugzilla.yoctoproject.org/show_bug.cgi?id=4251 since no output is displayed it is hard to tell if the script implementation works well or not.

Also, trying manually from command line, I couldn&apos;t validate the crosstap script since there is a bug blocking it: https://bugzilla.yoctoproject.org/show_bug.cgi?id=4099. 

I propose to have this put on hold until the bug 4099 is fixed.

Regards,
Alex.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32171</commentid>
    <comment_count>16</comment_count>
    <who name="Jessica">jessica.zhang</who>
    <bug_when>2013-04-15 15:40:41 +0000</bug_when>
    <thetext>Alex,

let&apos;s mark this one as fixed since what this bug is meant to adapt systamtap script changes in Eclipse plug-in which is implemented.  As to other issues, since there&apos;re separate bugs tracking them, no need to keep this bug open.

THanks,
Jessica</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32207</commentid>
    <comment_count>17</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2013-04-16 08:43:54 +0000</bug_when>
    <thetext>OK. 

Verified as per above comment</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>