[DTrace-devel] [oracle/dtrace-utils] 412c5f: probe: ensure probe argument info is retrieved onl...

Kris Van Hees noreply at github.com
Mon Feb 27 13:40:42 UTC 2023


  Branch: refs/heads/dev
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 412c5f2be7410e066f86b079b34de1321165f9c8
      https://github.com/oracle/dtrace-utils/commit/412c5f2be7410e066f86b079b34de1321165f9c8
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-16 (Thu, 16 Feb 2023)

  Changed paths:
    M libdtrace/dt_probe.c

  Log Message:
  -----------
  probe: ensure probe argument info is retrieved only once per probe

Throughout the compilation process there are multiple points where
probe argument information is requested from the providers.  This
data cannot change during a runtime of DTrace and there is therefore
no reason to go through the process of retrieving it more than once.

The prp->argc (probe argument count) is used to determine if argument
data has been obtained.  It is initially -1, and will be 0 or greater
once argument data has been requested.

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


  Commit: ff2766d56d065171cb34130f1204549e5f2caa80
      https://github.com/oracle/dtrace-utils/commit/ff2766d56d065171cb34130f1204549e5f2caa80
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M test/unittest/funcs/copyin/tst.copyin.d
    M test/unittest/funcs/copyin/tst.copyin.r
    M test/unittest/funcs/copyinstr/tst.copyinstr-low-maxsize.d
    M test/unittest/funcs/copyinstr/tst.copyinstr-low-maxsize.r
    M test/unittest/funcs/copyinstr/tst.copyinstr-no-maxsize.d
    M test/unittest/funcs/copyinstr/tst.copyinstr-no-maxsize.r
    M test/unittest/funcs/copyinstr/tst.copyinstr.d
    M test/unittest/funcs/copyinstr/tst.copyinstr.r
    M test/unittest/funcs/copyinto/tst.copyinto.d
    M test/unittest/funcs/copyinto/tst.copyinto.r

  Log Message:
  -----------
  tests: Use distinct trigger for copyin* tests

Many copyin* tests implement a trigger by running system("echo foo")
in the BEGIN probe.  This requires a destructive action, which is okay
but does make these "unit tests" rely on features unrelated to the
tests.

The main problem, however, is that the check that the corresponding
write:entry probe has fired on the correct process becomes very weak
-- e.g., just checking that a particular char is '-'.  And in the case
of copyinto, this check is unnecessarily complicated.  Finally, if
such a process is not found, the test would hang.

Use @@trigger.  E.g., delaydie will quickly terminate, emiting a simple
message, which is all we need for these tests.

The existing predicates check being able to:
- cast the return value of copyin() to string
- use indexing on the cast value
- use indexing on the return value of copyinstr()
Each such predicate is replaced with a conditionalized printf.

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


  Commit: 24087cd079b0b211cb7e11a2208f2dd05b512ce6
      https://github.com/oracle/dtrace-utils/commit/24087cd079b0b211cb7e11a2208f2dd05b512ce6
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_open.c
    R test/unittest/funcs/copyinstr/err.D_ALLOCA_SIZE.d
    A test/unittest/funcs/copyinstr/tst.copyinstr-high-maxsize.d
    A test/unittest/funcs/copyinstr/tst.copyinstr-high-maxsize.r

  Log Message:
  -----------
  cg, test: fix copyinstr() implementation to use a tstring

Since copyinstr() returns a string, it should be using a temporary
string like other string functions.  Also, semantics needed fixing to
apply strsize as an upper limit to the optional size rather than
triggering a fault if the size is greater than strsize.

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


  Commit: c530238623f0b1ce74fed118278119d3b7c5bf70
      https://github.com/oracle/dtrace-utils/commit/c530238623f0b1ce74fed118278119d3b7c5bf70
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_parser.c
    A test/unittest/actions/printf/tst.conv_s_alloca_var.d
    A test/unittest/actions/printf/tst.conv_s_alloca_var.r
    A test/unittest/actions/printf/tst.conv_s_copyin.d
    A test/unittest/actions/printf/tst.conv_s_copyin.r
    A test/unittest/actions/printf/tst.conv_s_copyinstr.d
    A test/unittest/actions/printf/tst.conv_s_copyinstr.r
    A test/unittest/funcs/bcopy/err.bcopy-into-string.d
    A test/unittest/funcs/bcopy/tst.bcopy-into-alloca.d
    A test/unittest/funcs/bcopy/tst.bcopy-into-alloca.r
    A test/unittest/funcs/bcopy/tst.bcopy-into-string-indirect.d
    A test/unittest/funcs/bcopy/tst.bcopy-into-string-indirect.r

  Log Message:
  -----------
  cg, parser: fix handling of alloca()'d string values

When alloca()'d memory is used as a string, special handling is needed
to ensure variable assignment and storing in the output buffer works
correctly.

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


  Commit: 35900cb0025e5e8fabc844230ba4c3aa4f0675fc
      https://github.com/oracle/dtrace-utils/commit/35900cb0025e5e8fabc844230ba4c3aa4f0675fc
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M libdtrace/dt_open.c

  Log Message:
  -----------
  Mark subroutines with appropriate ALLOCA and DPTR flags

Clearly, alloca() should be marked ALLOCA.

We also return copyin() in scratch memory.

These and other subroutines return results in DTrace-managed storage.

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


  Commit: a7ee5e88f06d71cb65febe5e33299a06d35eb866
      https://github.com/oracle/dtrace-utils/commit/a7ee5e88f06d71cb65febe5e33299a06d35eb866
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/codegen/tst.ALLOCA.d
    A test/unittest/codegen/tst.ALLOCA.r
    A test/unittest/codegen/tst.ALLOCA.r.p

  Log Message:
  -----------
  test: Add test to check ALLOCA flag propagation

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


  Commit: 8e0b0fe41d1a68d6cda9a7c6e1d885106fa3a35a
      https://github.com/oracle/dtrace-utils/commit/8e0b0fe41d1a68d6cda9a7c6e1d885106fa3a35a
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/codegen/tst.DPTR.d
    A test/unittest/codegen/tst.DPTR.r
    A test/unittest/codegen/tst.DPTR.r.p

  Log Message:
  -----------
  test: Add test to check DPTR flag propagation

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


  Commit: 850eb0d0a12e7d25114e434b4a5d115670d082ec
      https://github.com/oracle/dtrace-utils/commit/850eb0d0a12e7d25114e434b4a5d115670d082ec
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M bpf/basename.S
    A test/unittest/funcs/tst.basename_nonDPTR.d
    A test/unittest/funcs/tst.basename_nonDPTR.r

  Log Message:
  -----------
  Support basename() for addresses that are not DTrace pointers

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


  Commit: 500a825cf1fe3ec8efa13e4f24dcffeaa04933d4
      https://github.com/oracle/dtrace-utils/commit/500a825cf1fe3ec8efa13e4f24dcffeaa04933d4
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M bpf/dirname.S
    A test/unittest/funcs/tst.dirname_nonDPTR.d
    A test/unittest/funcs/tst.dirname_nonDPTR.r

  Log Message:
  -----------
  Support dirname() for addresses that are not DTrace pointers

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


  Commit: 0903985768bc950c5e36f96d36ac3311542c7c5c
      https://github.com/oracle/dtrace-utils/commit/0903985768bc950c5e36f96d36ac3311542c7c5c
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M bpf/strrchr.S
    A test/unittest/funcs/tst.strchr_nonDPTR.d
    A test/unittest/funcs/tst.strchr_nonDPTR.r

  Log Message:
  -----------
  Support strrchr() for addresses that are not DTrace pointers

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


  Commit: 267527cb423a9ff277bb8bad20546f1a094ec668
      https://github.com/oracle/dtrace-utils/commit/267527cb423a9ff277bb8bad20546f1a094ec668
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/funcs/copyin/tst.copyin-retval-ok.d

  Log Message:
  -----------
  cg: fix return value of copyin()

The copyin() function was returning the resolved alloca pointer rather
than the offset into scratchmem (as it should have).  Now that the
function is correctly marked as returning an alloca-pointer, it needs
to return the native representation of an alloca-pointer, i.e. as an
offset into scratchmem.

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


  Commit: 5d0d980181d179f444445792dc13b2cfcf0015d7
      https://github.com/oracle/dtrace-utils/commit/5d0d980181d179f444445792dc13b2cfcf0015d7
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M bpf/inet_ntoa.S
    A test/unittest/funcs/tst.inet_ntoa_alloca.d
    A test/unittest/funcs/tst.inet_ntoa_alloca.r
    A test/unittest/funcs/tst.inet_ntoa_copyin.d
    A test/unittest/funcs/tst.inet_ntoa_copyin.r
    A test/unittest/funcs/tst.inet_ntoa_nonDPTR.d
    A test/unittest/funcs/tst.inet_ntoa_nonDPTR.r

  Log Message:
  -----------
  Support inet_ntoa() for addresses that are not DTrace pointers

If the input argument to inet_ntoa() is not a DTrace pointer, the
BPF verifier cannot confirm it is safe.  So first copy the input
data to the BPF stack using the probe_read() helper function.

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


  Commit: c6efccb6003c41180526ef23a715360dc1175067
      https://github.com/oracle/dtrace-utils/commit/c6efccb6003c41180526ef23a715360dc1175067
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/funcs/tst.index_nonDPTR.d
    A test/unittest/funcs/tst.index_nonDPTR.r

  Log Message:
  -----------
  test: Check index() for addresses that are not DTrace pointers

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


  Commit: 1718548746d7224bc4da91c42564bd6de2f8dba2
      https://github.com/oracle/dtrace-utils/commit/1718548746d7224bc4da91c42564bd6de2f8dba2
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/funcs/tst.rindex_nonDPTR.d
    A test/unittest/funcs/tst.rindex_nonDPTR.r

  Log Message:
  -----------
  test: Check rindex() for addresses that are not DTrace pointers

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


  Commit: 832db07c8b74693dda40be9a6dfb6697c500af55
      https://github.com/oracle/dtrace-utils/commit/832db07c8b74693dda40be9a6dfb6697c500af55
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/funcs/strjoin/tst.strjoin_nonDPTR.d
    A test/unittest/funcs/strjoin/tst.strjoin_nonDPTR.r

  Log Message:
  -----------
  test: Check strjoin() for addresses that are not DTrace pointers

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


  Commit: 542807fcaa6c9e3d6913a5f8210c3bd4ff1fb4cf
      https://github.com/oracle/dtrace-utils/commit/542807fcaa6c9e3d6913a5f8210c3bd4ff1fb4cf
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/funcs/substr/tst.substr_nonDPTR.d
    A test/unittest/funcs/substr/tst.substr_nonDPTR.r

  Log Message:
  -----------
  test: Check substr() for addresses that are not DTrace pointers

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


  Commit: 469268ed206b19374ab5cdc2a83f0735ca0a564a
      https://github.com/oracle/dtrace-utils/commit/469268ed206b19374ab5cdc2a83f0735ca0a564a
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A test/unittest/funcs/strtok/tst.strtok_nonDPTR.d
    A test/unittest/funcs/strtok/tst.strtok_nonDPTR.r

  Log Message:
  -----------
  test: Check strtok() for addresses that are not DTrace pointers

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


  Commit: 61ddca479f4a8cfb287f0ca5e1bf112447a01755
      https://github.com/oracle/dtrace-utils/commit/61ddca479f4a8cfb287f0ca5e1bf112447a01755
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M bpf/strcmp.S

  Log Message:
  -----------
  Clean up comments and remove unneeded code in strcmp.S

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


  Commit: 2bbcf5802b13dc0b2b28eb645d36a66deb8b51a2
      https://github.com/oracle/dtrace-utils/commit/2bbcf5802b13dc0b2b28eb645d36a66deb8b51a2
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M bpf/strcmp.S

  Log Message:
  -----------
  Simplify strcmp.S

The code branched depending on whether the first string is known
to be a pointer to D-managed storage.  If we simply assume that
the storage is never D-managed, we can save two instructions as
well as a conditional jump (the bane of the BPF verifier).  The
execution path ends up a couple of instructions either longer or
shorter depending on the case.  The resulting implementation is
closer to that of other string subroutines.

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


  Commit: 863876afab5f4604511650d87aa4de528209df34
      https://github.com/oracle/dtrace-utils/commit/863876afab5f4604511650d87aa4de528209df34
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg: use indirect load instructions for scalar DPTR and ALLOCA pointers

