All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] systemtap runtime test, ping for outstanding systemtap fixes
@ 2018-03-22 17:53 Victor Kamensky
  2018-03-22 17:53 ` [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap Victor Kamensky
  2018-03-23 13:32 ` [PATCH] systemtap runtime test, ping for outstanding systemtap fixes Burton, Ross
  0 siblings, 2 replies; 5+ messages in thread
From: Victor Kamensky @ 2018-03-22 17:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin, Yeoh Ee Peng

Hi Folks,

Based on my conversation with Richard during conference please find
patch that does native SystemTap stap basic test. Note it is for native
stap use. It is not SystemTap cross compilation test that Ee Peng
is trying to cover in [1]. Actually, I wrote this small test before
I saw message from Ee Peng for crosstap test, but I did not have
time to post it.

Note native SystemTap stap run on qemu machine only feasible on x86
qemu. IMO it would run too long on qemu target with other CPU types.
Test should be executed against something like core-image-lsb-sdk
image, otherwise it would be skipped.

Also, could someone, if possible, please merge outstanding fixes for
systemtap [2] and [3]. Khem did ack on both a while back. Currently
with 4.15 kernel in openembedded-core systemtap in native or cross
mode is broken. Test I am posting would catch current breakage. When
[3] is applied test would pass.

[1] http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148972.html

[2] http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148348.html

[3] http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148349.html

Thanks,
Victor

Victor Kamensky (1):
  oeqa/runtime/stap.py: add runtime test for systemtap

 meta/lib/oeqa/runtime/cases/stap.py   | 33 +++++++++++++++++++++++++++++++++
 meta/lib/oeqa/runtime/files/hello.stp |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/lib/oeqa/runtime/cases/stap.py
 create mode 100644 meta/lib/oeqa/runtime/files/hello.stp

-- 
2.7.4



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap
  2018-03-22 17:53 [PATCH] systemtap runtime test, ping for outstanding systemtap fixes Victor Kamensky
