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

Kris Van Hees noreply at github.com
Fri Aug 18 19:36:01 UTC 2023


  Branch: refs/heads/kvh/2.0-branch-dev-ip
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 8a3484b69620ff132a2735eb9afd7f3c8aedd8aa
      https://github.com/oracle/dtrace-utils/commit/8a3484b69620ff132a2735eb9afd7f3c8aedd8aa
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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 constrained by the maximum string size.

Its 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: d98d5a724dfbdb95ea49529324a93c4039115fa6
      https://github.com/oracle/dtrace-utils/commit/d98d5a724dfbdb95ea49529324a93c4039115fa6
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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: 5924c454ea733641dd64fb6a08d8485df22ca4f0
      https://github.com/oracle/dtrace-utils/commit/5924c454ea733641dd64fb6a08d8485df22ca4f0
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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: 3e08c4860e7b09fece4a693330cf527eb26d54d3
      https://github.com/oracle/dtrace-utils/commit/3e08c4860e7b09fece4a693330cf527eb26d54d3
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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: e090516bd578710881d5e7e4919e2edc6abbcf7d
      https://github.com/oracle/dtrace-utils/commit/e090516bd578710881d5e7e4919e2edc6abbcf7d
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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: 4aef5070c5098b8988febe6b5041c436660f3047
      https://github.com/oracle/dtrace-utils/commit/4aef5070c5098b8988febe6b5041c436660f3047
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 134fd2d355a03bd68ac89b5308ed8d8cb2754b27
      https://github.com/oracle/dtrace-utils/commit/134fd2d355a03bd68ac89b5308ed8d8cb2754b27
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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.trunc0.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: 7253b5f6bf800340401423b42d803a317c5a6672
      https://github.com/oracle/dtrace-utils/commit/7253b5f6bf800340401423b42d803a317c5a6672
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 37bb5821540cb14ea7def6b7e57b53df49950b09
      https://github.com/oracle/dtrace-utils/commit/37bb5821540cb14ea7def6b7e57b53df49950b09
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    A test/unittest/aggs/tst.trunc-lquantize-5.d
    A test/unittest/aggs/tst.trunc-lquantize-5.r
    A test/unittest/aggs/tst.trunc-lquantize-default.d
    A test/unittest/aggs/tst.trunc-lquantize-default.r
    A test/unittest/aggs/tst.trunc-lquantize-neg5.d
    A test/unittest/aggs/tst.trunc-lquantize-neg5.r
    A test/unittest/aggs/tst.trunc-sum-5.d
    A test/unittest/aggs/tst.trunc-sum-5.r
    A test/unittest/aggs/tst.trunc-sum-default.d
    A test/unittest/aggs/tst.trunc-sum-default.r
    A test/unittest/aggs/tst.trunc-sum-neg5.d
    A test/unittest/aggs/tst.trunc-sum-neg5.r

  Log Message:
  -----------
  test: Add trunc tests

Theoretically, funny race conditions could arise between producer
and consumer, especially for functions like trunc(), which are
generated in the producer but then executed in the consumer.

Add some trunc tests that should be robust against such races.
They are patterned after similar clear() tests.  Specifically,
many aggregations are performed and then followed immediately by
the trunc() call to be tested.  Then, the test waits, protecting
it from variations in update rates, before a final aggregation is
performed and results dumped out.

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


  Commit: 41b9347ea7bc79d99077f09f59d78033cc64093b
      https://github.com/oracle/dtrace-utils/commit/41b9347ea7bc79d99077f09f59d78033cc64093b
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c

  Log Message:
  -----------
  Simplify code to match aggregation key

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


  Commit: d4c53b8d664828b75f84525db391feba23211f94
      https://github.com/oracle/dtrace-utils/commit/d4c53b8d664828b75f84525db391feba23211f94
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-18 (Fri, 18 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>


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



More information about the DTrace-devel mailing list