git: 4a662c9064fc - main - ktrace: change AST handler to require AST flag set

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 02 Aug 2022 18:12:20 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=4a662c9064fcda7727ec220da9ee37762f188466

commit 4a662c9064fcda7727ec220da9ee37762f188466
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-07-28 06:32:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-08-02 18:11:10 +0000

    ktrace: change AST handler to require AST flag set
    
    When it was inline it made sense to depend on the existing nested check
    in KTRUSERRET() rather than adding a new td_flags flag.  However, since
    we now have a TDA_KTRACE flag anyway, we might as well check it and
    avoid the call.
    
    Suggested by:   jhb
    Reviewed by:    markj
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D35888
---
 sys/kern/kern_ktrace.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 49e9dff4e643..c2f747c474de 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -229,8 +229,7 @@ ktrace_init(void *dummy)
 		    M_ZERO);
 		STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list);
 	}
-	ast_register(TDA_KTRACE, ASTR_UNCOND, 0, ast_ktrace);
-
+	ast_register(TDA_KTRACE, ASTR_ASTF_REQUIRED, 0, ast_ktrace);
 }
 SYSINIT(ktrace_init, SI_SUB_KTRACE, SI_ORDER_ANY, ktrace_init, NULL);