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

Kris Van Hees kris.van.hees at oracle.com
Thu Aug 1 19:03:25 UTC 2024


On Thu, Aug 01, 2024 at 07:44:35PM +0100, Nick Alcock wrote:
> 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)?

That is why we have tst.kernel_read_neg_small_scalar.aarch64.x

> 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