Bug 6016 - CrossTap has issues on running scheduler script against qemuppc
Summary: CrossTap has issues on running scheduler script against qemuppc
Status: RESOLVED DUPLICATE of bug 10990
Alias: None
Product: General Runtime
Classification: Runtime
Component: General Runtime (show other bugs)
Version: 1.6
Hardware: Other arm
: Medium normal
Target Milestone: 2.3 M4
Assignee: Chen Qi
QA Contact:
URL:
Whiteboard:
: 6118 6122 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-20 13:24 UTC by Alexandra Safta
Modified: 2017-03-23 03:18 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Found by QA test)
Verified:
Documentation change: Don't know


Attachments
sched_switch.stp (2.07 KB, application/octet-stream)
2014-03-20 13:24 UTC, Alexandra Safta
no flags Details
systemtap 'update' (1.34 KB, patch)
2014-03-28 15:31 UTC, Tom Zanussi
no flags Details | Diff
find the yocto kernel source tree (1.25 KB, patch)
2015-06-24 07:17 UTC, Kevin Hao
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandra Safta 2014-03-20 13:24:51 UTC
Created attachment 1845 [details]
sched_switch.stp

When running the crosstap tests using the sched_switch.stp the following error is displayed: 

$ ./../scripts/crosstap root@192.168.7.4 sched_switch.stp 

semantic error: not accessible at this address [man error::Dwarf] (0xc0065470, dieoffset: 0x4a42c2): identifier '$p' at poky-1960f6b2ecbb793b40ebc9aed25c8f9cb7884c9a/build_ppc/tmp/sysroots/x86_64-linux/usr/share/systemtap/tapset/linux/scheduler.stp:257:9

source: task = $p 
^ 

Pass 2: analysis failed. [man error::Pass2] 
Number of similar error messages suppressed: 65. 
Rerun with -v to see them.
Comment 1 Tom Zanussi 2014-03-20 22:54:38 UTC
This may be a duplicate of:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=5948

but I can't tell from looking at the commit whether this is current master or not.
Comment 2 Darren Hart 2014-03-20 23:36:02 UTC
Alexandra, can you confirm if what you are seeing is a dup of 5948?
Comment 3 Alexandra Safta 2014-03-21 10:00:43 UTC
yes, it seems to be the same problem
Comment 4 Darren Hart 2014-03-21 21:57:01 UTC
Thank you Alexandra, marking as a duplicate of BUG 5948

*** This bug has been marked as a duplicate of bug 5948 ***
Comment 5 Darren Hart 2014-03-27 14:45:02 UTC
Re-opening this bug as it is opened against master while Bug 5948 was against 1.4.3, which is closed as WONTFIX. Let's focus our efforts on this bug for master. Assigning to Tom as he agreed to do the system tap update.
Comment 6 Tom Zanussi 2014-03-28 15:31:27 UTC
Created attachment 1865 [details]
systemtap 'update'

With this patch, I was able to run the sched_switch.stp script targeting qemuppc.

Please try it and let me know if it works for you.
Comment 7 Yi Zhao 2014-03-31 07:28:00 UTC
The similar issue still happens on 1.6 M5 rc1. It not only happens on qemuppc, but also on qemuarm. I think the cause is the kernel update from 3.10 to 3.14.


Git rev: master-next-1.6rc1 / 47ceed0d8d60a3ddc398738acafe3aabf4ab8c90

##########
$ crosstap root@192.168.7.2 sched_switch.stp 
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build
In file included from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/task_finder.c:17:0,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/runtime.h:192,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/runtime.h:24,
                 from /tmp/stapoOW56J/sched_switch_src.c:24:
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/task_finder2.c: In function '__stp_utrace_attach_match_filename':
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/task_finder2.c:821:11: error: incompatible types when assigning to type 'uid_t' from type 'kuid_t'
  tsk_euid = task_euid(tsk);
           ^
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/task_finder2.c: In function 'stap_start_task_finder':
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/task_finder2.c:1711:12: error: incompatible types when assigning to type 'uid_t' from type 'kuid_t'
   tsk_euid = task_euid(tsk);
            ^
