[DTrace-devel] [oracle/dtrace-utils] 5a76f6: parser: ensure 'args' is not marked DPTR

euloh noreply at github.com
Mon Mar 6 16:12:55 UTC 2023


The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.

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

  Changed paths:
    M libdtrace/dt_parser.c

  Log Message:
  -----------
  parser: ensure 'args' is not marked DPTR

Since args[] is not actually an array it should not be marked DPTR.
It is not a pointer at all to any memory but rather a syntactic
construct to be able to reference (possibly translated) typed probe
arguments.  It can only be used as an indexed expression (args[idx])
and is rendered in code as either a builtin variable (arg0 .. arg9)
lookup or as a dynamic expression.

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


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

  Changed paths:
    M libdtrace/dt_htab.c
    M libdtrace/dt_htab.h

  Log Message:
  -----------
  htab: support lookups for buckets with multiple entries

Probes are represented by a quadruple naming scheme.  For easy lookup,
hashtables are kept based on each naming component.  When performing
lookups based on one of those hashtables, the head element was always
returned which is obviously wrong.

This patch introduced dt_htab_find() which provides for lookups using
a template entry and a secondary comparison function that is used to
evaluate the different entries in the bucket that match the template.

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


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

  Changed paths:
    M libdtrace/dt_probe.c

  Log Message:
  -----------
  fix probe lookups mixing static and glob components

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


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

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  cg: fix support for REF-types in dt_cg_store_val()

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


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

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_cg.h
    M libdtrace/dt_dctx.h

  Log Message:
  -----------
  cg: support save/restore of probe arguments

With the upcoming introduction of dependent probes (probes that use
another underlying probe as trigger), we need to be able to save the
probe arguments for the underlying probe so that the arguments can be
modified in preparation for execution of the clauses of the dependent
probe.  After all such clauses have been executed, the probe arguments
need to be restored in case there is another dependent probe (with
possibly different arguments).

Dependent probes can only be one layer deep so we only eveyr need one
copy of the arguments.

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


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

  Changed paths:
    M libdtrace/dt_bpf.c
    M libdtrace/dt_bpf.h

  Log Message:
  -----------
  Implement dt_bpf_raw_tracepoint_open()

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


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

  Changed paths:
    M libdtrace/dt_provider.h
    M libdtrace/dt_provider_tp.c

  Log Message:
  -----------
  provider: Add support for attaching to raw tracepoints

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


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

  Changed paths:
    M libdtrace/dt_bpf.c
    M libdtrace/dt_bpf.h

  Log Message:
  -----------
  bpf: make dt_bpf_prog_load() available to other source files

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


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

  Changed paths:
    M libdtrace/Build
    M libdtrace/dt_open.c
    A libdtrace/dt_prov_rawtp.c
    M libdtrace/dt_provider.h

  Log Message:
  -----------
  provider: Implement a rawtp provider

BPF allows attaching to raw forms of tracepoints, which allows access
to the raw arguments.  (Regular tracepoints often expose translated
arguments based on the raw arguments that were passed in the tracepoint
call.)

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


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

  Changed paths:
    M libdtrace/dt_bpf.c
    M libdtrace/dt_prov_uprobe.c

  Log Message:
  -----------
  Change condition to bypass trampoline generation

Originally, all providers were backed by system level probes and needed
a trampoline to be generated to convert from a BPF context to the DTrace
context DTrace expects.  With the introduction of pid probes, we gained
a provider that did not use a trampoline because it is implemented by
adding clauses to an underlying probe (using the same DTrace context as
the underlying probe).

But in a more generic sense (and soon to be used for SDT providers), we
eed to be able to support providers that do not generate programs that
are directly attached to system level probes while still needing to be
able to generate a trampoline.  So, the existance of a trampoline hook
is not sufficient.

Fortunately, all providers specify a BPF prgoram type that indicates the
system level probe type the program need to be generated for.  For
providers that do not generate actual programs, we can therefore specify
BPF_PROG_TYPE_UNSPEC as program type, and test for that to determine
whether the trampoline function is to be called at program load time.

Future patches will introduce a code path where a trampoline function is
called for a non-program load case.

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


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

  Changed paths:
    M libdtrace/dt_dlibs.c
    M libdtrace/dt_impl.h
    M libdtrace/dt_prov_uprobe.c

  Log Message:
  -----------
  dlib: Add dt_dlib_add_probe_var()

This new function defines a BPF symbol (variable) with the fully
qualified probe name as name, and the probe ID as value.

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


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

  Changed paths:
    M libdtrace/dt_dlibs.c

  Log Message:
  -----------
  dlib: Ensure dt_dlib_add_sym_id() does not add duplicates

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


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

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_prov_dtrace.c
    M libdtrace/dt_prov_fbt.c
    M libdtrace/dt_prov_profile.c
    M libdtrace/dt_prov_rawtp.c
    M libdtrace/dt_prov_sdt.c
    M libdtrace/dt_prov_syscall.c
    M libdtrace/dt_prov_uprobe.c
    M libdtrace/dt_provider.h

  Log Message:
  -----------
  cg: Pass exit label to trampoline

Some trampolines will need to be able to gemerate code for some form of
pre-conditions.  It therefore needs to know a jump label that will be
positioned right after the trampoline being generated.

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


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

  Changed paths:
    M libdtrace/dt_cc.c
    M libdtrace/dt_cg.c
    M libdtrace/dt_probe.c
    M libdtrace/dt_probe.h

  Log Message:
  -----------
  cg: Implement dependent probes

