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