git: 283bf3b4b105 - main - socket: Only log splice structs to ktrace if KTR_STRUCT is configured

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 20 Sep 2024 11:53:21 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=283bf3b4b105ad24e919444ab0e21f3296891283

commit 283bf3b4b105ad24e919444ab0e21f3296891283
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-09-20 11:40:31 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-09-20 11:40:31 +0000

    socket: Only log splice structs to ktrace if KTR_STRUCT is configured
    
    Fixes:  a1da7dc1cdad ("socket: Implement SO_SPLICE")
---
 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 fb3dc4dfc224..e83422e3a29f 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -3955,7 +3955,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();