Both ALLOCA and DPTR pointers can use indirect load instructions rather
than requiring bpf_probe_read().

The DT_TOK_DOT case can benefit from this also (and is included in this
patch) even though that code path is not currently possible due to a
bug in the ALLOCA flag propagation.  Once that is fixed, code generation
for DT_TOK_DOT for ALLOCA pointers will use indirect load instructions.

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


  Commit: 293cb09da894d431809ac7b76a0de10b0d830e9f
      https://github.com/oracle/dtrace-utils/commit/293cb09da894d431809ac7b76a0de10b0d830e9f
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_bpf.c
    M libdtrace/dt_dlibs.c
    M libdtrace/dt_impl.h
    M test/stress/buffering/err.resize2.r

  Log Message:
  -----------
  bpf: add 'agggen' BPF map

The 'agggen' BPF map associates a generation counter with an aggregation
ID.  It will be used to determine whether the aggregation data in the
'aggs' map for aggregations associated with a given aggregation ID is
valid or stale.

The initial generation counter for each aggregation is 1 (because 0 is
used to indicate a no-data condition).

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


  Commit: f76ebb2206888cd6ff9551323c7900a6d81f6d56
      https://github.com/oracle/dtrace-utils/commit/f76ebb2206888cd6ff9551323c7900a6d81f6d56
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M bpf/get_agg.c

  Log Message:
  -----------
  bpf: add agggen handling to dt_get_agg()

The dt_get_agg() function will now consult the generation value for the
aggregation id.  If existing data is of an earlier generation, the data
is reset.

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


  Commit: b05d268ed8c5a31e8dc084f2053e3a86792f518a
      https://github.com/oracle/dtrace-utils/commit/b05d268ed8c5a31e8dc084f2053e3a86792f518a
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c
    M libdtrace/dt_impl.h

  Log Message:
  -----------
  agg: split clearing of one aggregation into its own function

The new dt_aggregate_clear_one() function is designed to allow it to be
passed to a callback function to the aggregation walk functions.  It
will be used in that manner in future patches.

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


  Commit: 448adfc3a9e750b1248fa46b025471931a1688c4
      https://github.com/oracle/dtrace-utils/commit/448adfc3a9e750b1248fa46b025471931a1688c4
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M cmd/dtrace.c
    M libdtrace/dt_consume.c
    M libdtrace/dt_impl.h
    M libdtrace/dt_open.c
    M libdtrace/dt_work.c

  Log Message:
  -----------
  Implement switchrate-based consumer loop

The switchrate option was not implemented in the BPF-based DTrace
implementation.  And commit 96d4dfeb (" Eliminate obsolete dt_last*")
removed the dtp->dt_lastswitch member from struct dtrace_hdl.  This
patch brings dt_lastswitch back and implements the switchrate option
as a way to limit the frequency of buffer polls.

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


  Commit: 21763e1375c9d44cb9916ddddabd777452b7a21f
      https://github.com/oracle/dtrace-utils/commit/21763e1375c9d44cb9916ddddabd777452b7a21f
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c
    M libdtrace/dt_consume.c
    M libdtrace/dt_impl.h
    M libdtrace/dt_open.c
    M libdtrace/dt_work.c

  Log Message:
  -----------
  Implement aggrate-based aggregation snapshots

Some aggregation operations like clear() depend on aggregation snapshot
frequency.

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


  Commit: 4091f50eb492c85a62339912bde8234048b903ea
      https://github.com/oracle/dtrace-utils/commit/4091f50eb492c85a62339912bde8234048b903ea
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_aggregate.c
    M libdtrace/dt_cg.c
    M libdtrace/dt_consume.c
    M libdtrace/dtrace.h
    M test/unittest/aggs/tst.clear.d
    M test/unittest/aggs/tst.clearavg.d
    M test/unittest/aggs/tst.clearavg2.d
    M test/unittest/aggs/tst.cleardenormalize.d
    M test/unittest/aggs/tst.clearlquantize.d
    M test/unittest/aggs/tst.clearnormalize.d

  Log Message:
  -----------
  Implement clear()

The clear() action is implemented by incrementing the global generation
counter for an aggregation name and clearing the data for matching
aggregations within the consumer.  If aggregation data in a snapshot is
found to have an older generation, it is discarded.  The producer side
will already clear its data when the generation counter is found to be
higher than the generation of the data in a CPU's agg buffer.

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


  Commit: 2ba7c3bd76fbbbfadd07adcffd21560aa5f2aeb3
      https://github.com/oracle/dtrace-utils/commit/2ba7c3bd76fbbbfadd07adcffd21560aa5f2aeb3
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M dtrace.spec
    M libdtrace/Build
    M libdtrace/dt_cg.c
    M libdtrace/dt_cg.h
    M libdtrace/dt_open.c
    A libdtrace/dt_prov_cpc.c
    M libdtrace/dt_provider.h

  Log Message:
  -----------
  Add a CPC provider

Use libpfm to populate CPC probes.

The PC is placed into arg0 (if kernel) or arg1 (if user-space),
the other arg being 0.  This initialization is in a new function
dt_cg_tramp_copy_PC_from_regs() so that it can be used by any other
provider (like profile) that needs it.

Current limitations include:

*)  no support for optional attributes

*)  no support for raw events

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


  Commit: dc265528fdf9730cbaf31d90781856b7b13777a6
      https://github.com/oracle/dtrace-utils/commit/dc265528fdf9730cbaf31d90781856b7b13777a6
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/cpc/tst.cpu_clock.d
    A test/unittest/cpc/tst.cpu_clock2.d
    A test/unittest/cpc/tst.cpu_clock2.r
    A test/unittest/cpc/tst.cpu_clock2.r.p
    A test/unittest/cpc/tst.list_cpc.sh

  Log Message:
  -----------
  cpc: Add simple tests

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


  Commit: 1cc9866e1ac0b0e78b586c7e5d8141e0c1750ba1
      https://github.com/oracle/dtrace-utils/commit/1cc9866e1ac0b0e78b586c7e5d8141e0c1750ba1
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M dtrace.spec
    A test/unittest/cpc/tst.branches.sh
    A test/unittest/cpc/tst.branches.x
    A test/unittest/cpc/tst.instructions.sh
    A test/unittest/cpc/tst.instructions.x
    M test/utils/.gitignore
    M test/utils/Build
    A test/utils/check_result.sh
    A test/utils/workload_analyze_loop.sh
    A test/utils/workload_get_iterations.sh
    A test/utils/workload_user.c

  Log Message:
  -----------
  cpc: Add some hardware-counter tests

