From owner-dev-commits-src-branches@freebsd.org Mon Apr 19 19:21:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B345FCA1F; Mon, 19 Apr 2021 19:21:47 +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 4FPGs737mlz4lWy; Mon, 19 Apr 2021 19:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5D85324C36; Mon, 19 Apr 2021 19:21:47 +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 13JJLloe012874; Mon, 19 Apr 2021 19:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JJLlnT012873; Mon, 19 Apr 2021 19:21:47 GMT (envelope-from git) Date: Mon, 19 Apr 2021 19:21:47 GMT Message-Id: <202104191921.13JJLlnT012873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c20cdf8c1239 - stable/12 - pf: Add static DTrace probe points MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c20cdf8c1239efa5d0f3ce14d077b4e6e41daa6a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 19:21:47 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c20cdf8c1239efa5d0f3ce14d077b4e6e41daa6a commit c20cdf8c1239efa5d0f3ce14d077b4e6e41daa6a Author: Kristof Provost AuthorDate: 2021-04-02 13:53:34 +0000 Commit: Kristof Provost CommitDate: 2021-04-19 08:20:09 +0000 pf: Add static DTrace probe points These two have proven to be useful during debugging. We may as well keep them permanently. Others will be added as their utility becomes clear. Reviewed by: gnn MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D29555 (cherry picked from commit f4c02909167b6f791df470afddfe31cabf009c4d) --- sys/netpfil/pf/pf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 155d23c9cfe1..2666fd1155ab 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -113,6 +114,15 @@ __FBSDID("$FreeBSD$"); #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x +SDT_PROVIDER_DEFINE(pf); +SDT_PROBE_DEFINE4(pf, ip, test, done, "int", "int", "struct pf_krule *", + "struct pf_state *"); +SDT_PROBE_DEFINE4(pf, ip, test6, done, "int", "int", "struct pf_krule *", + "struct pf_state *"); +SDT_PROBE_DEFINE5(pf, ip, state, lookup, "struct pfi_kkif *", + "struct pf_state_key_cmp *", "int", "struct pf_pdesc *", + "struct pf_state *"); + /* * Global variables */ @@ -327,6 +337,7 @@ VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); #define STATE_LOOKUP(i, k, d, s, pd) \ do { \ (s) = pf_find_state((i), (k), (d)); \ + SDT_PROBE5(pf, ip, state, lookup, i, k, d, pd, (s)); \ if ((s) == NULL) \ return (PF_DROP); \ if (PACKET_LOOPED(pd)) \ @@ -6404,6 +6415,8 @@ done: if (s) PF_STATE_UNLOCK(s); + SDT_PROBE4(pf, ip, test, done, action, reason, r, s); + return (action); } #endif /* INET */ @@ -6815,6 +6828,8 @@ done: (mtag = m_tag_find(m, PF_REASSEMBLED, NULL)) != NULL) action = pf_refragment6(ifp, m0, mtag); + SDT_PROBE4(pf, ip, test6, done, action, reason, r, s); + return (action); } #endif /* INET6 */