In file included from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/runtime.h:198:0,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/runtime.h:24,
                 from /tmp/stapoOW56J/sched_switch_src.c:24:
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/sym.c: In function '_stp_snprint_addr':
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/sym.c:567:4: error: implicit declaration of function 'preempt_enable_no_resched' [-Werror=implicit-function-declaration]
    preempt_enable_no_resched();
    ^
In file included from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-dev/3.14++gitAUTOINC+f6370641ed_fecc3fd7d3-r0/linux/include/linux/sched.h:53:0,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-dev/3.14++gitAUTOINC+f6370641ed_fecc3fd7d3-r0/linux/include/linux/ptrace.h:5,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-dev/3.14++gitAUTOINC+f6370641ed_fecc3fd7d3-r0/linux/include/linux/ftrace.h:13,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-dev/3.14++gitAUTOINC+f6370641ed_fecc3fd7d3-r0/linux/include/linux/kprobes.h:42,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/runtime.h:24,
                 from /tmp/stapoOW56J/sched_switch_src.c:24:
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/transport/control.c: In function '_stp_ctl_write_cmd':
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto-dev/3.14++gitAUTOINC+f6370641ed_fecc3fd7d3-r0/linux/include/linux/cred.h:333:25: error: incompatible types when initializing type 'uid_t' using type 'kuid_t'
 #define current_euid()  (current_cred_xxx(euid))
                         ^
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/transport/control.c:41:15: note: in expansion of macro 'current_euid'
  uid_t euid = current_euid();
               ^
In file included from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/linux/print.c:17:0,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/print.c:17,
                 from /buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/runtime_context.h:22,
                 from /tmp/stapoOW56J/sched_switch_src.c:312:
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/transport/transport.c: In function '_stp_transport_init':
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/transport/transport.c:344:11: error: incompatible types when assigning to type 'uid_t' from type 'kuid_t'
  _stp_uid = current_uid();
           ^
/buildarea/jenkins-yocto/workspace/Yocto1.6-case316_319_compile_kernel_module/build/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime/transport/transport.c:345:11: error: incompatible types when assigning to type 'gid_t' from type 'kgid_t'
  _stp_gid = current_gid();
           ^
