Skip to content

Commit

Permalink
test: update and move tst.subr.d
Browse files Browse the repository at this point in the history
The tst.subr.d test resided under the aggs/ hierarchy which does not
make sense because it tests for the implementation of subroutines (and
simply uses aggregations to collect data based on subroutine return
types (int, string, or void).

The test has been updated to reflect the current set of implemented
subroutines.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
kvanhees committed Aug 16, 2023
1 parent 4f0cede commit cffbce3
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/unittest/aggs/tst.subr.d → test/unittest/funcs/tst.subr.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
/* @@xfail: dtv2 */

/* @@runtest-opts: -C */

#include <sys/dtrace.h>
#include <stdint.h>
#include <dtrace/dif_defines.h>

#define INTFUNC(x) \
BEGIN \
Expand Down Expand Up @@ -36,13 +36,13 @@
/*DSTYLED*/ \
}

#define NUM_UNIMPLEMENTED 2
#define NUM_UNIMPLEMENTED 7

INTFUNC(rand())
INTFUNC(mutex_owned(&dtrace`dtrace_lock))
INTFUNC(mutex_owner(&dtrace`dtrace_lock))
INTFUNC(mutex_type_adaptive(&dtrace`dtrace_lock))
INTFUNC(mutex_type_spin(&dtrace`dtrace_lock))
INTFUNC(mutex_owned(&`bpf_verifier_lock))
INTFUNC(mutex_owner(&`bpf_verifier_lock))
INTFUNC(mutex_type_adaptive(&`bpf_verifier_lock))
INTFUNC(mutex_type_spin(&`bpf_verifier_lock))
INTFUNC(rw_read_held(&`tasklist_lock))
INTFUNC(rw_write_held(&`tasklist_lock))
INTFUNC(rw_iswriter(&`tasklist_lock))
Expand All @@ -61,12 +61,14 @@ VOIDFUNC(copyinto)
INTFUNC(msgsize(NULL)) */
INTFUNC(getmajor(0))
INTFUNC(getminor(0))
STRFUNC(ddi_pathname(NULL, 0))
/* Not implemented.
STRFUNC(ddi_pathname(NULL, 0)) */
STRFUNC(strjoin("foo", "bar"))
STRFUNC(lltostr(12373))
STRFUNC(basename("/var/crash/systemtap"))
STRFUNC(dirname("/var/crash/systemtap"))
STRFUNC(cleanpath("/var/crash/systemtap"))
/* Not implemented yet.
STRFUNC(cleanpath("/var/crash/systemtap")) */
STRFUNC(strchr("The SystemTap, The.", 't'))
STRFUNC(strrchr("The SystemTap, The.", 't'))
STRFUNC(strstr("The SystemTap, The.", "The"))
Expand All @@ -80,11 +82,13 @@ INTFUNC(htonll(0x1234567890abcdefL))
INTFUNC(ntohs(0x1234))
INTFUNC(ntohl(0x12345678))
INTFUNC(ntohll(0x1234567890abcdefL))
STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof(ipaddr_t))))
/* Not implemented yet.
STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof(ipaddr_t)))) */
STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof(ipaddr_t))))
STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof(in6_addr_t))))
STRFUNC(d_path(&(curthread->fs->root)))
STRFUNC(link_ntop(ARPHRD_ETHER, (void *)alloca(sizeof(ipaddr_t))))
/* Not implemented yet.
STRFUNC(d_path(&(curthread->fs->root)))
STRFUNC(link_ntop(ARPHRD_ETHER, (void *)alloca(sizeof(ipaddr_t)))) */

BEGIN
/subr == DIF_SUBR_MAX + 1 - NUM_UNIMPLEMENTED/
Expand Down

0 comments on commit cffbce3

Please sign in to comment.