Test hardware counters using both "branches" and "instructions" events.
Use "perf list hw" to check if these events are supported on the test
system.

A few utilities are introduced for these and future tests:

  * workload_user.c is a simple, user-space-intensive
    workload with very simple performance behavior:

      * one branch per iteration

      * a number of instructions per iteration that
        is easily determined from its disassembly

  * workload_get_iterations.sh estimates how many iterations
    to use to run the desired number of seconds

  * workload_analyze_loop.sh analyzes the disassembly of
    the innermost loop of something like workload_user.c;
    reporting the number of instructions per iteration and
    which PCs are in the loop

  * check_result.sh checks an actual count against
    an expected count to within some margin

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


  Commit: a7c14837f818729d67e766b1c8d41e8b53234b9b
      https://github.com/oracle/dtrace-utils/commit/a7c14837f818729d67e766b1c8d41e8b53234b9b
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/cpc/tst.args_kernel.sh
    A test/unittest/cpc/tst.args_user.sh
    M test/utils/.gitignore
    M test/utils/Build
    A test/utils/perf_count_event.sh
    A test/utils/workload_kernel.c

  Log Message:
  -----------
  cpc: Add probe-args tests

A few additional utilities are added to support these and future tests:

  * workload_kernel.c is a simple, kernel-intensive workload

  * perf_count_event.sh uses "perf stat" to count some event for
    some executable

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


  Commit: e379031c9b94d545e2d9f6c9335817bcc64f819b
      https://github.com/oracle/dtrace-utils/commit/e379031c9b94d545e2d9f6c9335817bcc64f819b
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/cpc/tst.mode_kernel.sh
    A test/unittest/cpc/tst.mode_user.sh
    M test/utils/Build
    A test/utils/cpc_get_events.sh

  Log Message:
  -----------
  cpc: Add mode tests

CPC probes can specify modes: all, user, and kernel.  These tests check
"all" against "perf stat" results.  They check "user" and "kernel" by
using workloads that are known to be user-space- or kernel-intensive.

An extra utility is added to support these tests:

  * cpc_get_events.sh composes a list of events to test on
    the current system

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


  Commit: 5ff65f467554b76efdbfc7d38021b8c1148395bf
      https://github.com/oracle/dtrace-utils/commit/5ff65f467554b76efdbfc7d38021b8c1148395bf
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/tst.branches.x
    M test/unittest/cpc/tst.instructions.x
    M test/utils/Build
    M test/utils/cpc_get_events.sh
    A test/utils/cpc_temp_skip_bug.sh

  Log Message:
  -----------
  cpc: Put in a temporary safeguard against some mystery bug

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


  Commit: 51535a1f0834c8a88db8b20dc981d11149617be0
      https://github.com/oracle/dtrace-utils/commit/51535a1f0834c8a88db8b20dc981d11149617be0
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/cpc/err.D_PDESC_ZERO.lowfrequency.d
    A test/unittest/cpc/err.D_PDESC_ZERO.malformedoverflow.d
    A test/unittest/cpc/err.D_PDESC_ZERO.nonexistentevent.d
    A test/unittest/cpc/err.cpcvscpustatpart1.ksh
    A test/unittest/cpc/err.cpcvscpustatpart2.ksh
    A test/unittest/cpc/err.cputrackfailtostart.ksh
    A test/unittest/cpc/err.cputrackterminates.ksh
    A test/unittest/cpc/err.toomanyenablings.d
    A test/unittest/cpc/tst.allcpus.ksh
    A test/unittest/cpc/tst.genericevent.d
    A test/unittest/cpc/tst.platformevent.ksh

  Log Message:
  -----------
  cpc: Import tests from Solaris

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


  Commit: 8653d23565d0763d58652885c511abf91bac8333
      https://github.com/oracle/dtrace-utils/commit/8653d23565d0763d58652885c511abf91bac8333
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/err.D_PDESC_ZERO.lowfrequency.d
    M test/unittest/cpc/err.D_PDESC_ZERO.malformedoverflow.d
    M test/unittest/cpc/err.D_PDESC_ZERO.nonexistentevent.d
    M test/unittest/cpc/err.cpcvscpustatpart1.ksh
    M test/unittest/cpc/err.cpcvscpustatpart2.ksh
    M test/unittest/cpc/err.cputrackfailtostart.ksh
    M test/unittest/cpc/err.cputrackterminates.ksh
    M test/unittest/cpc/err.toomanyenablings.d
    M test/unittest/cpc/tst.allcpus.ksh
    M test/unittest/cpc/tst.genericevent.d
    M test/unittest/cpc/tst.platformevent.ksh

  Log Message:
  -----------
  cpc: Fix copyrights on tests imported from Solaris

See these commits:
    e384b684cc77 Fix up copyrights
    1b911cea0f52 UPL relicensing, stage 2: automated modifications.
    4187a7baf76c Add missing copyright headers.

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


  Commit: e209984e3ef82b24be93abb1e82a8cdca2d9a3ad
      https://github.com/oracle/dtrace-utils/commit/e209984e3ef82b24be93abb1e82a8cdca2d9a3ad
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/err.D_PDESC_ZERO.lowfrequency.d
    M test/unittest/cpc/err.D_PDESC_ZERO.malformedoverflow.d
    M test/unittest/cpc/err.D_PDESC_ZERO.nonexistentevent.d

  Log Message:
  -----------
  cpc: Clean up err.D_PDESC_ZERO* tests imported from Solaris

