[DTrace-devel] [PATCH 05/17] uapi headers: include <sys/dtrace_types> as needed

Eugene Loh eugene.loh at oracle.com
Wed Aug 31 00:13:47 UTC 2022


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

But:

*)  Should we add tests?  (I'm not convinced we should -- there are too 
many code paths -- but see next item.)

*)  Maybe in addition to the fix one should replace (the following is 
pseudocode):

         #if THISENDIANNESS
                 // this endianness
         #else
                 // that endianness
         #endif

     with

         #if THISENDIANNESS
                 // this endianness
         #elif THATENDIANNESS
                 // that endianness
         #else
                 error do not compile
         #endif

On 8/10/22 18:06, Nick Alcock via DTrace-devel wrote:
> This is needed for _LITTLE_ENDIAN etc: without it, consumers are liable
> to find that they think they're on a big-endian system even when they're

Think they're on a BE system?  Well, it depends on how the code is 
written:  the error might induce one to thinking they're on a 
little-endian machine.  Anyhow, the commit message can be written in a 
way that does not assume which way the #ifdef is written.

> not.
> ---
>   include/dtrace/actions_defines.h | 1 +
>   include/dtrace/dof_defines.h     | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/include/dtrace/actions_defines.h b/include/dtrace/actions_defines.h
> index dfec34f3ddc2..f161df7cf13f 100644
> --- a/include/dtrace/actions_defines.h
> +++ b/include/dtrace/actions_defines.h
> @@ -13,6 +13,7 @@
>   #ifndef _DTRACE_ACTIONS_DEFINES_H
>   #define _DTRACE_ACTIONS_DEFINES_H
>   
> +#include <sys/dtrace_types.h>
>   #include <dtrace/universal.h>
>   
>   /*
> diff --git a/include/dtrace/dof_defines.h b/include/dtrace/dof_defines.h
> index 02d650c22831..818089d1b472 100644
> --- a/include/dtrace/dof_defines.h
> +++ b/include/dtrace/dof_defines.h
> @@ -13,6 +13,7 @@
>   #ifndef _DTRACE_DOF_DEFINES_H
>   #define _DTRACE_DOF_DEFINES_H
>   
> +#include <sys/dtrace_types.h>
>   #include <dtrace/universal.h>
>   
>   /*



More information about the DTrace-devel mailing list