From nobody Sun Apr 21 18:03:00 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VMx7T1fp4z5HRJB for ; Sun, 21 Apr 2024 18:03:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VMx7S5Qprz4XVM for ; Sun, 21 Apr 2024 18:03:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713722580; a=rsa-sha256; cv=none; b=LXrgyb4vbKkcaJQkgpGs9tO50j7dMZFixgWOXs2s4Jodsi1vNxsz4zhQ65tza7ct6TWX+r 4xkgE4ENrgEUXPEPKcotLhnIwCBez8sQZiV7VO7eF2dOAOR1pDxrZ0KwCq4DSmL9Z48vc9 1zqmv1zWtxEqg8JSOZAzHMKdUbEbBcobWtKApFqKo8yLwERYcKlgA720aUV6vdcWUa51Dw HHP5DYX/ZsRWS9CWwTPPIHJmTj4L7U1QzalVxSQrC4mLttOfNohvHuqVQRgG+dop3pzutp yypErW02W03XWCBUr3DdaRDf3Q4EZc/2I7obiYS6N9FxXFJz7iURhWinReg33w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713722580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JwU89P4Y1u9Xn3CyJvdJXqbOd/lFYuBNFD/wgaFThUs=; b=S2HaezV1Fb6/l4Jlij7T4B56H3Pp5HELGZw/Qt4lQSuYtwc1z/e4Uuo7rcePem99DBrg9N 2I/qOr78e1bfb3xe/aCJ015xBCSD/uG8BK1A15OVJ16ETFFgffazYaTzHJv8IGJZHDsnz6 4Tl5nadVHfEz8yhnDBkOzUwfJGSdP6YiTYUec5fmhvdpO5yTLuaXI1xSb4LI88aOOsjXUX cvdvxyl2f31rqUzOJ8vpz/MiT+UFwlR6WF6CvSYTTgF2fIqAzYxQ20qvq4zFo3GvE/rSic DFc9CN1SOQQAEFbZcZ/lyvgU2dcUaNVDdHjfWXgG9Q/6STbhqKIR/dVWrVLZdA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VMx7S52KczFxn for ; Sun, 21 Apr 2024 18:03:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 43LI307O064420 for ; Sun, 21 Apr 2024 18:03:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43LI30km064414 for bugs@FreeBSD.org; Sun, 21 Apr 2024 18:03:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 278489] dtrace; pid probe; unable to match constructor functions Date: Sun, 21 Apr 2024 18:03:00 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: martin@bxlr.sk X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278489 --- Comment #2 from martin --- Indeed evaltime works in that scenario. The issue was originally shared on forums here: https://forums.freebsd.org/threads/tracing-shared-library-functions-using-d= trace.93172/ I tried to simplified is as much as possible before opening PR. I didn't te= st it with the evaltime for my simplified version. Original issue is that these constructors are not matched on custom librari= es. Simple "mylib" demo lib: #include #include "mylib.h" static int rc; void __attribute__((constructor)) mysetup(void) { printf("*** %s exec\n", __func__); rc =3D 666; } void __attribute__((destructor)) leave(void) { rc =3D 0; } int hello(char* s) { printf("%s: %s\n", __func__, s); return rc; } Still lists the functions as expected: # dtrace -ln 'pid$target:mylib.so::entry' -c ./test *** mysetup exec hidden stuff ID PROVIDER MODULE FUNCTION NAME 82966 pid1096 mylib.so __do_global_dtors_aux entry 82967 pid1096 mylib.so register_classes entry 82968 pid1096 mylib.so __do_global_ctors_aux entry 82969 pid1096 mylib.so mysetup entry 82970 pid1096 mylib.so leave entry 82971 pid1096 mylib.so hello entry But doesn't match it: # dtrace -n 'pid$target:mylib.so::entry' -c ./test *** mysetup exec hidden stuff dtrace: description 'pid$target:mylib.so::entry' matched 6 probes hello: my hello program return value: 666 dtrace: pid 1098 has exited CPU ID FUNCTION:NAME 7 82971 hello:entry 7 82970 leave:entry 7 82966 __do_global_dtors_aux:entry Specifying evaltime fails to match any probes: # dtrace -x evaltime=3Dexec -n 'pid$target:mylib.so::entry' -c ./test dtrace: invalid probe specifier pid$target:mylib.so::entry: probe descripti= on pid1100:mylib.so::entry does not match any probes --=20 You are receiving this mail because: You are the assignee for the bug.=