[DTrace-devel] [oracle/dtrace-utils] ee2bd3: test: Use a more ubiquitous probe for return()-act...

euloh noreply at github.com
Mon Aug 18 16:40:45 UTC 2025


  Branch: refs/heads/devel
  Home:   https://github.com/oracle/dtrace-utils
  Commit: ee2bd34655e4b9077a4b5c49cc30a553dd07b929
      https://github.com/oracle/dtrace-utils/commit/ee2bd34655e4b9077a4b5c49cc30a553dd07b929
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-08-15 (Fri, 15 Aug 2025)

  Changed paths:
    M test/unittest/actions/return/err.destructive.d
    M test/unittest/actions/return/tst.destructive.d

  Log Message:
  -----------
  test: Use a more ubiquitous probe for return()-action tests

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


  Commit: 4f222aef5792eafa69b920a3e8f193b84dd1994d
      https://github.com/oracle/dtrace-utils/commit/4f222aef5792eafa69b920a3e8f193b84dd1994d
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-08-15 (Fri, 15 Aug 2025)

  Changed paths:
    M libdtrace/dt_consume.c

  Log Message:
  -----------
  Use a consistent type for dtrace_consume()

For a long time, the type of dtrace_consume() has been
- int                 according to libdtrace/dtrace.h
- dtrace_workstatus_t according to libdtrace/dt_consume.c

With some recent compilers, however, this triggers the warning (redacted
here):

    libdtrace/dt_consume.c:3041:1: warning: conflicting types
    for ‘dtrace_consume’ due to enum/integer mismatch;
    have ‘dtrace_workstatus_t(...)’ [-Wenum-int-mismatch]
     3041 | dtrace_consume(...)
          | ^~~~~~~~~~~~~~
    In file included from libdtrace/dt_impl.h:14,
                     from libdtrace/dt_consume.c:16:
    libdtrace/dtrace.h:210:12: note: previous declaration of
    ‘dtrace_consume’ with type ‘int(...)’
      210 | extern int dtrace_consume(...)
          |            ^~~~~~~~~~~~~~

which is a nuisance.

Note that dtrace_consume() is called from only one site, where its
value is compared to DTRACE_WORKSTATUS_ERROR, which is an argument
for the dtrace_workstatus_t type.

On the other hand, dtrace_consume() is defined to return a variety
of values, like 0, dt_set_errno(), and dt_consume_cpu(), all of which
are int, but also DTRACE_WORKSTATUS_OKAY, DTRACE_WORKSTATUS_ERROR,
and rval, all of which are dtrace_workstatus_t.  But then rval itself
is set to dtrace_workstatus_t dt_consume_begin() or int
dt_consume_cpu().  So, there is simply no consistency here.

Having the prototype be dtrace_workstatus_t requires some amount
of code refactoring.

Just change the definition to int and clean up the warning.

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


  Commit: 321bf3fea1ac0481f51f588017e3bb363b7be5c3
      https://github.com/oracle/dtrace-utils/commit/321bf3fea1ac0481f51f588017e3bb363b7be5c3
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2025-08-18 (Mon, 18 Aug 2025)

  Changed paths:
    M COMMANDLINE-OPTIONS
    A test/unittest/preprocessor/tst.predefined.r
    A test/unittest/preprocessor/tst.predefined.sh

  Log Message:
  -----------
  test: Add test for predefined preprocessor definitions

Orabug: 28763074
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/8248f62f2c1c...321bf3fea1ac

To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications



More information about the DTrace-devel mailing list