public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: yaowenbin <yaowenbin1@huawei.com>
To: <systemtap@sourceware.org>
Cc: "hewenliang (C)" <hewenliang4@huawei.com>, <linfeilong@huawei.com>
Subject: fix py3example script run fail
Date: Thu, 28 Jul 2022 17:08:37 +0800	[thread overview]
Message-ID: <c2b3f6b1-1b88-43e8-994b-e4eed5c1f462@huawei.com> (raw)

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)]))))
+%)

                 reply	other threads:[~2022-07-28  9:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2b3f6b1-1b88-43e8-994b-e4eed5c1f462@huawei.com \
    --to=yaowenbin1@huawei.com \
    --cc=hewenliang4@huawei.com \
    --cc=linfeilong@huawei.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).