public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mcermak at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/29832] probe python.function.entry does not get hits (while .return does)
Date: Mon, 12 Dec 2022 12:11:02 +0000	[thread overview]
Message-ID: <bug-29832-6586-r56gWtZHyb@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29832-6586@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29832

--- Comment #1 from Martin Cermak <mcermak at redhat dot com> ---
SystemTap static markers are present in the built binary:

38 x86_64 # readelf -S /usr/lib64/libpython3.11.so.1.0 | grep .note.stapsdt
  [29] .note.stapsdt     NOTE             0000000000000000  0051eeb8
38 x86_64 # readelf -n /usr/lib64/libpython3.11.so.1.0 | fgrep -B2 -A2
function__
fgrep: warning: fgrep is obsolescent; using grep -F
  stapsdt              0x00000046       NT_STAPSDT (SystemTap probe
descriptors)
    Provider: python
    Name: function__return
    Location: 0x0000000000184698, Base: 0x000000000035dce8, Semaphore:
0x000000000051eeb4
    Arguments: 8@%rbp 8@%r12 -4@%eax
  stapsdt              0x00000045       NT_STAPSDT (SystemTap probe
descriptors)
    Provider: python
    Name: function__entry
    Location: 0x00000000001846d2, Base: 0x000000000035dce8, Semaphore:
0x000000000051eeb6
    Arguments: 8@%rbp 8@%r12 -4@%eax
38 x86_64 #

Systemtap can see them:

38 x86_64 # stap -L 'process("/usr/lib*/libpython*.so*").mark("*")'
process("/usr/lib64/libpython3.11.so.1.0").mark("audit") $arg1:long $arg2:long
process("/usr/lib64/libpython3.11.so.1.0").mark("function__entry") $arg1:long
$arg2:long $arg3:long
process("/usr/lib64/libpython3.11.so.1.0").mark("function__return") $arg1:long
$arg2:long $arg3:long
process("/usr/lib64/libpython3.11.so.1.0").mark("gc__done") $arg1:long
process("/usr/lib64/libpython3.11.so.1.0").mark("gc__start") $arg1:long
process("/usr/lib64/libpython3.11.so.1.0").mark("import__find__load__done")
$arg1:long $arg2:long
process("/usr/lib64/libpython3.11.so.1.0").mark("import__find__load__start")
$arg1:long
process("/usr/lib64/libpython3.11.so.1.0").mark("line") $arg1:long $arg2:long
$arg3:long
38 x86_64 #
38 x86_64 #

Systemtap can hit them both

38 x86_64 #
38 x86_64 # stap -e 'probe
process("/usr/lib64/libpython3.11.so.1.0").mark("function__return") {log(pp())
exit()}' -c 'python3 ./test.py'
process("/usr/lib64/libpython3.11.so.1.0").statement(0x184698)
0.0052528132240494685
38 x86_64 # stap -e 'probe
process("/usr/lib64/libpython3.11.so.1.0").mark("function__entry") {log(pp())
exit()}' -c 'python3 ./test.py'
process("/usr/lib64/libpython3.11.so.1.0").statement(0x1846d2)
0.470956593448124
38 x86_64 #

The problem appears to be with arguments, specifically with filename =
user_string($arg1); which in case of the .mark("function__entry") probe seems
to give <frozen getpath> instead of the actual path
/usr/lib64/python3.11/random.py

38 x86_64 # stap -we 'probe
process("/usr/lib*/libpython*.so*").mark("function__entry") {filename =
user_string($arg1); println(filename)}' -c 'python3 ./test.py >/dev/null'
<frozen getpath>
<frozen getpath>
<frozen _collections_abc>
<frozen _collections_abc>
<frozen _collections_abc>
38 x86_64 #

-- 
You are receiving this mail because:
You are the assignee for the bug.

  reply	other threads:[~2022-12-12 12:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 12:31 [Bug runtime/29832] New: " mcermak at redhat dot com
2022-12-12 12:11 ` mcermak at redhat dot com [this message]
2022-12-12 12:22 ` [Bug runtime/29832] " mcermak at redhat dot com
2022-12-13  9:28 ` mcermak at redhat dot com
2022-12-13 16:22 ` mcermak at redhat dot com
2022-12-14  8:31 ` mcermak at redhat dot com

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=bug-29832-6586-r56gWtZHyb@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --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).