git: 4601b3e04d5e - stable/14 - socket: Only log splice structs to ktrace if KTR_STRUCT is configured

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 17 Oct 2024 16:16:41 UTC
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=4601b3e04d5e30fa6c4432feeb2cb09a597cf763

commit 4601b3e04d5e30fa6c4432feeb2cb09a597cf763
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-09-20 11:40:31 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-10-17 15:49:12 +0000

    socket: Only log splice structs to ktrace if KTR_STRUCT is configured
    
    Fixes:  a1da7dc1cdad ("socket: Implement SO_SPLICE")
    (cherry picked from commit 283bf3b4b105ad24e919444ab0e21f3296891283)
---
 sys/kern/uipc_socket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 1f5e09ada217..a038939399e3 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -3952,7 +3952,8 @@ sosetopt(struct socket *so, struct sockopt *sopt)
 			if (error)
 				goto bad;
 #ifdef KTRACE
-			ktrsplice(&splice);
+			if (KTRPOINT(curthread, KTR_STRUCT))
+				ktrsplice(&splice);
 #endif
 
 			error = splice_init();