cc1: all warnings being treated as errors
make[3]: *** [/tmp/stapoOW56J/sched_switch_src.o] Error 1
make[2]: *** [_module_/tmp/stapoOW56J] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
##########
Comment 8 Tom Zanussi 2014-03-31 12:37:50 UTC
Is this with the above systemtap update patch?
Comment 9 Yi Zhao 2014-04-01 05:29:11 UTC
(In reply to comment #8)
> Is this with the above systemtap update patch?

Yes.

commit 94a9df269877cb5c11ad39c7bc7c3edef5a3cf08
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Fri Feb 14 10:18:08 2014 -0800

    systemtap_git: update to newer version to fix a build issue
    
    This build issue was observed with the 2.4+git version of the systemtap.
    
    .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.cxx: In function 'void validate_module_elf(Dwfl_Module*, const char*, base_query*)':
    .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.cxx:1998:10: error: 'EM_AARCH64' was not declared in this scope
    .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.cxx: In constructor 'sdt_uprobe_var_expanding_visitor::sdt_uprobe_var_expanding_visitor(systemtap_session&
    .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.cxx:5613:31: error: 'EM_AARCH64' was not declared in this scope
    
    This is a known issue, and it is already fixed in the upstream tree.
    
    Updating the recipe to get the commit which fixes the issue.
    
    (From OE-Core rev: 5170f58f4a46edead40d98f302ba3294e078c113)
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
index b87aa1a..56db7b2 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.inc
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -1,7 +1,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-SRCREV = "9190b3acfe706d3bfd66dec18133d28f98443321"
-PV = "2.4+git${SRCPV}"
+SRCREV = "508059f04842ed85d10bfbec8a9c688d57368860"
+PV = "2.5+git${SRCPV}"
 
 SRC_URI = "git://sourceware.org/git/systemtap.git \
            file://docproc-build-fix.patch \
Comment 10 Tom Zanussi 2014-04-01 12:36:23 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Is this with the above systemtap update patch?
> 
> Yes.
> 
> commit 94a9df269877cb5c11ad39c7bc7c3edef5a3cf08
> Author: Nitin A Kamble <nitin.a.kamble@intel.com>
> Date:   Fri Feb 14 10:18:08 2014 -0800
> 
>     systemtap_git: update to newer version to fix a build issue
>     
>     This build issue was observed with the 2.4+git version of the systemtap.
>     
>    
> .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.
> cxx: In function 'void validate_module_elf(Dwfl_Module*, const char*,
> base_query*)':
>    
> .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.
> cxx:1998:10: error: 'EM_AARCH64' was not declared in this scope
>    
> .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.
> cxx: In constructor
> 'sdt_uprobe_var_expanding_visitor::
> sdt_uprobe_var_expanding_visitor(systemtap_session&
>    
> .../x86_64-linux/systemtap-native/2.4+gitAUTOINC+9190b3acfe-r0/git/tapsets.
> cxx:5613:31: error: 'EM_AARCH64' was not declared in this scope
>     
>     This is a known issue, and it is already fixed in the upstream tree.
>     
>     Updating the recipe to get the commit which fixes the issue.
>     
>     (From OE-Core rev: 5170f58f4a46edead40d98f302ba3294e078c113)
>     
>     Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
>     Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc
> b/meta/recipes-kernel/systemtap/systemtap_git.inc
> index b87aa1a..56db7b2 100644
> --- a/meta/recipes-kernel/systemtap/systemtap_git.inc
> +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
> @@ -1,7 +1,7 @@
>  LICENSE = "GPLv2"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
> -SRCREV = "9190b3acfe706d3bfd66dec18133d28f98443321"
> -PV = "2.4+git${SRCPV}"
> +SRCREV = "508059f04842ed85d10bfbec8a9c688d57368860"
> +PV = "2.5+git${SRCPV}"
>  
>  SRC_URI = "git://sourceware.org/git/systemtap.git \
>             file://docproc-build-fix.patch \

No, I meant the 'systemtap 'update' patch attached above:


From e655af2c2602546c818caf858177744a2ada11f7 Mon Sep 17 00:00:00 2001
Message-Id: <e655af2c2602546c818caf858177744a2ada11f7.1396020509.git.tom.zanussi@linux.intel.com>
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Fri, 28 Mar 2014 10:19:01 -0500
Subject: [PATCH] systemtap: Move to current HEAD

This moves the systemtap recipe to the current HEAD commit, in order
to allow users to get past some bugs blocking qemuppc users.

Normally, we'd stick to a release commit, but apparently we're already
past the official 2.4 release commit and couldn't be on the 2.5
release commit since 2.5 hasn't been released yet (despite what the
PV says).

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 meta/recipes-kernel/systemtap/systemtap_git.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
index 56db7b2..db9d910 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.inc
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -1,6 +1,6 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
-SRCREV = "508059f04842ed85d10bfbec8a9c688d57368860"
+SRCREV = "ae91e3d552aff4f0e74662d055dae06ea55eb6bc"
 PV = "2.5+git${SRCPV}"
 
 SRC_URI = "git://sourceware.org/git/systemtap.git \
-- 
1.8.3.1
Comment 11 Yi Zhao 2014-04-02 06:39:45 UTC
Sorry for my mistake. I will re-test it with this patch.
Comment 12 Yi Zhao 2014-04-04 09:43:31 UTC
I tested it on 1.6 M5,rc2 with systemtap update patch. On qemuppc, qemuarm, qemux86, the sched_switch.stp could work.
Comment 13 Tom Zanussi 2014-04-04 23:07:20 UTC
Patch submitted to oe-core.
Comment 14 Tom Zanussi 2014-04-05 15:51:00 UTC
*** Bug 6118 has been marked as a duplicate of this bug. ***
Comment 16 Tom Zanussi 2014-04-07 16:45:10 UTC
*** Bug 6122 has been marked as a duplicate of this bug. ***
Comment 17 Catalin Scrieciu 2014-07-01 13:40:56 UTC
I had a similar issue while testing Yocto 1.7_M1.rc1 (poky 68824d9b8f6e290da078383316b3f4b732585f2b):

