[DTrace-devel] [oracle/dtrace-utils] 8046dc: Fix type of default key when creating BPF maps

euloh noreply at github.com
Thu Dec 9 15:04:00 UTC 2021


  Branch: refs/heads/dev
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 8046dc71fac48c2c9f6100cbd9a6d7ac7a57963a
      https://github.com/oracle/dtrace-utils/commit/8046dc71fac48c2c9f6100cbd9a6d7ac7a57963a
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2021-12-09 (Thu, 09 Dec 2021)

  Changed paths:
    M libdtrace/dt_bpf.c

  Log Message:
  -----------
  Fix type of default key when creating BPF maps

The default key (0) used to populate various BPF maps was declared as
uint32_t. but the 'dvars' BPF map uses a uint64_t key.  Since we know
that the value of the key will always be 0, it is safe to just make it
uint64_t for all maps, and have it be interpreted as uint32_t for the
maps that use a smaller key size.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 810b20f9d8414759d7f3a68ffc54a79e7d863323
      https://github.com/oracle/dtrace-utils/commit/810b20f9d8414759d7f3a68ffc54a79e7d863323
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2021-12-09 (Thu, 09 Dec 2021)

  Changed paths:
    M test/unittest/variables/tvar/tst.store-char.d

  Log Message:
  -----------
  Adjust dynvarsize to avoid hitting BPF size limits

The number of entries in the dvars BPF map is calculated as the
dynvarsize divided by the size of the value type, which is 1.  It
turns out that there is a limit on the number of entries and this
test hits that limit.

This patch sets dynvarsize to 1024 to force a lower limit so that
this issue is not triggered anymore.

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


  Commit: 107cbf35d55a32821d47dc925d10fd21825a0ed4
      https://github.com/oracle/dtrace-utils/commit/107cbf35d55a32821d47dc925d10fd21825a0ed4
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2021-12-09 (Thu, 09 Dec 2021)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  Move free(%r0) in stack() actions

We should free BPF_REG_0 as soon as it has been used for the last
time and before calling dt_cg_probe_error().

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


Compare: https://github.com/oracle/dtrace-utils/compare/d2a29b06d1b9...107cbf35d55a



More information about the DTrace-devel mailing list