socket: Only log splice structs to ktrace if KTR_STRUCT is configured

Fixes:	a1da7dc1cdad ("socket: Implement SO_SPLICE")
(cherry picked from commit 283bf3b4b105ad24e919444ab0e21f3296891283)
This commit is contained in:
Mark Johnston 2024-09-20 11:40:31 +00:00
parent 032014aaae
commit 4601b3e04d

View file

@ -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();