From nobody Fri Feb 11 14:23:47 2022 X-Original-To: dtrace@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 37EA419BF72E for ; Fri, 11 Feb 2022 14:23:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JwG7q02bVz4YqJ for ; Fri, 11 Feb 2022 14:23:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x835.google.com with SMTP id t1so9116438qtq.13 for ; Fri, 11 Feb 2022 06:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Fh6nHCnGo8mS7leg8JIHj21bdKABASYq087fQsIe7pY=; b=XMgOgdmmbRoEvwHniSmJeQh/jBCrqTUbPOJLluDhJKm0uX/Fo/UNJs1yvUV+kWsTtz 8YcUCy0NdM76WG4WPBXm+4UHZUbEyJB8CRYpUYJ+2gjdOV62fZguP+cNgYgBNjT7BbX1 TqCTZz9FKLekoysMysZW/kBWNGrSr1Za1iKGFh5xiccW8NgMWsXkvcvtPXyj6uCusVN4 P7UIy+farWoDfX7mgPFjUPgh/XID+zu74snmjfRaYDtEkwE0VLCFtUee2xngT6FvQt2x n2ws9OsaB4qBhl3UFSCmj1PZaMy/HhdbIGSgUoxRiy1/7ga9A8c3GJFCN/JzVl7+Cht4 fBBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=Fh6nHCnGo8mS7leg8JIHj21bdKABASYq087fQsIe7pY=; b=69tA02jHOQHOhU6snpJixfqc3koTxR/ChFjONa4F9v1KSVf/4qRwNhcqPL57W+/epq AcJl/eFlsiyPRAmk5hc/LAEpGW9uORopAjXFRG2eNfJ3PAu2WrBLD10Y2bpUSu+I9eXo SzHbCDeHJw7NobessPuQYLmh2gxYsyjdc5NSON6RP98r07gNf73q78/FbYp+ILeLE2Od mla+4GviO4prZRkKP8El6umTavrqsnLRBHqot7p6ymNiA9bO27df2arWI9hCxWOEh/5Z OPNoDp9DEMlh8S33hW7iIfs0rReYk+yPWnUlv3sPCT7ZqIUY/Sn2eUDxLT3b4i9rDxQh IZVg== X-Gm-Message-State: AOAM532l6MFzhlPaCXVKQl759PzSjWvDVWdaGkUmo4ig/jP0wqBB2P8K 5ALM4Zkf9L7ffd0A1fDY1VW/ArLsrfY= X-Google-Smtp-Source: ABdhPJyw1Pdcnj06D+60aR7OQuHBy0Y+o7Mry/aoCdgnE+cgK1ox6+y1XOHToizUpO+OEw6lKQlhIA== X-Received: by 2002:a05:622a:64e:: with SMTP id a14mr1209857qtb.212.1644589430356; Fri, 11 Feb 2022 06:23:50 -0800 (PST) Received: from nuc (198-84-189-58.cpe.teksavvy.com. [198.84.189.58]) by smtp.gmail.com with ESMTPSA id h9sm12037803qkn.121.2022.02.11.06.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Feb 2022 06:23:49 -0800 (PST) Date: Fri, 11 Feb 2022 09:23:47 -0500 From: Mark Johnston To: "Bjoern A. Zeeb" Cc: dtrace@freebsd.org Subject: Re: DTrace, kernel loader, unknown probes, enable on load? Message-ID: References: List-Id: A discussion list for developers working on DTrace in FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-dtrace List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-dtrace@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4JwG7q02bVz4YqJ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=XMgOgdmm; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::835 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dtrace@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::835:from]; MLMMJ_DEST(0.00)[dtrace]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, Feb 11, 2022 at 02:10:30PM +0000, Bjoern A. Zeeb wrote: > Hi, > > one of the drawbacks of Dtrace (and other tracing frameworks out there > on various OSes) is that they do need a list of probes upfront before > they can enable. The probes don't have to exist, add -Z to the dtrace(1) parameters. > Say I want to trace a kernel module from the moment it is loaded, that > is currently not possible. So something like: # dtrace -n 'fbt::coretemp_identify:entry {stack();}' -Z # kldload coretemp ought to work, I think, but it doesn't. It's been a while since I looked at this code but I think it might be related to the unimplemented (on FreeBSD) portion of dtrace_probe_provide(). IIRC that's due to a lock order reversal... > What I am wondering is how hard it would be to "ignore" unknown probes > but enable them the moment on loading matching ones. I assume that > will probably need a callback through user space to complicate things > but it should not be impossible. > > In case anyone has some spare time to draft this up, I'll be happily a > first tester; otherwise the idea is out at least for someone to find > it one day ... > > Lots of health, > /bz > > -- > Bjoern A. Zeeb r15:7 >