Among other things, change the Solaris generic event PAPI_tot_ins
to cpu_clock.

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


  Commit: e80ad92871914fabca8c0944b0a38bc678dac13b
      https://github.com/oracle/dtrace-utils/commit/e80ad92871914fabca8c0944b0a38bc678dac13b
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    R test/unittest/cpc/err.cpcvscpustatpart1.ksh
    A test/unittest/cpc/err.cpcvscpustatpart1.sh
    R test/unittest/cpc/err.cpcvscpustatpart2.ksh
    A test/unittest/cpc/err.cpcvscpustatpart2.sh
    R test/unittest/cpc/err.cputrackfailtostart.ksh
    A test/unittest/cpc/err.cputrackfailtostart.sh
    R test/unittest/cpc/err.cputrackterminates.ksh
    A test/unittest/cpc/err.cputrackterminates.sh
    R test/unittest/cpc/tst.allcpus.ksh
    A test/unittest/cpc/tst.allcpus.sh
    R test/unittest/cpc/tst.platformevent.ksh
    A test/unittest/cpc/tst.platformevent.sh

  Log Message:
  -----------
  cpc: Change Solaris-imported *.ksh tests to *.sh

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


  Commit: f9c405614f7172a176110c291e7fd5f945277895
      https://github.com/oracle/dtrace-utils/commit/f9c405614f7172a176110c291e7fd5f945277895
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/err.cpcvscpustatpart1.sh
    M test/unittest/cpc/err.cpcvscpustatpart2.sh
    M test/unittest/cpc/err.cputrackfailtostart.sh
    M test/unittest/cpc/err.cputrackterminates.sh

  Log Message:
  -----------
  cpc: Skip cputrack and cpustat tests

Also, the default event should be changed from PAPI_tot_ins to
cpu-clock.  At this point, there is no need to do so (after all,
the tests are being skipped), but the new comment is a reminder
that this is needed.

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


  Commit: 4734ef302cf78b41a9481259d1f2d9da88a08cef
      https://github.com/oracle/dtrace-utils/commit/4734ef302cf78b41a9481259d1f2d9da88a08cef
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/tst.genericevent.d

  Log Message:
  -----------
  cpc: Update the Solaris generic-event test

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


  Commit: dad6beb015b87338e7e3ef9ea74fa5156993f1b3
      https://github.com/oracle/dtrace-utils/commit/dad6beb015b87338e7e3ef9ea74fa5156993f1b3
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/tst.allcpus.sh

  Log Message:
  -----------
  cpc: Update Solaris allcpus test

Replace psrinfo calls with info from /proc/cpuinfo.

Replace PAPI_tot_ins with cpu_clock.

Eliminate the spinner processes.

Add reinvoke since, for some as yet unknown reason, not every CPU shows
up every time.

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


  Commit: 16c18d1c76e1a1be12d650b9754d22286f42fcc3
      https://github.com/oracle/dtrace-utils/commit/16c18d1c76e1a1be12d650b9754d22286f42fcc3
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/codegen/tst.tstring_asgn_expr.d
    M test/unittest/codegen/tst.tstring_ternary.d

  Log Message:
  -----------
  test: Fix a tiny typo

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


  Commit: 2997f4bf48a6b3656f9bc72c169bbea908261422
      https://github.com/oracle/dtrace-utils/commit/2997f4bf48a6b3656f9bc72c169bbea908261422
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/cpc/tst.platformevent.sh

  Log Message:
  -----------
  cpc: Skip platform-specific test for now

It needs to be ported from cpustat, but we also have to decide what
a "platform-specific event" means now.

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


  Commit: ea6f170d2519311ab69fd42bae24ea68791a7107
      https://github.com/oracle/dtrace-utils/commit/ea6f170d2519311ab69fd42bae24ea68791a7107
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_prov_profile.c
    A test/unittest/profile-n/tst.args_kernel.sh
    A test/unittest/profile-n/tst.args_user.sh

  Log Message:
  -----------
  Fix profile-provider probe args arg0 and arg1

Set arg0 and arg1 for the profile provider.

Note that arg2 is still not unimplemented.

Add stronger tests for profile-* probe args.  (Since the new tests use
a target process that might be running on a different CPU from where
a tick-* probe fires, we do not add corresponding tick-* tests.
On the other hand, testing arg0 and arg1 for profile-* ought to be
sufficient.)

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


  Commit: 3bc04c20c2543e97a970d9da587e71a47b85535b
      https://github.com/oracle/dtrace-utils/commit/3bc04c20c2543e97a970d9da587e71a47b85535b
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/options/tst.incdir.r
    A test/unittest/options/tst.incdir.sh

  Log Message:
  -----------
  test: Add test for incdir option

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


  Commit: d26c97e47146175e2f7d0761e4bd2e484b2609e8
      https://github.com/oracle/dtrace-utils/commit/d26c97e47146175e2f7d0761e4bd2e484b2609e8
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/pcap/tst.pcap.stdout-fork-error.sh
    M test/unittest/pcap/tst.pcap.stdout.sh

  Log Message:
  -----------
  test: Check DTrace return status in pcap stdout tests

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


  Commit: bbc7f1466793361a9cee032c77904038a0c5ff38
      https://github.com/oracle/dtrace-utils/commit/bbc7f1466793361a9cee032c77904038a0c5ff38
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_consume.c
    M test/unittest/tracemem/err.D_TRACEMEM_ADDR.badaddr.d
    M test/unittest/tracemem/err.D_TRACEMEM_SIZE.negsize.d
    M test/unittest/tracemem/err.D_TRACEMEM_SIZE.zerosize.d
    M test/unittest/tracemem/tst.init_task.d
    R test/unittest/tracemem/tst.three_arg.sh
    A test/unittest/tracemem/tst.tracemem.d
    A test/unittest/tracemem/tst.tracemem.r
    A test/unittest/tracemem/tst.tracemem.r.p
    M test/unittest/types/tst.complex.d

  Log Message:
  -----------
  Add tracemem support

Also, replace tst.three_arg.sh with tst.tracemem.d:
- to avoid the problematic profile probe (fires irregularly)
- for cleaner post processing
- to check both 2-arg and 3-arg results

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


  Commit: 279196b58663b04d19276ff58ca67350f28fd483
      https://github.com/oracle/dtrace-utils/commit/279196b58663b04d19276ff58ca67350f28fd483
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  Alternative handling of tracemem's dynamic size.

The tracemem() action takes a constant size argument that gives the size
of the buffer used.

Optionally, it also takes another size argument that is dynamically
computed.  Currently, in this DTrace port, this dsize is used only by the
consumer, to limit how much data is displayed.  The documentation is
unclear if dsize should also limit how much data is written into the
buffer in the first place.  Arguably, it should:

