[DTrace-devel] [oracle/dtrace-utils] cc2ce5: dlibs: make define_for_kernel work with kernels in...

Nick Alcock noreply at github.com
Wed Mar 17 07:27:28 PDT 2021


  Branch: refs/heads/1.x-branch-dev
  Home:   https://github.com/oracle/dtrace-utils
  Commit: cc2ce589388425eb9c92ce600c3a00767bc4f939
      https://github.com/oracle/dtrace-utils/commit/cc2ce589388425eb9c92ce600c3a00767bc4f939
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2021-03-17 (Wed, 17 Mar 2021)

  Changed paths:
    M libdtrace/d-kern.m4

  Log Message:
  -----------
  dlibs: make define_for_kernel work with kernels in any order

An undocumented requirement of define_for_kernel (and thus
expand_for_kernel) is that when multiple kernel versions are specified,
they must be in ascending order.  This is because __process_element does
not stop searching for an expansion when one is found, and doesn't check
to see if each expansion it finds is more suitable than any it already
knows about: so if you list an expansion for 5.11.0 followed by one for
4.10.0, and build it against 5.11.6, __process_element will conclude
(correctly) that 5.11.0 matches, mark it as found, then keep scanning,
conclude that 4.10.0 matches too, and overwrite the already-found match,
even though 5.11.0 is a better match for 5.11.6 than 4.10.0 is.

This is easy to fix: in addition to remembering the found match,
remember what version it matched against, and only overwrite matches if
the potential match has a higher version number.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>





More information about the DTrace-devel mailing list