[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH 3/3] oeqa/runtime/stap: improve systemtap test
From:       "Ross Burton" <ross () burtonini ! com>
Date:       2022-01-31 13:54:08
Message-ID: 20220131135408.2857460-3-ross.burton () arm ! com
[Download RAW message or body]

Content-Transfer-Encoding: quoted-printable

Split the test up into compile and execute phases, as the stap binary
is known to be quite memory-hungry and this can result in the probe
being unable to allocate enough memory for the buffers it needs.

If the test fails, dump the dmesg as any useful messages will be there.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oeqa/runtime/cases/stap.py | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oeqa/runtime/cases/stap.py \
b/meta/lib/oeqa/runtime/cases/stap.py index 615c290ce61..480eaabf2db 100644
--- a/meta/lib/oeqa/runtime/cases/stap.py
+++ b/meta/lib/oeqa/runtime/cases/stap.py
@@ -14,11 +14,19 @@ class StapTest(OERuntimeTestCase):
     @OEHasPackage(['gcc-symlinks'])
     @OEHasPackage(['kernel-devsrc'])
     def test_stap(self):
-        cmd = 'make -C /usr/src/kernel scripts prepare'
-        status, output = self.target.run(cmd, 900)
-        self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
+        try:
+            cmd = 'make -j -C /usr/src/kernel scripts prepare'
+            status, output = self.target.run(cmd, 900)
+            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
 
-        cmd = 'stap -v --disable-cache -DSTP_NO_VERREL_CHECK -s1 -e \'probe oneshot \
                { print("Hello, "); println("world!") }\''
-        status, output = self.target.run(cmd, 900)
-        self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
-        self.assertIn('Hello, world!', output, msg='\n'.join([cmd, output]))
+            cmd = 'stap -v -p4 -m stap-hello --disable-cache -DSTP_NO_VERREL_CHECK \
-e \'probe oneshot { print("Hello, "); println("SystemTap!") }\'' +            \
status, output = self.target.run(cmd, 900) +            self.assertEqual(status, 0, \
msg='\n'.join([cmd, output])) +
+            cmd = 'staprun -v -R -b1 stap-hello.ko'
+            self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
+            self.assertIn('Hello, SystemTap!', output, msg='\n'.join([cmd, output]))
+        except:
+            status, dmesg = self.target.run('dmesg')
+            if status == 0:
+                print(dmesg)
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161127): https://lists.openembedded.org/g/openembedded-core/message/161127
Mute This Topic: https://lists.openembedded.org/mt/88807664/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic