public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* fix py3example script run fail
@ 2022-07-28  9:08 yaowenbin
  0 siblings, 0 replies; only message in thread
From: yaowenbin @ 2022-07-28  9:08 UTC (permalink / raw)
  To: systemtap; +Cc: hewenliang (C), linfeilong

diff --git a/testsuite/systemtap.examples/general/tapset/python_local.stpm b/testsuite/systemtap.examples/general/tapset/python_local.stpm
--- a/testsuite/systemtap.examples/general/tapset/python_local.stpm
+++ b/testsuite/systemtap.examples/general/tapset/python_local.stpm
@@ -8,4 +8,39 @@
 @define PYTHON3_LIBRARY
 %(
-  "/usr/lib64/libpython3.4m.so.1.0"
+  "/usr/lib64/libpython3.7m.so.1.0"
 %)
+
+@define Py3DictKeysObject(object) %(
+                    @cast(@object, "PyDictKeysObject", @PYTHON3_LIBRARY)
+                    %)
+@define Py3DictKeyEntry(object) %(
+                    @cast(@object, "PyDictKeyEntry", @PYTHON3_LIBRARY)
+                    %)
+
+@define DK_SIZE(dk) %(
+    @Py3DictKeysObject(@dk)->dk_size
+%)
+@define DK_IXSIZE(dk) %(
+    %( CONFIG_64BIT == "y" %?
+        %( CONFIG_COMPAT == "y" %?
+            (@__compat_task
+             ? (@DK_SIZE(@dk) <= 0xff ? 1 : (@DK_SIZE(@dk) <= 0xffff ? 2
+: 4))
+             : (@DK_SIZE(@dk) <= 0xff ?
+                1 : (@DK_SIZE(@dk) <= 0xffff ?
+                2 : (@DK_SIZE(@dk) <= 0xffffffff ? 4 : 8))))
+        %:
+            (@DK_SIZE(@dk) <= 0xff ?
+             1 : (@DK_SIZE(@dk) <= 0xffff ?
+             2 : (@DK_SIZE(@dk) <= 0xffffffff ? 4 : 8)))
+        %)
+    %:
+        (@DK_SIZE(@dk) <= 0xff ? 1 : (@DK_SIZE(@dk) <= 0xffff ? 2 : 4))
+    %)
+%)
+
+@define DK_ENTRIES(dk) %(
+     (@choose_defined(@Py3DictKeysObject(@dk)->dk_entries,
+(&@Py3DictKeyEntry(&@Py3DictKeysObject(@dk)->dk_indices[@DK_SIZE(@dk) *
+@DK_IXSIZE(@dk)]))))
+%)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-28  9:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28  9:08 fix py3example script run fail yaowenbin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).