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

Kris Van Hees noreply at github.com
Mon Aug 21 22:36:16 UTC 2023


  Branch: refs/heads/kvh/2.0-branch-dev-ip
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 9df6f192ce232cf2c8752943b301ea01568fa499
      https://github.com/oracle/dtrace-utils/commit/9df6f192ce232cf2c8752943b301ea01568fa499
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: c959c8ef9b5fcb44f2dd64ff791b39e5047fc740
      https://github.com/oracle/dtrace-utils/commit/c959c8ef9b5fcb44f2dd64ff791b39e5047fc740
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 2649fe126c7295004059e3ff11641799f1a75c11
      https://github.com/oracle/dtrace-utils/commit/2649fe126c7295004059e3ff11641799f1a75c11
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 0eada0949d5a0cdefa5c5eb13ef7d0b7ec839880
      https://github.com/oracle/dtrace-utils/commit/0eada0949d5a0cdefa5c5eb13ef7d0b7ec839880
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 62f5c0118a8d202c0950af55ebb3aef8b972000a
      https://github.com/oracle/dtrace-utils/commit/62f5c0118a8d202c0950af55ebb3aef8b972000a
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 819f1c2ae33de9ad895f540a450e0a60ea357619
      https://github.com/oracle/dtrace-utils/commit/819f1c2ae33de9ad895f540a450e0a60ea357619
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 5307ab9da9e153a06c629cd8af2523b01276648d
      https://github.com/oracle/dtrace-utils/commit/5307ab9da9e153a06c629cd8af2523b01276648d
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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 may 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>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: cd4dbade21a91d64ea2635524d494ebca587737d
      https://github.com/oracle/dtrace-utils/commit/cd4dbade21a91d64ea2635524d494ebca587737d
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 8e25647bb0bb9e76dd92a243a3118d21860f8cfe
      https://github.com/oracle/dtrace-utils/commit/8e25647bb0bb9e76dd92a243a3118d21860f8cfe
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: c29b18e5e08b0317d38459953b689772ce82d7ec
      https://github.com/oracle/dtrace-utils/commit/c29b18e5e08b0317d38459953b689772ce82d7ec
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-08-21 (Mon, 21 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: 7fb303eff941c2809d67411becd65dc2d982b0eb
      https://github.com/oracle/dtrace-utils/commit/7fb303eff941c2809d67411becd65dc2d982b0eb
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-08-21 (Mon, 21 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/d2e982eb6868...7fb303eff941



More information about the DTrace-devel mailing list