*)  Copying less data might mean faster run time, although the
    savings would be very small and would incur the cost of extra
    BPF instructions.

*)  Copying less data might protect against accessing memory
    illegally.

Using dsize to cap how much data is written into the buffer is
implemented in this patch.

Since any changes in behavior would not be seen in our testing, no test
changes are made.

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


  Commit: 27a7d5f513adc49898020c229e5359a5e585ab4d
      https://github.com/oracle/dtrace-utils/commit/27a7d5f513adc49898020c229e5359a5e585ab4d
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/options/err.D_PRAGMA_OPTSET.ldpath.d
    A test/unittest/options/err.D_PRAGMA_OPTSET.ldpath.r
    A test/unittest/options/err.ldpath.d
    A test/unittest/options/err.ldpath.r
    A test/unittest/options/err.ldpath.r.p
    A test/unittest/options/tst.ldpath.sh

  Log Message:
  -----------
  test: Add tests for ldpath

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


  Commit: 4256450824fd158b0886845b01b75ea442c140f0
      https://github.com/oracle/dtrace-utils/commit/4256450824fd158b0886845b01b75ea442c140f0
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/options/tst.libdir.r
    A test/unittest/options/tst.libdir.sh

  Log Message:
  -----------
  test: Add test for libdir

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


  Commit: 9fd37fb3392bde01ad00e32afd32129fab6303b1
      https://github.com/oracle/dtrace-utils/commit/9fd37fb3392bde01ad00e32afd32129fab6303b1
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/options/err.D_PRAGMA_OPTSET.modpath.d
    A test/unittest/options/err.D_PRAGMA_OPTSET.modpath.r
    A test/unittest/options/tst.modpath.r
    A test/unittest/options/tst.modpath.sh

  Log Message:
  -----------
  test: Add test for modpath

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


  Commit: 8dc870ff7cb2b2e34f1ab71863f77f73c6a09f41
      https://github.com/oracle/dtrace-utils/commit/8dc870ff7cb2b2e34f1ab71863f77f73c6a09f41
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    R test/unittest/dif/copyout.aarch64.x
    M test/unittest/dif/copyout.d
    A test/unittest/funcs/copyout/err.D_PROTO_ARG.copyoutbadarg.d
    A test/unittest/funcs/copyout/err.D_PROTO_ARG.copyoutbadarg.r
    A test/unittest/funcs/copyout/err.D_PROTO_LEN.copyouttoofew.d
    A test/unittest/funcs/copyout/err.D_PROTO_LEN.copyouttoofew.r
    A test/unittest/funcs/copyout/err.D_PROTO_LEN.copyouttoomany.d
    A test/unittest/funcs/copyout/err.D_PROTO_LEN.copyouttoomany.r
    A test/unittest/funcs/copyout/err.copyout.aarch64.x
    A test/unittest/funcs/copyout/err.copyout.d
    A test/unittest/funcs/copyout/err.copyoutbadaddr.aarch64.x
    A test/unittest/funcs/copyout/err.copyoutbadaddr.sh
    A test/unittest/funcs/copyout/tst.copyout.r
    A test/unittest/funcs/copyout/tst.copyout.sh
    R test/unittest/funcs/err.D_PROTO_ARG.copyoutbadarg.d
    R test/unittest/funcs/err.D_PROTO_ARG.copyoutbadarg.r
    R test/unittest/funcs/err.D_PROTO_LEN.copyouttoofew.d
    R test/unittest/funcs/err.D_PROTO_LEN.copyouttoofew.r
    R test/unittest/funcs/err.D_PROTO_LEN.copyouttoomany.d
    R test/unittest/funcs/err.D_PROTO_LEN.copyouttoomany.r
    R test/unittest/funcs/err.copyout.aarch64.x
    R test/unittest/funcs/err.copyout.d
    R test/unittest/funcs/err.copyoutbadaddr.aarch64.x
    R test/unittest/funcs/err.copyoutbadaddr.sh
    M test/unittest/funcs/err.copyoutstrbadaddr.sh
    M test/unittest/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d

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

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


  Commit: d1227225301df82c09c9843cd424e2a9bd7322b5
      https://github.com/oracle/dtrace-utils/commit/d1227225301df82c09c9843cd424e2a9bd7322b5
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/funcs/bcopy/tst.bcopy_arg_order.d
    A test/unittest/funcs/bcopy/tst.bcopy_arg_order.r
    A test/unittest/funcs/copyinto/tst.copyinto_arg_order.d
    A test/unittest/funcs/copyinto/tst.copyinto_arg_order.r

  Log Message:
  -----------
  Restore order of bcopy() arg evaluations

In c26e2e5f279a ("Add support for copyinto() subroutine"), the order
of arg evaluations for bcopy() was changed from evaluating the last
arg (size) last to evaluating it first.  This has semantic implications
when the order of arguments matters.

Restore the previous order (to agree with Solaris semantics) and add
tests for both bcopy() and copyinto().

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


  Commit: 69d78b07ad579ce9fa507c6b5c64b4983b94135d
      https://github.com/oracle/dtrace-utils/commit/69d78b07ad579ce9fa507c6b5c64b4983b94135d
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/funcs/copyoutstr/err.D_PROTO_LEN.copyoutstrbadarg.d
    A test/unittest/funcs/copyoutstr/err.D_PROTO_LEN.copyoutstrbadarg.r
    A test/unittest/funcs/copyoutstr/err.D_PROTO_LEN.copyoutstrtoofew.d
    A test/unittest/funcs/copyoutstr/err.D_PROTO_LEN.copyoutstrtoofew.r
    A test/unittest/funcs/copyoutstr/err.copyoutstrbadaddr.aarch64.x
    A test/unittest/funcs/copyoutstr/err.copyoutstrbadaddr.sh
    A test/unittest/funcs/copyoutstr/tst.copyoutstr.r
    A test/unittest/funcs/copyoutstr/tst.copyoutstr.sh
    R test/unittest/funcs/err.D_PROTO_LEN.copyoutstrbadarg.d
    R test/unittest/funcs/err.D_PROTO_LEN.copyoutstrbadarg.r
    R test/unittest/funcs/err.D_PROTO_LEN.copyoutstrtoofew.d
    R test/unittest/funcs/err.D_PROTO_LEN.copyoutstrtoofew.r
    R test/unittest/funcs/err.copyoutstrbadaddr.aarch64.x
    R test/unittest/funcs/err.copyoutstrbadaddr.sh
    M test/unittest/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d

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