$ ./../scripts/crosstap root@192.168.7.6 sched_switch.stp -c "sleep 1"

semantic error: not accessible at this address [man error::dwarf] (0xc05e46b8, dieoffset: 0x3e6165): identifier '$prev' at /Yocto_1.7_M1_RC1/poky-68824d9b8f6e290da078383316b3f4b732585f2b/build_arm/tmp/sysroots/x86_64-linux/usr/share/systemtap/tapset/linux/scheduler.stp:144:19
        source:                 prev_priority = $prev->prio
                                                ^

semantic error: unable to find local 'new', [man error::dwarf] dieoffset 0x3e6148 in kernel, near pc 0xc05e46b8 in context_switch /Yocto_1.7_M1_RC1/poky-68824d9b8f6e290da078383316b3f4b732585f2b/build_arm/tmp/work/qemuarm-poky-linux-gnueabi/linux-yocto/3.14.5+gitAUTOINC+602be954ac_2489f1f4d7-r0/linux/kernel/sched/core.c (alternatives: $next, $prev, $rq)): identifier '$new' at :169:19
        source:                 next_priority = $new->prio
                                                ^

Pass 2: analysis failed.  [man error::pass2]
Number of similar error messages suppressed: 34.
Rerun with -v to see them.

$
Comment 18 Catalin Scrieciu 2015-04-09 15:34:03 UTC
We have encountered the same issue as above when testing Yocto 1.8 M4 RC2 (poky 33558eacc8a2d3dce3396b9ab2fd0773ac5076bc).
Comment 19 Catalin Scrieciu 2015-04-09 15:35:51 UTC
(In reply to comment #18)
> We have encountered the same issue as above when testing Yocto 1.8 M4 RC2
> (poky 33558eacc8a2d3dce3396b9ab2fd0773ac5076bc).

The issues was encountered on QemuARM.
Comment 20 Kevin Hao 2015-06-24 07:17:54 UTC
Created attachment 2561 [details]
find the yocto kernel source tree
Comment 21 Kevin Hao 2015-06-24 07:19:14 UTC
It seems that this is a compatible issue between systemtap and yocto build system. I have created a patch (attached) to fix this issue. But I am not sure this is the right fix. Assigned this to Robert to have more deep investigation.
Comment 22 Chen Qi 2015-07-01 07:40:22 UTC
(In reply to comment #21)
> It seems that this is a compatible issue between systemtap and yocto build
> system. I have created a patch (attached) to fix this issue. But I am not
> sure this is the right fix. Assigned this to Robert to have more deep
> investigation.

Hi Kevin,

I think this is the right fix.

Please make a patch and send it to OE-core if convenient.

Regards,
Chen Qi
Comment 23 Chen Qi 2015-08-04 02:01:14 UTC
Hi Kevin,

Do you have time to send the patches? If not, I can do it for you.

//Chen Qi
Comment 24 Stephen K Jolley 2015-11-19 15:52:10 UTC
This was REOPENED
Comment 25 Yi Zhao 2017-03-20 00:31:42 UTC
This issue should be fixed in 2.3 M3 rc1. It works well on qemuppc build.

Please see bug 10990 for more details.
Comment 26 Chen Qi 2017-03-23 03:18:24 UTC
It's been fixed in bug 10990 as Yi said.

*** This bug has been marked as a duplicate of bug 10990 ***