[DTrace-devel] [PATCH] test: update and move tst.subr.d

Kris Van Hees kris.van.hees at oracle.com
Fri Aug 18 18:06:17 UTC 2023


On Fri, Aug 18, 2023 at 01:55:39PM -0400, Eugene Loh via DTrace-devel wrote:
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> 
> I don't know if the copyright year needs updating?

Hm, yes, will do.

> Also, usually we have xfail so that testing alerts us if something has
> started working.  I suppose in the case of this patch, we'll probably be
> sufficiently alert that we'll uncomment the appropriate lines when the new
> subroutines are implemented.

This is a bit different - it will FAIL when things start working :)  But the
effect is the same.  I rather it test the implemented functions rather than
highlight the ones still pending (other tests already do that on a per-function
bases).

> On 8/18/23 09:58, Kris Van Hees via DTrace-devel wrote:
> > 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 at oracle.com>
> > ---
> >   test/unittest/{aggs => funcs}/tst.subr.d | 28 ++++++++++++++----------
> >   1 file changed, 16 insertions(+), 12 deletions(-)
> >   rename test/unittest/{aggs => funcs}/tst.subr.d (76%)
> > 
> > diff --git a/test/unittest/aggs/tst.subr.d b/test/unittest/funcs/tst.subr.d
> > similarity index 76%
> > rename from test/unittest/aggs/tst.subr.d
> > rename to test/unittest/funcs/tst.subr.d
> > index 0fa97fe6..fe98119c 100644
> > --- a/test/unittest/aggs/tst.subr.d
> > +++ b/test/unittest/funcs/tst.subr.d
> > @@ -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				\
> > @@ -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))
> > @@ -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"))
> > @@ -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/
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list