Move tests to their own copyoutstr/ subdirectory to mimic other copy*
tests.

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


  Commit: 990ec8c9cb80f79213a2f8bb2d50df873e80bdc7
      https://github.com/oracle/dtrace-utils/commit/990ec8c9cb80f79213a2f8bb2d50df873e80bdc7
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/options/err.version.d
    A test/unittest/options/err.version.r
    A test/unittest/options/tst.version.r
    A test/unittest/options/tst.version.sh

  Log Message:
  -----------
  test: Add test for option "version"

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


  Commit: 372c882bfc7283edd2ebf7cf48f7d71b87499671
      https://github.com/oracle/dtrace-utils/commit/372c882bfc7283edd2ebf7cf48f7d71b87499671
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    A test/unittest/options/tst.tregs.r
    A test/unittest/options/tst.tregs.sh

  Log Message:
  -----------
  test: Add test for option "tregs"

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


  Commit: d4734e3a2d2ca9eda98e8dc0697a845a51b5398e
      https://github.com/oracle/dtrace-utils/commit/d4734e3a2d2ca9eda98e8dc0697a845a51b5398e
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M include/dtrace/faults_defines.h
    M libdtrace/dt_error.c
    M libdtrace/dt_handle.c

  Log Message:
  -----------
  Add DTRACEFLT_BADINDEX fault

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Elena Zannoni <elena.zannoni at oracle.com>


  Commit: df55d9d159f48236ce17fe9e77a9e5b0cfca3e99
      https://github.com/oracle/dtrace-utils/commit/df55d9d159f48236ce17fe9e77a9e5b0cfca3e99
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    M test/unittest/arrays/tst.declared-bounds.d
    M test/unittest/arrays/tst.declared-bounds.r
    A test/unittest/arrays/tst.declared-bounds.runtime_in.d
    A test/unittest/arrays/tst.declared-bounds.runtime_in.r
    A test/unittest/arrays/tst.declared-bounds.runtime_out.d
    A test/unittest/arrays/tst.declared-bounds.runtime_out.r

  Log Message:
  -----------
  Add run-time checks on bounds for scalar-array access

If a scalar (nonassociated, linearly indexed) array is accessed with
a constant index, the parser checks that the access is in-bounds.
With other index types, however, the value is not known until runtime.
Since the index value is not being checked at runtime, the BPF verifier
does not allow the code to be loaded, lest an invalid address is
dereferenced.

Add a runtime check when we try to add an offset to a scalar array
address.

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


  Commit: f4ce2fc24054255ee96dd7bdba039e8983f80b7a
      https://github.com/oracle/dtrace-utils/commit/f4ce2fc24054255ee96dd7bdba039e8983f80b7a
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    R test/unittest/pid/tst.args1.aarch64.x
    R test/unittest/usdt/tst.args-alt.aarch64.x

  Log Message:
  -----------
  test: remove .x files due to aarch64 kernel fixes for arg8 and arg9

The .x files, apparently needed due to kernel bugs, are no longer
needed with updated kernels.

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


  Commit: a00ee1ec924785bc9c1bee353f2147139abbc000
      https://github.com/oracle/dtrace-utils/commit/a00ee1ec924785bc9c1bee353f2147139abbc000
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  Fix strchr() tstring free

A node's register and tstring have to be managed independently.  E.g.,
in this case, str's register value is moved to another register, and
so str->dn_reg can be freed.  Meanwhile, the associated tstring is still
in use and cannot be freed until later.

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


  Commit: 66bc283625d3796732683f05c0d63f72ae7d9b32
      https://github.com/oracle/dtrace-utils/commit/66bc283625d3796732683f05c0d63f72ae7d9b32
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M test/unittest/dtrace-util/tst.ListProbesName.sh

  Log Message:
  -----------
  test: extend ListProbesname timeout

Extend the timeout on this test to give more breathing room to
slower systems running more recent kernels with more probes.

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


  Commit: c8585886338589e9d9db08017a8fd1724db6ab7c
      https://github.com/oracle/dtrace-utils/commit/c8585886338589e9d9db08017a8fd1724db6ab7c
  Author: Nick Alcock <nick.alcock at oracle.com>
  Date:   2023-02-26 (Sun, 26 Feb 2023)

  Changed paths:
    M test/unittest/speculation/tst.SingleCPU.d
    M test/unittest/speculation/tst.SingleCPU.r

  Log Message:
  -----------
  test: fix speculation/tst.SingleCPU.d

This test is meant to verify that simultaneously-active speculations get
drained and committed/discarded appropriately without losing any of
them.  Unfortunately, it never sets nspec, which is 1 by default, so it
actually runs out of speculations almost immediately: we need at least
16 for this test, which is not so coincidentally the maximum this
implementation supports right now.  Boosting that reveals another
problem: we print out the speculation ID, which is not in any sense a
guaranteed value, so we get lots of test failures: what we *actually*
care about is that the n value printed is suitable (indicating that the
first speculation in any block of (64 / 4) was committed and the rest
were discarded, and who cares what its ID is).

We also knock the switchrate down again because if we knock it up any
higher the discards (which are processed in userspace) don't get
processed fast enough to keep up, and we run out.  We consume 16
speculations in 6.4ms, so set the switchrate to 3ms to give us a bit of
headroom.  (This will still be racy on highly-loaded test systems where
the polls just don't happen fast enough because of system load: if that
happens, we can tag the test suitably in future.)

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


  Commit: b1553e437ddc4e0aed64e1a9c38be4cef0490b35
      https://github.com/oracle/dtrace-utils/commit/b1553e437ddc4e0aed64e1a9c38be4cef0490b35
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-26 (Sun, 26 Feb 2023)

  Changed paths:
    M test/unittest/funcs/strjoin/tst.strjoin_nonDPTR.d
    M test/unittest/funcs/strjoin/tst.strjoin_nonDPTR.r
    M test/unittest/funcs/strtok/tst.strtok_nonDPTR.d
    M test/unittest/funcs/strtok/tst.strtok_nonDPTR.r
    M test/unittest/funcs/substr/tst.substr_nonDPTR.d
    M test/unittest/funcs/substr/tst.substr_nonDPTR.r
    M test/unittest/funcs/tst.basename_nonDPTR.d
    M test/unittest/funcs/tst.basename_nonDPTR.r
    M test/unittest/funcs/tst.dirname_nonDPTR.d
    M test/unittest/funcs/tst.dirname_nonDPTR.r
    M test/unittest/funcs/tst.index_nonDPTR.d
    M test/unittest/funcs/tst.inet_ntoa_nonDPTR.d
    M test/unittest/funcs/tst.inet_ntoa_nonDPTR.r
    M test/unittest/funcs/tst.rindex_nonDPTR.d
    M test/unittest/funcs/tst.strchr_nonDPTR.d
    M test/unittest/funcs/tst.strchr_nonDPTR.r

  Log Message:
  -----------
  test: Use kernel pointer for nonDPTR tests

