Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Feb 2022 00:16:45 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Mark Johnston <markj@freebsd.org>
Cc:        dtrace@freebsd.org
Subject:   Re: DTrace, kernel loader, unknown probes, enable on load?
Message-ID:  <alpine.BSF.2.00.2202120014100.68830@ai.fobar.qr>
In-Reply-To: <YgaJekOI3UraO9qW@nuc>
References:  <alpine.BSF.2.00.2202111403340.68830@ai.fobar.qr> <YgZxcxon9xJxEpbR@nuc> <YgaFAJ7XAmKxB3w8@nuc> <alpine.BSF.2.00.2202111550460.68830@ai.fobar.qr> <YgaJekOI3UraO9qW@nuc>

index | next in thread | previous in thread | raw e-mail

On Fri, 11 Feb 2022, Mark Johnston wrote:

> It appears to be sufficient to simply move the kld_load hook to before
> module registration, patch below.  In the case of a subsequent error,
> the unload hook is called so DTrace gets a chance to clean up.  I can't
> see any reasons not to move it, though there's at least one non-dtrace
> consumer that needs a look.

HWPMC?

It does work for my case with -Z which will ease work massively.
I can't wait for the "morning" and more time then to look at things :-)

Please put me on subscribers should you put up a review.

Thanks a lot Mark and a happy weekend!
Bjoern


> diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
> index 2e4c95f16c8f..55661b9f9aa2 100644
> --- a/sys/kern/kern_linker.c
> +++ b/sys/kern/kern_linker.c
> @@ -452,6 +452,7 @@ linker_load_file(const char *filename, linker_file_t *result)
> 		if (error != ENOENT)
> 			foundfile = 1;
> 		if (lf) {
> +			EVENTHANDLER_INVOKE(kld_load, lf);
> 			error = linker_file_register_modules(lf);
> 			if (error == EEXIST) {
> 				linker_file_unload(lf, LINKER_UNLOAD_FORCE);
> @@ -472,7 +473,6 @@ linker_load_file(const char *filename, linker_file_t *result)
> 				return (ENOEXEC);
> 			}
> 			linker_file_enable_sysctls(lf);
> -			EVENTHANDLER_INVOKE(kld_load, lf);
> 			*result = lf;
> 			return (0);
> 		}
>
>

-- 
Bjoern A. Zeeb                                                     r15:7


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.2202120014100.68830>