Bug 12974 - [2.6 M4 RC1] [OE-Core] Crosstap doesn't work on 2.6 M4 RC1
Summary: [2.6 M4 RC1] [OE-Core] Crosstap doesn't work on 2.6 M4 RC1
Status: RESOLVED INVALID
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: configuration (show other bugs)
Version: 2.6
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.7
Assignee: Victor Kamensky
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-11-01 07:21 UTC by pankaj yadav
Modified: 2018-12-31 06:14 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Screenshot for Cropstap issue observed in 2.6M4RC1 (26.92 KB, image/png)
2018-11-01 07:21 UTC, pankaj yadav
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description pankaj yadav 2018-11-01 07:21:20 UTC
Created attachment 4382 [details]
Screenshot for Cropstap issue observed in 2.6M4RC1

Steps to reproduce :
1. Create the trace_open.stp script as follows in the host machine: 
probe syscall.open 

{

   printf ("%s(%d) open (%s)\n", execname(), pid(), argstr)

}

2. Add 'tools-profile' and 'ssh-server-openssh' to EXTRA_IMAGE_FEATURES in local.conf
3. Build a core-image-minimal image, build systemtap-native. Start the image under qemu.
4. Make sure that the ssh service is started on the Qemu machine.
5. From the host machine poky build_dir, run "crosstap root@192.168.7.2 trace_open.stp".
6. In QEMU, try to open some applications, such as open a terminal, input some command, 
7. Check the host machine, "crosstap" has related output.
NOTE: Do not build the kernel from shared state(sstate-cache) for this to work.

Run below mentioned command on host machine : 
/data/pankajsx/2.6_M4_rc1_30_october/poky/build$ crosstap root@192.168.7.4 trace_open.stp

Actual Output : I don't see "crosstap" has related output on host machine.

Expected Output : "crosstap" should have related output on host machine.
Comment 1 pankaj yadav 2018-12-26 01:52:17 UTC
Same issue has been observed with yocto-2.7_M1.rc1 QA execution.
Comment 2 Victor Kamensky 2018-12-31 06:14:17 UTC
Hi Pankaj,

Appreciate SystemTap and crosstap testing. But the issue
you observe is not a bug. SystemTap and crosstap are working
as they supposed to: script got compiled and module is
activated. The reason why you don't see any output from such
script is because nothing in the system makes 'open'
system call, so script does not report anything. It was
a change in glibc that instead of 'open' system call 'openat'
actually used on all platforms as glibc 'open' function
implementation. So if you change your SystemTap
script to trace 'openat' system call instead of tracing
'open' system call you will see desired results:

[kamensky@kamensky-w530 build]$ cat trace_openat.stp
probe syscall.openat 
{
   printf ("%s(%d) openat (%s)\n", execname(), pid(), argstr)
}
[kamensky@kamensky-w530 build]$ crosstap root@192.168.7.2 trace_openat.stp
ls(384) openat (AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC)
ls(384) openat (AT_FDCWD, "/lib/libm.so.6", O_RDONLY|O_CLOEXEC)
ls(384) openat (AT_FDCWD, "/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC)
ls(384) openat (AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC)
ls(384) openat (AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC)

You can double check that nothing calls 'open' system call
with strace. Add it to the image and try to trace few apps -
you will see that only 'openat' system call will be issued.
For example, tracing 'cat' command:

root@qemux86-64:~# touch foo
root@qemux86-64:~# strace -o /tmp/cat.trace.txt cat foo
root@qemux86-64:~# grep open /tmp/cat.trace.txt
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "foo", O_RDONLY)       = 3
root@qemux86-64:~#

I will put this PR into RESOLVED state with INVALID resolution (it
seems correct state/resolution for non-bugs). If you disagree please
move it back to NEW with proper explanation.

Thanks,
Victor