[DTrace-devel] [oracle/dtrace-utils] c548ba: Add rodata support

Kris Van Hees noreply at github.com
Wed Aug 16 20:31:14 UTC 2023


  Branch: refs/heads/kvh/2.0-branch-dev-ip
  Home:   https://github.com/oracle/dtrace-utils
  Commit: c548baff478bdc961ffbb426ed4e6f7e943dccec
      https://github.com/oracle/dtrace-utils/commit/c548baff478bdc961ffbb426ed4e6f7e943dccec
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/Build
    M libdtrace/dt_bpf.c
    M libdtrace/dt_bpf.h
    M libdtrace/dt_cc.c
    M libdtrace/dt_cg.c
    M libdtrace/dt_dctx.h
    M libdtrace/dt_dlibs.c
    M libdtrace/dt_impl.h
    M libdtrace/dt_open.c
    A libdtrace/dt_rodata.c
    A libdtrace/dt_rodata.h
    M libdtrace/dt_subr.c

  Log Message:
  -----------
  Add rodata support

This patch provides for read-only data to be placed in its own memory
block (much like the .rodata ELF section).  It lays the groundwork for
future enhancements that support .rodata sections in precompiled BPF
code (as may be generated for static data items), and for the storage
of read-only data that is not constrainted by the maximum string size.

It's first user will be the inet_ntoa6() implementation that needs to
store a read-only lookup table.

The string table can be considered a special case of read-only data
(as evidenced by the clear duplication of code between dt_rodata.c and
dt_strtab.c) and a future patch will convert the strtab implementation
to be a wrapper for a rodata-style memory block.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 9509c5cf57ee44c2ed2b0ac8867c77607a8ab47d
      https://github.com/oracle/dtrace-utils/commit/9509c5cf57ee44c2ed2b0ac8867c77607a8ab47d
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg: optional 4th arg for dt_cg_subr_arg_to_tstring() calls

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


  Commit: d7521a1e273ec00c6c6ea3ecaa544ecbd8b3e3e7
      https://github.com/oracle/dtrace-utils/commit/d7521a1e273ec00c6c6ea3ecaa544ecbd8b3e3e7
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/translators/tst.NullInput.d
    M test/unittest/translators/tst.ProcModelTrans.d

  Log Message:
  -----------
  cg: allow input to translator to be NULL

Some translators support NULL as input pointer value.  The code generator
was performing a NULL-check on a the LHS of a PTR or DOT node before
considering the possibility that the node is subject to translator
handling.  The check should happen after translator handling.

With this patch, tst.ProcModelTrans.d works but only for the case of
NULL input.  The test is changed to actually use a real task_struct as
input.  New test tst.NullInput.d exercises the case this patch fixes.

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


  Commit: 657685765abfc311f7e2d66454e3e55bac21e0db
      https://github.com/oracle/dtrace-utils/commit/657685765abfc311f7e2d66454e3e55bac21e0db
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M bpf/Build
    A bpf/inet_ntoa6.S
    M libdtrace/dt_cg.c
    M libdtrace/dt_dctx.h
    M libdtrace/dt_impl.h
    R test/unittest/funcs/err.inet_ntoa6badaddr.d
    A test/unittest/funcs/inet_ntoa6/err.inet_ntoa6badaddr.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.r
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_10.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_10.r
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_40.d
    A test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_40.r
    R test/unittest/funcs/tst.inet_ntoa6.d
    R test/unittest/funcs/tst.inet_ntoa6.r

  Log Message:
  -----------
  Add support for inet_ntoa6() subroutine

This patch also introduces a size limit for tstrings that can differ
from strsize because internal routines might need extra space.  The
tstring size is now defined as DT_TSTRING_SIZE, and it is the larger
or strsize and the maximum space routines require.  Right now, the
only routine that requires extra space is inet_ntoa6() because it
use the tstring to store its output and to store 2 copies of the
input data, for a total of 40 bytes + 2 * 16 bytes = 72 bytes.

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


  Commit: 0a505821d742551a029199d6160cb3b794354228
      https://github.com/oracle/dtrace-utils/commit/0a505821d742551a029199d6160cb3b794354228
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/bitfields/tst.bitfield-offset.d

  Log Message:
  -----------
  cg: correct bitfield offset determination

The C compiler (together with binutils) can represent bitfields using
one of two representations: store the actual offset of the bitfield in
ctm_offset, or store the base offset of the underlying type in ctm_offset
and store the offset within the underlying type as cte_offset.

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


  Commit: 90619447977968cf09651eda08bd7fb6a414fae2
      https://github.com/oracle/dtrace-utils/commit/90619447977968cf09651eda08bd7fb6a414fae2
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg: fix tstring leak in translator members that yield string values

When a translator member yields a string value, the tstring holding the
value was not properly tracked.  This resulted in an assertion failure
in test/demo/ip/ipproto.d.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: c79469f9c3aebbc2d2681fa67de606ec9f437387
      https://github.com/oracle/dtrace-utils/commit/c79469f9c3aebbc2d2681fa67de606ec9f437387
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/Build
    M libdtrace/dt_open.c
    A libdtrace/dt_prov_ip.c
    M libdtrace/dt_provider.h
    M libdtrace/ip.d
    M test/demo/ip/ipproto.d
    M test/unittest/funcs/tst.inet_ntoa.d

  Log Message:
  -----------
  Implement the ip provider

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: 4f0cedea5f66431b165d1641e6930749661ed469
      https://github.com/oracle/dtrace-utils/commit/4f0cedea5f66431b165d1641e6930749661ed469
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c
    M libdtrace/dt_cg.c
    M libdtrace/dt_consume.c
    M libdtrace/dt_open.c
    M test/unittest/aggs/tst.negtrunc.d
    M test/unittest/aggs/tst.negtruncquant.d
    M test/unittest/aggs/tst.trunc.d
    M test/unittest/aggs/tst.truncquant.d

  Log Message:
  -----------
  Implement the trunc() action

Some tests will not yield the desired results yet due to issues with
switchrate/aggrate/statusrate implementation details that those
tests depend on.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


  Commit: cffbce31708369827f436c5992e79c3bcefcd20c
      https://github.com/oracle/dtrace-utils/commit/cffbce31708369827f436c5992e79c3bcefcd20c
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-16 (Wed, 16 Aug 2023)

  Changed paths:
    R test/unittest/aggs/tst.subr.d
    A test/unittest/funcs/tst.subr.d

  Log Message:
  -----------
  test: update and move tst.subr.d

The tst.subr.d test resided under the aggs/ hierarchy which does not
make sense because it tests for the implementation of subroutines (and
simply uses aggregations to collect data based on subroutine return
types (int, string, or void).

The test has been updated to reflect the current set of implemented
subroutines.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>


Compare: https://github.com/oracle/dtrace-utils/compare/aed542fe427b...cffbce317083



More information about the DTrace-devel mailing list