Some providers may wish to implement probes on top of other probes.
This patch provides the concept of dependent probes: probes that use
other probes as their firing mechanism.  This is accomplished by
generating a custom trampoline that converts the DTrace context of
the underlying probe into a DTrace context for the dependent probe
and then adding the clauses for the dependent probe to the underlying
probe.

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


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

  Changed paths:
    M libdtrace/Build
    M libdtrace/dt_open.c
    A libdtrace/dt_prov_proc.c
    M libdtrace/dt_provider.h
    M test/demo/proc/lwptime.d
    M test/demo/proc/progtime.d
    M test/demo/proc/sig.d
    M test/demo/proc/whoexec.d
    M test/unittest/builtinvar/tst.errno2.d
    M test/unittest/dtrace-util/tst.ProcGrab.sh
    M test/unittest/dtrace-util/tst.ProcInvoke.sh
    M test/unittest/pid/tst.fork.d
    M test/unittest/pid/tst.vfork.d
    M test/unittest/proc/tst.create.sh
    M test/unittest/proc/tst.discard.sh
    M test/unittest/proc/tst.exec.sh
    M test/unittest/proc/tst.execfail.ENOENT.sh
    M test/unittest/proc/tst.execfail.sh
    M test/unittest/proc/tst.exitcore.sh
    M test/unittest/proc/tst.exitexit.sh
    M test/unittest/proc/tst.startexit.sh
    M test/unittest/regression/exit_panic.d

  Log Message:
  -----------
  Implement the proc provider

The following probes (and their arguments) are currently supported:

proc:::exec
proc:::exec-failure
proc:::exec-success
proc:::exit
proc:::lwp-exit
proc:::create
proc:::lwp-create
proc:::start
proc:::lwp-start
proc:::signal-discard
proc:::signal-handle
proc:::signal-send

Various tests now pass and therefore no longer need @@xfail.

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


  Commit: a97c5cb9650c7f271150f0a35553ae1a60fe09fb
      https://github.com/oracle/dtrace-utils/commit/a97c5cb9650c7f271150f0a35553ae1a60fe09fb
  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 (correction)

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


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

  Changed paths:
    M test/unittest/proc/tst.exitcore.sh

  Log Message:
  -----------
  test: ensure tst.exitcore.sh works on all systems

Some systems have a very strict separation between reading from kernel
vs userspace addresses.  The test has been updated to always use
copyin() and copyinstr() when accessing userspace addresses.

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


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

  Changed paths:
    M libdtrace/dt_cg.c

  Log Message:
  -----------
  Use highest bit to decide if PC is user space or kernel

Currently, we decide if a PC is user space or kernel based on whether
the BPF helper function probe_read_kernel() can read the address.
On systems where this BPF helper function does not exist, there is a
back-up mechanism that simply checks the highest bit of the PC.

Apparently, on some systems, the helper function can read addresses
even in user space.  That is, the mechanism that uses the helper function
is not reliable.

So, just use the "back-up mechanism" all the time.

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


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

  Changed paths:
    M libdtrace/dt_prov_cpc.c

  Log Message:
  -----------
  cpc: fix trampoline signature

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


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

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_probe.c
    M libdtrace/dt_prov_proc.c
    M libdtrace/dt_provider.h
    M libdtrace/dt_provider_tp.c

  Log Message:
  -----------
  cg, sdt: copy userspace string arguments to kernelspace

When an SDT probe argument is provided by a userspace string, it must be
copied to kernelspace because SDT probe pointer arguments are expected
to be kernel addresses.

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


  Commit: 7346a437a46318bf1a3f2e5edc8a0096828bdb38
      https://github.com/oracle/dtrace-utils/commit/7346a437a46318bf1a3f2e5edc8a0096828bdb38
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-28 (Tue, 28 Feb 2023)

  Changed paths:
    M test/unittest/cpc/tst.mode_kernel.sh
    M test/unittest/cpc/tst.mode_user.sh
    M test/unittest/funcs/tst.rand_inter.sh
    M test/unittest/funcs/tst.rand_intra.sh

  Log Message:
  -----------
  test: Loosen some tolerances on tests

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


  Commit: 19c2e3130b305ea70660c40aff2943a93fe925ba
      https://github.com/oracle/dtrace-utils/commit/19c2e3130b305ea70660c40aff2943a93fe925ba
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-02-28 (Tue, 28 Feb 2023)

  Changed paths:
    M test/unittest/aggs/tst.clearlquantize.d
    M test/unittest/aggs/tst.clearlquantize.r

  Log Message:
  -----------
  test: Make clearlquantize less susceptible to timer variations

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


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

  Changed paths:
    M test/unittest/cpc/tst.args_kernel.sh
    M test/unittest/cpc/tst.args_user.sh
    M test/unittest/cpc/tst.mode_kernel.sh
    M test/unittest/cpc/tst.mode_user.sh
    M test/unittest/profile-n/tst.args_kernel.sh
    M test/unittest/profile-n/tst.args_user.sh

  Log Message:
  -----------
  test: Mark some tests as unstable

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/397b9a79a5f6...f543fa6706c0



More information about the DTrace-devel mailing list