[DTrace-devel] [PATCH 2/2] Ignore module name __builtin__kprobes in kallmodsyms

Kris Van Hees kris.van.hees at oracle.com
Tue Nov 1 21:26:50 UTC 2022


On Mon, Sep 19, 2022 at 04:41:21PM -0400, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

> ---
>  libdtrace/dt_module.c                | 7 +++++++
>  test/unittest/consumer/tst.symbols.c | 3 +++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/libdtrace/dt_module.c b/libdtrace/dt_module.c
> index c3d239d4..7f3f1f50 100644
> --- a/libdtrace/dt_module.c
> +++ b/libdtrace/dt_module.c
> @@ -1049,6 +1049,13 @@ dt_modsym_update(dtrace_hdl_t *dtp, const char *line, int flag)
>  	if (strcmp(mod_name, "bpf") == 0)
>  		return 0;
>  
> +	/*
> +	 * "__builtin__kprobes" is used as a module name for symbols for pages
> +	 * allocated for kprobes' purposes, even though it is not a module.
> +	 */
> +	if (strcmp(mod_name, "__builtin__kprobes") == 0)
> +		return 0;
> +
>  	/*
>  	 * Symbols of "absolute" type are typically defined per CPU.
>  	 * Their "addresses" here are very low and are actually offsets.
> diff --git a/test/unittest/consumer/tst.symbols.c b/test/unittest/consumer/tst.symbols.c
> index 210166fb..ab78e015 100644
> --- a/test/unittest/consumer/tst.symbols.c
> +++ b/test/unittest/consumer/tst.symbols.c
> @@ -125,6 +125,9 @@ int read_symbols() {
>  		if (strcmp(modname, "__builtin__ftrace]") == 0)
>  			continue;
>  
> +		if (strcmp(modname, "__builtin__kprobes]") == 0)
> +			continue;
> +
>  		/*
>  		 * In libdtrace/dt_module.c function dt_modsym_update(),
>  		 * we skip a number of symbols.  Do not test them.  The
> -- 
> 2.18.4
> 
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list