From nobody Thu Mar 09 20:40:11 2023 X-Original-To: dev-commits-doc-all@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 4PXgzb2njqz3xMWC for ; Thu, 9 Mar 2023 20:40:11 +0000 (UTC) (envelope-from git@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 4PXgzb2FFLz3JSF; Thu, 9 Mar 2023 20:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678394411; 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; bh=+qiliXnOLDufIDvJX4BjZFu62dphHlzKl5u8mX77GZc=; b=MMvKQsrWZu4fiafhs30PYa4F56cQvDf54SRv+2QAZFPgdsU9VQlE/J2jb16tFEOASH57hP Enax3qZH7NjUCdjjzmmGVQ52q/Q2e6hcP7cQtnda3R3THdmZhXr8sbhTQgvtGWGX4FCiE+ GcBE0+Laml8beF6ei5rvuFRJqis47xEIW2MhE6Y+g4XHIzKROFOS6C0bW93zeRXGEXEc03 vJID26/9CWLf7MFQIlSgwObu0NiCKqhB9IcjwbiX5mkvJFK5DC3qk9XhDN13lvZ90ZxF4B HTMW/MR68182wFWO+gLx7NhX9NRvQ4YKEEoi7KPk4bdI6X8MZIerxUR0zqz2hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678394411; 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; bh=+qiliXnOLDufIDvJX4BjZFu62dphHlzKl5u8mX77GZc=; b=nrTAPI8y8IbybnnD67nZd+KVSFu3iDtQxOtpCKCdO4RvLOB/tVap2w6tE5vFIKdpxjTC19 IY45NObqAbFNGuHyScnLD+TetnZw11gEKppObpVQ2CO+xMqnOXnYgz7LdjLg/oA0RiPmDu 6f5YHVG7acwzHWlowFhdoWLBvMmyrjOHUDVKleGio11bmxU+zVDnYX7Idwe/TU+q07ZPIz vOHiO3g39rFtQwIf3b3TuiKvnF42UuQPM/gAsmoUjIbWxJh1p+V02b59RKynRm0lNZxKzJ 64pvD0J659pA7KuGR4m/fQ4JMx84q+oA69yNMor1FoF1UKeY612lvE7l2Gt8aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678394411; a=rsa-sha256; cv=none; b=w7fs7EAKAjEOOWMsnJXcpaM/hoGsUyQKi8Rz+FE7OHp1DvTi4FCwB/UVbWMjpIGbTTqx+S VzvbScM7av/zgWaEuTTGEh94lf3la5rAKH+U9P8XKxYybfMBpWQLA4pojtUvX4e95XB+X7 p8EKY1dpGD99ayPAlWXec9NZqYGkmGLP1OFfcwxNG6SpT7KQ8wr2dZnXRJQLcM3gbSkx+t yvCX5huAushAW/nnjykmtrSV5nWIACaWTe2btAHVIfpr1eJ1UGqU4K4mGWR49jRjboRdFL bQZfayzThY7PApN/TkRjL5NwtNjRycfBxoxIHEnuFJM3MSv0jdtlD5zqOogTPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4PXgzb1KTxzLyJ; Thu, 9 Mar 2023 20:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 329KeBlo033985; Thu, 9 Mar 2023 20:40:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 329KeBgj033978; Thu, 9 Mar 2023 20:40:11 GMT (envelope-from git) Date: Thu, 9 Mar 2023 20:40:11 GMT Message-Id: <202303092040.329KeBgj033978@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Pau Amma Subject: git: f622f1f7d5 - main - 2023Q1 kinst DTrace status report submission List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pauamma X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f622f1f7d54f5dc72835e6fd85786a1e19d21ce3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pauamma: URL: https://cgit.FreeBSD.org/doc/commit/?id=f622f1f7d54f5dc72835e6fd85786a1e19d21ce3 commit f622f1f7d54f5dc72835e6fd85786a1e19d21ce3 Author: Christos Margiolis AuthorDate: 2023-03-04 17:57:43 +0000 Commit: Pau Amma CommitDate: 2023-03-09 20:37:27 +0000 2023Q1 kinst DTrace status report submission Lightly copyedited from emailed original, and reformatted as 1 sentence per line. Approved by: carlavilla --- .../report-2023-01-2023-03/kinst_2023q1.adoc | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/website/content/en/status/report-2023-01-2023-03/kinst_2023q1.adoc b/website/content/en/status/report-2023-01-2023-03/kinst_2023q1.adoc new file mode 100644 index 0000000000..743081d850 --- /dev/null +++ b/website/content/en/status/report-2023-01-2023-03/kinst_2023q1.adoc @@ -0,0 +1,71 @@ +=== Improve the kinst DTrace provider + +Links: + +link:https://reviews.freebsd.org/D38825[libdtrace: implement inline function tracing] URL: link:https://reviews.freebsd.org/D38825[https://reviews.freebsd.org/D38825] + +link:https://reviews.freebsd.org/D38732[dtrace(1): add -d flag to dump D script post-dt_sugar] URL: link:https://reviews.freebsd.org/D38732[https://reviews.freebsd.org/D38732] + +Contact: Christos Margiolis + +Contact: Mark Johnston + +kinst is a new DTrace provider created by christos@ and markj@ that allows for +arbitrary instruction tracing in a kernel function. kinst has been added to the +base system in FreeBSD 14.0. + +link:https://www.freebsd.org/status/report-2022-07-2022-09/#_dtrace_instruction_level_dynamic_tracing[The 2022Q3 status report gives a brief introduction to kinst.] +We're now working on inline function tracing (see review D38825 above) -- a much-requested DTrace feature -- by using kernel DWARF and ELF info to find the call sites of each inline copy and use that information to transform D syntax by turning kinst probes of the form: + +.... + kinst::: +.... + +To: + +.... + kinst::: + kinst::: + ... +.... + +For example: + +.... + # dtrace -dn 'kinst::cam_iosched_has_more_trim:entry { printf("\t%d\t%s", pid, execname); }' + dtrace:::ERROR + { + ((self->%error) = 0x1); + } + + kinst::cam_iosched_get_trim:13 + { + printf("\t%d\t%s", pid, execname); + } + + kinst::cam_iosched_next_bio:13 + { + printf("\t%d\t%s", pid, execname); + } + + kinst::cam_iosched_schedule:40 + { + printf("\t%d\t%s", pid, execname); + } + + dtrace: description 'kinst::cam_iosched_has_more_trim:entry ' matched 4 probes + CPU ID FUNCTION:NAME + 0 81502 cam_iosched_schedule:40 2 clock + 0 81501 cam_iosched_next_bio:13 2 clock + 2 81502 cam_iosched_schedule:40 2 clock + 1 81502 cam_iosched_next_bio:13 0 kernel + 1 81503 cam_iosched_schedule:40 0 kernel + ^C +.... + +A new `-d` flag has also been added to man:dtrace[1] which dumps the D script after libdtrace has applied syntactic transformations. + +Further goals include: + +* Implement a `locals` structure in D which stores the local variables of the traced function. + For example with `kinst::foo:`, we could print the local variable `bar` by doing `print(locals->bar)` inside a D script. +* Port kinst to riscv and/or arm64. + +Sponsor: The FreeBSD Foundation