Skip to content

Commit

Permalink
errors: invalid probe IDs should return EDT_BADID, as in v1
Browse files Browse the repository at this point in the history
They were returning EDT_NOPROBE, causing several tests for -i to fail.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
nickalcock authored and kvanhees committed Sep 29, 2021
1 parent 01b22a1 commit 2015eb2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libdtrace/dt_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,11 +1423,11 @@ dtrace_id2desc(dtrace_hdl_t *dtp, dtrace_id_t id, dtrace_probedesc_t *pdp)
dt_probe_t *prp;

if (id >= dtp->dt_probe_id)
return dt_set_errno(dtp, EDT_NOPROBE);
return dt_set_errno(dtp, EDT_BADID);

prp = dtp->dt_probes[id];
if (!prp)
return dt_set_errno(dtp, EDT_NOPROBE);
return dt_set_errno(dtp, EDT_BADID);

memcpy(pdp, prp->desc, sizeof(dtrace_probedesc_t));

Expand Down
3 changes: 1 addition & 2 deletions test/unittest/dtrace-util/tst.InvalidTraceID1.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2021, 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

##
#
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/dtrace-util/tst.InvalidTraceID3.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2021, 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

##
#
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/dtrace-util/tst.InvalidTraceID7.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2021, 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

##
#
Expand Down
3 changes: 1 addition & 2 deletions test/unittest/dtrace-util/tst.ZeroProbeIdentifier.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2021, 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

##
#
Expand Down

0 comments on commit 2015eb2

Please sign in to comment.