From 4a662c9064fcda7727ec220da9ee37762f188466 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 28 Jul 2022 09:32:47 +0300 Subject: [PATCH] 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 49e9dff4e64..c2f747c474d 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);