Skip to content

Commit

Permalink
Error out on unrecognized actions
Browse files Browse the repository at this point in the history
Note that this patch causes a few spuriously passing tests now
to fail.  So, they must be marked XFAIL.

One odd test is tst.clearavg2.d.  It was already marked XFAIL,
with the message made even more specific in patch fb264ec ("test:
Annotate tests that require missing features"), indicting clear().
But the test had actually started passing a few patches earlier,
in f256db8 ("Implement setopt()"), when the consumer was modified
to skip over unrecognized DTRACEACT_LIBACT records.  So, the test
had started to XPASS, an indication of its leniency.  With the
current patch, that test now correctly XFAILs:  its behavior is
now in line with its XFAIL.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
euloh authored and kvanhees committed Nov 1, 2022
1 parent 7ae3960 commit 147e59e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions libdtrace/dt_cg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ dt_cg_act_clear(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
* AGGID = aid->di_id
*/
dt_cg_store_val(pcb, anp, DTRACEACT_LIBACT, NULL, DT_ACT_CLEAR);
dnerror(dnp, D_UNKNOWN, "clear() is not implemented (yet)\n");
}

/*
Expand Down Expand Up @@ -1517,6 +1518,8 @@ dt_cg_act_ftruncate(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
static void
dt_cg_act_jstack(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
{
dnerror(dnp, D_UNKNOWN, "jstack() is not implemented (yet)\n");
/* FIXME: Needs implementation */
}

static void
Expand Down Expand Up @@ -1554,11 +1557,15 @@ dt_cg_act_normalize(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
static void
dt_cg_act_panic(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
{
dnerror(dnp, D_UNKNOWN, "panic() is not implemented (yet)\n");
/* FIXME: Needs implementation */
}

static void
dt_cg_act_pcap(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
{
dnerror(dnp, D_UNKNOWN, "pcap() is not implemented (yet)\n");
/* FIXME: Needs implementation */
}

static void
Expand Down Expand Up @@ -1916,6 +1923,8 @@ dt_cg_act_trace(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
static void
dt_cg_act_tracemem(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
{
dnerror(dnp, D_UNKNOWN, "tracemem() is not implemented (yet)\n");
/* FIXME: Needs implementation */
}

static void
Expand Down Expand Up @@ -1964,6 +1973,7 @@ dt_cg_act_trunc(dt_pcb_t *pcb, dt_node_t *dnp, dtrace_actkind_t kind)
*/
dt_cg_store_val(pcb, trunc, DTRACEACT_LIBACT, NULL, DT_ACT_TRUNC);
#endif
dnerror(dnp, D_UNKNOWN, "trunc() is not implemented (yet)\n");
}

static void
Expand Down
2 changes: 1 addition & 1 deletion libdtrace/dt_consume.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,7 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size,
continue;
}
default:
continue;
return dt_set_errno(dtp, EDT_ERRABORT);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/unittest/tracemem/tst.init_task.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 - requires tracemem() */

/*
* ASSERTION:
Expand All @@ -13,7 +14,6 @@
* SECTION: Actions and Subroutines/tracemem()
*/


BEGIN
{
i = 1;
Expand Down
3 changes: 2 additions & 1 deletion test/unittest/types/tst.complex.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
* Oracle Linux DTrace.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2022, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 - requires tracemem() */

/*
* ASSERTION:
Expand Down

0 comments on commit 147e59e

Please sign in to comment.