From nobody Sun Jan 07 16:46:26 2024 X-Original-To: dev-commits-src-main@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 4T7NPZ2V0Pz55PQX; Sun, 7 Jan 2024 16:46:26 +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 4T7NPZ22H2z490k; Sun, 7 Jan 2024 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704645986; 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=LM7DObw+D7CspW5YlVFVTqOVy1IZjMf/q0bECjk82zA=; b=u3cEcT4BL9WYyty8avO/v1JCE29xPX/rpwcUhBSikZVNNZAaw69jPoceGXtsWhPHfe5jKc kK5y8D+Hj1OZHcyYDPPlmHYtPJpV+kzbqPLx1+PZ0qQ5A+XhhoQQoI8bJ5URuPn/07iz7X 6IRHCMGOhFuJaoCtlu0DhTi3I/c3quI3EP7OjoC3KelUmQNcETIFhyPI+r/Ad1Ffdny+uG Sq6BLYAoJEcJKnYO3WS/pjhJZRKgbDu/IuZk/uI7vB9kyQukBe0QG+KpMfPlICY95yFfZF 4ETxiX9yusAGuAGfxGax/zLT81OVvu3+mUzKhc3BrJb10qSnvUsAviaQCudzag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704645986; 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=LM7DObw+D7CspW5YlVFVTqOVy1IZjMf/q0bECjk82zA=; b=n466QJzQ0lZ8KF96cOo4bzrCDkc0TQLHWwWOfvgJlGJtZrX9I0SyYioWPGSCzTGjESLTni msDyYqzJPR9tZAXlmGUuTfGPhbySQYYF6MUgKi6kxbGMnzskZvr4ml1xGWj2HGVzDwtiG/ 8B52BGqkANhEdFPoiSxHi7e+d6Ufmkh/qJ9vMYv7qB9bH0/w0vk68jDdVgVdg7wsFP39ni qwQE2Wqkb1cTflXI6syySzJwBS81OiBf4rPyXcxA4B2rxMfReaZ8UBtO1bZhiaASoPWwbW k07Mmrqfg5u5IClSvZmhl/MvG3+KIQluwASP7OYnGOTt1+IOJmZYzYjmDzb4TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704645986; a=rsa-sha256; cv=none; b=yX6Acs1cN8ZVGgy919GSGo8IeOkWdhDCDeHmvrIIHtT2s8kxwEiBRjvUwFj8+OJdjmpSfE nw8wr1+xoC03aqcpqC4FKwqk3be/c2tUjTHt7WI9HN5NzXPONXWHy+JdqVp3imvMTyKcNM 8i6tjUDpJyHdShNumJpIInZ0YvRKjW/UjmYPBP4bsCjqNdwKVoSuCOuqxGJ9cy0Q0w7/QD nLceGt4Zd74wLhBNBX23GNAycqJFpGbkyvkLh4c6HGCv++LdGGdq9hW2eP8M9QdFBwJNyB L/nSlqRNcksmMkhXX3pymDCARLetF3yQNzVTnFrFbYiwyogZncgrPqPiQHX8kQ== 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 4T7NPZ16T6zXnk; Sun, 7 Jan 2024 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 407GkQ3S012302; Sun, 7 Jan 2024 16:46:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 407GkQEO012299; Sun, 7 Jan 2024 16:46:26 GMT (envelope-from git) Date: Sun, 7 Jan 2024 16:46:26 GMT Message-Id: <202401071646.407GkQEO012299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7d35b389729e - main - dtrace/profile: Set t_dtrace_trapframe for profile probes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d35b389729ef5a3efcac75ad265139ada3f8e69 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d35b389729ef5a3efcac75ad265139ada3f8e69 commit 7d35b389729ef5a3efcac75ad265139ada3f8e69 Author: Mark Johnston AuthorDate: 2024-01-07 16:35:06 +0000 Commit: Mark Johnston CommitDate: 2024-01-07 16:46:13 +0000 dtrace/profile: Set t_dtrace_trapframe for profile probes profile provider probes fire in the context of a timer interrupt. Thus, the "regs" action can make use of the interrupt trap frame to get register values when the interrupt happened in kernel mode. Make that trap frame available when possible so that "regs" works more or less as it already does with the fbt and kinst providers. MFC after: 1 week --- sys/cddl/dev/profile/profile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 42753393a33d..677c7543795f 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -57,6 +57,8 @@ #include #include +#include + #define PROF_NAMELEN 15 #define PROF_PROFILE 0 @@ -245,12 +247,15 @@ profile_probe(profile_probe_t *prof, hrtime_t late) if (frame != NULL) { if (TRAPF_USERMODE(frame)) upc = TRAPF_PC(frame); - else + else { pc = TRAPF_PC(frame); + td->t_dtrace_trapframe = frame; + } } else if (TD_IS_IDLETHREAD(td)) pc = (uintfptr_t)&cpu_idle; dtrace_probe(prof->prof_id, pc, upc, late, 0, 0); + td->t_dtrace_trapframe = NULL; } static void