[DTrace-devel] [PATCH] test: ensure casting does not affect value

Nick Alcock nick.alcock at oracle.com
Thu Aug 1 18:44:35 UTC 2024


On 31 Jul 2024, Kris Van Hees outgrape:

> On systems without CTF, we do not know the type of kernel variables.
> By doing an explicit cast to int64_t a negative int is converted into a
> large positive integer.  The proper cast is 'int' of course.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>

> -	trace((int64_t)`crashing_cpu);
> +	trace((int)`crashing_cpu);

Hm what type is it actually...

... int, but it's under arch/{x86,mips,powerpc}. Is this test going to
break on other architectures (like arm64)?

I know this is a pre-existing bug. The cast is correct, so

Reviewed-by: Nick Alcock <nick.alcock at oracle.com>

-- 
NULL && (void)



More information about the DTrace-devel mailing list