The nonDPTR tests need to use non-DTrace pointers to be meaningful.
They were using pointers in user space, but technically speaking such
pointers should first be copied (e.g., with copyin or copyinstr) first.
But that makes them DTrace pointers, bypassing the whole point!

Use a kernel pointer like `linux_banner.  Use short strsize so that .r
results files will check consistent "Linux version " strings.

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


  Commit: 76f1b578f6e88109dd6a503a6042dd9aca2b624c
      https://github.com/oracle/dtrace-utils/commit/76f1b578f6e88109dd6a503a6042dd9aca2b624c
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-27 (Mon, 27 Feb 2023)

  Changed paths:
    M libdtrace/arm64/regs.d
    M libdtrace/dt_bpf.c
    M libdtrace/dt_cg.c
    M libdtrace/i386/regs.d
    R test/demo/builtin/uregs.sparc64.aarch64.x
    R test/demo/builtin/uregs.sparc64.d
    R test/demo/builtin/uregs.sparc64.x86_64.x
    R test/demo/builtin/uregs.x86_64.aarch64.x
    R test/demo/builtin/uregs.x86_64.d
    R test/demo/builtin/uregs.x86_64.sparc64.x
    A test/unittest/arrays/err.D_PROTO_ARG.uregs_variable.d
    A test/unittest/arrays/err.D_PROTO_ARG.uregs_variable.r
    A test/unittest/arrays/err.D_UNKNOWN.uregs_badkernelversion.d
    A test/unittest/arrays/err.D_UNKNOWN.uregs_badkernelversion.r
    A test/unittest/arrays/err.D_UNKNOWN.uregs_badkernelversion.x
    A test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.aarch64.d
    A test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.aarch64.r
    A test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.aarch64.x
    A test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.x86_64.d
    A test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.x86_64.r
    A test/unittest/arrays/err.D_UNKNOWN.uregs_toobig.x86_64.x
    A test/unittest/arrays/tst.uregsarray-check.sh
    A test/unittest/arrays/tst.uregsarray-check.x
    A test/unittest/arrays/tst.uregsarray-constants.aarch64.d
    A test/unittest/arrays/tst.uregsarray-constants.aarch64.r
    A test/unittest/arrays/tst.uregsarray-constants.aarch64.x
    A test/unittest/arrays/tst.uregsarray-constants.x86_64.d
    A test/unittest/arrays/tst.uregsarray-constants.x86_64.r
    A test/unittest/arrays/tst.uregsarray-constants.x86_64.x
    M test/unittest/arrays/tst.uregsarray.arm64.d
    M test/unittest/arrays/tst.uregsarray.arm64.x
    M test/unittest/arrays/tst.uregsarray.d
    A test/unittest/arrays/tst.uregsarray.x
    M test/unittest/arrays/tst.uregsarray.x86_64.d
    M test/unittest/arrays/tst.uregsarray.x86_64.x
    M test/unittest/disasm/tst.ann-bvar.r
    M test/unittest/disasm/tst.ann-bvar.sh
    A test/unittest/disasm/tst.vartab-bvar-uregs0.r
    A test/unittest/disasm/tst.vartab-bvar-uregs0.sh
    A test/unittest/disasm/tst.vartab-bvar-uregs0.x
    M test/unittest/disasm/tst.vartab-bvar.r
    M test/unittest/disasm/tst.vartab-bvar.sh
    R test/unittest/variables/bvar/tst.uregs.d

  Log Message:
  -----------
  Add support for uregs[]

The uregs[] essentially access (struct pt_regs) for the current task.
Therefore, we use the combination of BPF helper functions
bpf_task_pt_regs(bpf_get_current_task_btf()) to access pt_regs.

Note that older kernels might not support these helper functions.
So dt_bpf_init_helpers() checks, and if the needed functions are
missing an error results.

One place to put uregs[] support is in bpf/get_bvar.c.  On the other
hand, that means that the build system needs a gcc-bpf-unknown-none
that knows about these functions.  So, just generate the code ourselves
to call the two helper functions;  this is not much more difficult
than calling dt_get_bvar().

Further note that the documented symbolic indices to uregs[] seem
incorrect.  For x86, R_UESP is documented but not defined, and there
are many more indices that are defined but not documented.  For ARM,
the documented indices bear little resemblance to the defined (and
sensible!) values.

The support for symbolic indices to uregs[] on x86 mimics that found
in the legacy DTrace port to Linux -- that is, dtrace_getreg() from
kernel code arch/x86/dtrace/dtrace_isa_x86_64.c .  The logic is
convoluted and possibly incorrect.  Some uregs[] indices do not read
from (struct pt_regs) but from task->thread.*, complicating the
implementation.  This matter warrants further attention, but for now
mimicking the legacy port seems sufficient.

For the time being, there is no annotating disassembly with "uregs".
This can be added back in a future patch once other dust has settled.

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


  Commit: 397b9a79a5f60c0c57dfc27d0b69894189a8bc33
      https://github.com/oracle/dtrace-utils/commit/397b9a79a5f60c0c57dfc27d0b69894189a8bc33
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-02-27 (Mon, 27 Feb 2023)

  Changed paths:
    M NEWS
    M dtrace.spec

  Log Message:
  -----------
  Update NEWS and spec file for errata release 2.0.0-1.12

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


Compare: https://github.com/oracle/dtrace-utils/compare/ca761db74a14...397b9a79a5f6



More information about the DTrace-devel mailing list