@ 2018-03-22 17:53 ` Victor Kamensky
  2018-03-26 16:05   ` Burton, Ross
  2018-03-23 13:32 ` [PATCH] systemtap runtime test, ping for outstanding systemtap fixes Burton, Ross
  1 sibling, 1 reply; 5+ messages in thread
From: Victor Kamensky @ 2018-03-22 17:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin, Yeoh Ee Peng

Add runtime test for stap to test basic SystemTap
operations: can compile very basic module and run on
target device.

Signed-off-by: Victor Kamensky <kamensky@cisco.com>
---
 meta/lib/oeqa/runtime/cases/stap.py   | 33 +++++++++++++++++++++++++++++++++
 meta/lib/oeqa/runtime/files/hello.stp |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/lib/oeqa/runtime/cases/stap.py
 create mode 100644 meta/lib/oeqa/runtime/files/hello.stp

diff --git a/meta/lib/oeqa/runtime/cases/stap.py b/meta/lib/oeqa/runtime/cases/stap.py
new file mode 100644
index 0000000..005da71
--- /dev/null
+++ b/meta/lib/oeqa/runtime/cases/stap.py
@@ -0,0 +1,33 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class StapTest(OERuntimeTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp')
+        dst = '/tmp/hello.stp'
+        cls.tc.target.copyTo(src, dst)
+
+    @classmethod
+    def tearDownClass(cls):
+        files = '/tmp/hello.stp'
+        cls.tc.target.run('rm %s' % files)
+
+    @OETestID(1652)
+    @skipIfNotFeature('tools-profile',
+                      'Test requires tools-profile to be in IMAGE_FEATURES')
+    @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module'])
+    def test_stap(self):
+        cmds = [
+            'cd /usr/src/kernel && make scripts',
+            'cd /lib/modules/* && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)',
+            'stap --disable-cache /tmp/hello.stp'
+            ]
+        for cmd in cmds:
+            status, output = self.target.run(cmd, 900)
+            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
diff --git a/meta/lib/oeqa/runtime/files/hello.stp b/meta/lib/oeqa/runtime/files/hello.stp
new file mode 100644
index 0000000..3677147
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/hello.stp
@@ -0,0 +1 @@
+probe oneshot { println("hello world") }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] systemtap runtime test, ping for outstanding systemtap fixes
  2018-03-22 17:53 [PATCH] systemtap runtime test, ping for outstanding systemtap fixes Victor Kamensky
  2018-03-22 17:53 ` [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap Victor Kamensky
@ 2018-03-23 13:32 ` Burton, Ross
  1 sibling, 0 replies; 5+ messages in thread
From: Burton, Ross @ 2018-03-23 13:32 UTC (permalink / raw)
  To: Victor Kamensky; +Cc: Alexander Kanavin, Yeoh Ee Peng, OE-core

Hi Victor,

Sorry for the delay in these, it may not have been obvious from the
list but M3 has been a struggle and then it was ELC.  I'll put these
on my list to review today.

Ross

On 22 March 2018 at 17:53, Victor Kamensky <kamensky@cisco.com> wrote:
> Hi Folks,
>
> Based on my conversation with Richard during conference please find
> patch that does native SystemTap stap basic test. Note it is for native
> stap use. It is not SystemTap cross compilation test that Ee Peng
> is trying to cover in [1]. Actually, I wrote this small test before
> I saw message from Ee Peng for crosstap test, but I did not have
> time to post it.
>
> Note native SystemTap stap run on qemu machine only feasible on x86
> qemu. IMO it would run too long on qemu target with other CPU types.
> Test should be executed against something like core-image-lsb-sdk
> image, otherwise it would be skipped.
>
> Also, could someone, if possible, please merge outstanding fixes for
> systemtap [2] and [3]. Khem did ack on both a while back. Currently
> with 4.15 kernel in openembedded-core systemtap in native or cross
> mode is broken. Test I am posting would catch current breakage. When
> [3] is applied test would pass.
>
> [1] http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148972.html
>
> [2] http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148348.html
>
> [3] http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148349.html
>
> Thanks,
> Victor
>
> Victor Kamensky (1):
>   oeqa/runtime/stap.py: add runtime test for systemtap
>
>  meta/lib/oeqa/runtime/cases/stap.py   | 33 +++++++++++++++++++++++++++++++++
>  meta/lib/oeqa/runtime/files/hello.stp |  1 +
>  2 files changed, 34 insertions(+)
>  create mode 100644 meta/lib/oeqa/runtime/cases/stap.py
>  create mode 100644 meta/lib/oeqa/runtime/files/hello.stp
>
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap
  2018-03-22 17:53 ` [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap Victor Kamensky
@ 2018-03-26 16:05   ` Burton, Ross
  2018-04-02 16:41     ` Victor Kamensky
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2018-03-26 16:05 UTC (permalink / raw)
  To: Victor Kamensky; +Cc: OE-core

On the autobuilder:

| NOTE: FAIL [15.139s]: test_stap (stap.StapTest)
| NOTE: ----------------------------------------------------------------------
| NOTE: Traceback (most recent call last):
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/core/decorator/__init__.py",
line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/core/decorator/__init__.py",
line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/core/decorator/__init__.py",
line 32, in wrapped_f
|     return func(*args, **kwargs)
|   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/runtime/cases/stap.py",
line 33, in test_stap
|     self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
| AssertionError: 1 != 0 : stap --disable-cache /tmp/hello.stp
| ERROR: module version mismatch (#1 SMP PREEMPT Mon Mar 26 14:41:21
UTC 2018 vs #1 SMP PREEMPT Mon Mar 26 14:03:27 GMT 2018), release
4.14.24-yocto-standard
| WARNING: /usr/bin/staprun exited with status: 1
| Pass 5: run failed.  [man error::pass5]

Is this systemtap-uprobes not being rebuilt when it should?

Ross

On 22 March 2018 at 17:53, Victor Kamensky <kamensky@cisco.com> wrote:
> Add runtime test for stap to test basic SystemTap
> operations: can compile very basic module and run on
> target device.
>
> Signed-off-by: Victor Kamensky <kamensky@cisco.com>
> ---
>  meta/lib/oeqa/runtime/cases/stap.py   | 33 +++++++++++++++++++++++++++++++++
>  meta/lib/oeqa/runtime/files/hello.stp |  1 +
>  2 files changed, 34 insertions(+)
>  create mode 100644 meta/lib/oeqa/runtime/cases/stap.py
>  create mode 100644 meta/lib/oeqa/runtime/files/hello.stp
>
> diff --git a/meta/lib/oeqa/runtime/cases/stap.py b/meta/lib/oeqa/runtime/cases/stap.py
> new file mode 100644
> index 0000000..005da71
> --- /dev/null
> +++ b/meta/lib/oeqa/runtime/cases/stap.py
> @@ -0,0 +1,33 @@
> +import os
> +
> +from oeqa.runtime.case import OERuntimeTestCase
> +from oeqa.core.decorator.depends import OETestDepends
> +from oeqa.core.decorator.oeid import OETestID
> +from oeqa.core.decorator.data import skipIfNotFeature
> +
> +class StapTest(OERuntimeTestCase):
> +
> +    @classmethod
> +    def setUpClass(cls):
> +        src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp')
> +        dst = '/tmp/hello.stp'
> +        cls.tc.target.copyTo(src, dst)
> +
> +    @classmethod
> +    def tearDownClass(cls):
> +        files = '/tmp/hello.stp'
> +        cls.tc.target.run('rm %s' % files)
> +
> +    @OETestID(1652)
> +    @skipIfNotFeature('tools-profile',
> +                      'Test requires tools-profile to be in IMAGE_FEATURES')
> +    @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module'])
> +    def test_stap(self):
> +        cmds = [
> +            'cd /usr/src/kernel && make scripts',
> +            'cd /lib/modules/* && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)',
> +            'stap --disable-cache /tmp/hello.stp'
> +            ]
> +        for cmd in cmds:
> +            status, output = self.target.run(cmd, 900)
> +            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
> diff --git a/meta/lib/oeqa/runtime/files/hello.stp b/meta/lib/oeqa/runtime/files/hello.stp
> new file mode 100644
> index 0000000..3677147
> --- /dev/null
> +++ b/meta/lib/oeqa/runtime/files/hello.stp
> @@ -0,0 +1 @@
> +probe oneshot { println("hello world") }
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap
  2018-03-26 16:05   ` Burton, Ross
@ 2018-04-02 16:41     ` Victor Kamensky
  0 siblings, 0 replies; 5+ messages in thread
From: Victor Kamensky @ 2018-04-02 16:41 UTC (permalink / raw)
  To: Bruce Ashfield, Richard Purdie, Burton, Ross; +Cc: OE-core



On Mon, 26 Mar 2018, Burton, Ross wrote:

> On the autobuilder:
>
> | NOTE: FAIL [15.139s]: test_stap (stap.StapTest)
> | NOTE: ----------------------------------------------------------------------
> | NOTE: Traceback (most recent call last):
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 32, in wrapped_f
> |     return func(*args, **kwargs)
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 32, in wrapped_f
> |     return func(*args, **kwargs)
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/core/decorator/__init__.py",
> line 32, in wrapped_f
> |     return func(*args, **kwargs)
> |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-rpm-non-rpm/build/meta/lib/oeqa/runtime/cases/stap.py",
> line 33, in test_stap
> |     self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
> | AssertionError: 1 != 0 : stap --disable-cache /tmp/hello.stp
> | ERROR: module version mismatch (#1 SMP PREEMPT Mon Mar 26 14:41:21
> UTC 2018 vs #1 SMP PREEMPT Mon Mar 26 14:03:27 GMT 2018), release
> 4.14.24-yocto-standard
> | WARNING: /usr/bin/staprun exited with status: 1
> | Pass 5: run failed.  [man error::pass5]
>
> Is this systemtap-uprobes not being rebuilt when it should?

systemtap-uprobes should not be used nowdays.

Does anyone have pointer to what autobuilder is executing?

Above message indicates that version of kernel that is running
'uname -v' does not match version string recorded in
/usr/src/kernel/include/generated/compile.h (which is part of
kernel-devsrc package). Usually such version check is performed
by kernel CONFIG_MODVERSIONS, which is not enabled in OE build.
SystemTap specifically adds its own kernel version check (the
one firing above) and it could be disabled through command
line parameter.

It is easy to reproduce above error by building core-image-lsb-sdk,
then running 'bitbake -c cleansstate linux-yocto' and rebuilding
core-image-lsb-sdk image again. In resulting image 'uname -v'
will not match UTS_VERSION from
/usr/src/kernel/include/generated/compile.h.

I.e now even kernel-devsrc is pulling information from virtual/kernel,
kernel-devsrc is not rebuilt even if virtual/kernel is
rebuilt. IMHO it should be rebuilt. But is it by design or something
does not work, I cannot tell. In kernel-devsrc there are statements like
'do_install[depends] += "virtual/kernel:do_install"', but whether
those just build ordering statement or whether they should
trigger rebuild if "virtual/kernel:do_install" is newer is not clear.

For now I'll modify stap test patch and call stap with kernel version
check disabled assuming that running kernel and kernel-devsrc always
would be close enough to run without problems. But it would be great if
folks could clarify rebuild dependency rule between virtual/kernel
and kernel-devsrc.

Thanks,
Victor

> Ross
>
> On 22 March 2018 at 17:53, Victor Kamensky <kamensky@cisco.com> wrote:
>> Add runtime test for stap to test basic SystemTap
>> operations: can compile very basic module and run on
>> target device.
>>
>> Signed-off-by: Victor Kamensky <kamensky@cisco.com>
>> ---
>>  meta/lib/oeqa/runtime/cases/stap.py   | 33 +++++++++++++++++++++++++++++++++
>>  meta/lib/oeqa/runtime/files/hello.stp |  1 +
>>  2 files changed, 34 insertions(+)
>>  create mode 100644 meta/lib/oeqa/runtime/cases/stap.py
>>  create mode 100644 meta/lib/oeqa/runtime/files/hello.stp
>>
>> diff --git a/meta/lib/oeqa/runtime/cases/stap.py b/meta/lib/oeqa/runtime/cases/stap.py
>> new file mode 100644
>> index 0000000..005da71
>> --- /dev/null
>> +++ b/meta/lib/oeqa/runtime/cases/stap.py
>> @@ -0,0 +1,33 @@
>> +import os
>> +
>> +from oeqa.runtime.case import OERuntimeTestCase
>> +from oeqa.core.decorator.depends import OETestDepends
>> +from oeqa.core.decorator.oeid import OETestID
>> +from oeqa.core.decorator.data import skipIfNotFeature
>> +
>> +class StapTest(OERuntimeTestCase):
>> +
>> +    @classmethod
>> +    def setUpClass(cls):
>> +        src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp')
>> +        dst = '/tmp/hello.stp'
>> +        cls.tc.target.copyTo(src, dst)
>> +
>> +    @classmethod
>> +    def tearDownClass(cls):
>> +        files = '/tmp/hello.stp'
>> +        cls.tc.target.run('rm %s' % files)
>> +
>> +    @OETestID(1652)
>> +    @skipIfNotFeature('tools-profile',
>> +                      'Test requires tools-profile to be in IMAGE_FEATURES')
>> +    @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module'])
>> +    def test_stap(self):
>> +        cmds = [
>> +            'cd /usr/src/kernel && make scripts',
>> +            'cd /lib/modules/* && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)',
>> +            'stap --disable-cache /tmp/hello.stp'
>> +            ]
>> +        for cmd in cmds:
>> +            status, output = self.target.run(cmd, 900)
>> +            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
>> diff --git a/meta/lib/oeqa/runtime/files/hello.stp b/meta/lib/oeqa/runtime/files/hello.stp
>> new file mode 100644
>> index 0000000..3677147
>> --- /dev/null
>> +++ b/meta/lib/oeqa/runtime/files/hello.stp
>> @@ -0,0 +1 @@
>> +probe oneshot { println("hello world") }
>> --
>> 2.7.4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-02 16:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 17:53 [PATCH] systemtap runtime test, ping for outstanding systemtap fixes Victor Kamensky
2018-03-22 17:53 ` [PATCH] oeqa/runtime/stap.py: add runtime test for systemtap Victor Kamensky
2018-03-26 16:05   ` Burton, Ross
2018-04-02 16:41     ` Victor Kamensky
2018-03-23 13:32 ` [PATCH] systemtap runtime test, ping for outstanding systemtap fixes Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.