[DTrace-devel] [PATCH 2/2] lockstat: refuse to provide probes on kernels < 5.10.0
Nick Alcock
nick.alcock at oracle.com
Fri May 26 21:37:40 UTC 2023
On 26 May 2023, Nick Alcock via DTrace-devel uttered the following:
> On 26 May 2023, Kris Van Hees via DTrace-devel outgrape:
> Not quite, I fear. dt_kernver is populated from a string representation
> of the kernel version:
>
> *vp = DT_VERSION_NUMBER(kv1, kv2, kv3);
>
> where DT_VERSION_NUMBER is
>
> ((((M) & 0xFF) << 24) | (((m) & 0xFFF) << 12) | ((u) & 0xFFF))
>
> But KERNEL_VERSION is
>
> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
>
> These are *not the same*, and you can't use the one to compare with the
> other.
>
> I think you have to use DT_VERSION_NUMBER here, not KERNEL_VERSION.
I see from the web archive that you have a v2 that does exactly that (it
hasn't got here yet so I can't reply to it). That looks fine, and has my
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
More information about the DTrace-devel
mailing list