From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FF31392CE6C; Mon, 12 Dec 2022 12:11:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FF31392CE6C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670847063; bh=8PSXaq0ISvdDR/BxI/KPtQt7TqcSQPGDcAzedKWsu+8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wosXDYxyRfN2GZcFA3/R+XQJXxrHvtOZ5ZZU+S/ZH/M+ybkKlrmT1Jnnk0N5SbO4p 2u4SjAod05IdwwZsicLRhP77CyzJ3hbQyyG2WzCsikHqti80yhCoi2rcbp7dp2E55+ lWtB7yrq02k4mJF6X5+vjC1pSwdYnne7BFJwdmGs= From: "mcermak at redhat dot com" 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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mcermak at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29832 --- Comment #1 from Martin Cermak --- 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:l= ong process("/usr/lib64/libpython3.11.so.1.0").mark("function__entry") $arg1:lo= ng $arg2:long $arg3:long process("/usr/lib64/libpython3.11.so.1.0").mark("function__return") $arg1:l= ong $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:lo= ng $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 =3D user_string($arg1); which in case of the .mark("function__entry") probe see= ms to give 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 =3D user_string($arg1); println(filename)}' -c 'python3 ./test.py >/dev/null' 38 x86_64 # --=20 You are receiving this mail because: You are the assignee for the bug.=