14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * or http://www.opensolaris.org/os/licensing.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma ident "%Z%%M% %I% %E% SMI"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#include <sys/dtrace.h>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#define INTFUNC(x) \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync BEGIN \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /*DSTYLED*/ \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync { \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync subr++; \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync @[(long)x] = sum(1); \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /*DSTYLED*/ \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync }
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#define STRFUNC(x) \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync BEGIN \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /*DSTYLED*/ \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync { \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync subr++; \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync @str[x] = sum(1); \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /*DSTYLED*/ \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync }
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#define VOIDFUNC(x) \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync BEGIN \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /*DSTYLED*/ \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync { \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync subr++; \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /*DSTYLED*/ \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync }
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(rand())
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(mutex_owned(&`cpu_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(mutex_owner(&`cpu_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(mutex_type_adaptive(&`cpu_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(mutex_type_spin(&`cpu_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(rw_read_held(&`vfssw_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(rw_write_held(&`vfssw_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(rw_iswriter(&`vfssw_lock))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(copyin(NULL, 1))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(copyinstr(NULL, 1))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(speculation())
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(progenyof($pid))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(strlen("fooey"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVOIDFUNC(copyout)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVOIDFUNC(copyoutstr)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(alloca(10))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVOIDFUNC(bcopy)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVOIDFUNC(copyinto)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(msgdsize(NULL))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(msgsize(NULL))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(getmajor(0))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(getminor(0))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(ddi_pathname(NULL, 0))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(strjoin("foo", "bar"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(lltostr(12373))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(basename("/var/crash/systemtap"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(dirname("/var/crash/systemtap"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(cleanpath("/var/crash/systemtap"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(strchr("The SystemTap, The.", 't'))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(strrchr("The SystemTap, The.", 't'))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(strstr("The SystemTap, The.", "The"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(strtok("The SystemTap, The.", "T"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(substr("The SystemTap, The.", 0))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(index("The SystemTap, The.", "The"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(rindex("The SystemTap, The.", "The"))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(htons(0x1234))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(htonl(0x12345678))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(htonll(0x1234567890abcdefL))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(ntohs(0x1234))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(ntohl(0x12345678))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncINTFUNC(ntohll(0x1234567890abcdefL))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSTRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncBEGIN
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/subr == DIF_SUBR_MAX + 1/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync{
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync exit(0);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync}
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncBEGIN
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync{
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync printf("found %d subroutines, expected %d\n", subr, DIF_SUBR_MAX + 1);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync exit(1);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync}