Print this page
12385 tst.subr.d needs fixing for NULL as a pointer


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
  26  */
  27 
  28 #include <sys/dtrace.h>
  29 
  30 #define INTFUNC(x)                      \
  31         BEGIN                           \
  32         /*DSTYLED*/                     \
  33         {                               \
  34                 subr++;                 \
  35                 @[(long)x] = sum(1);    \
  36         /*DSTYLED*/                     \
  37         }
  38 
  39 #define STRFUNC(x)                      \
  40         BEGIN                           \
  41         /*DSTYLED*/                     \
  42         {                               \
  43                 subr++;                 \
  44                 @str[x] = sum(1);       \
  45         /*DSTYLED*/                     \
  46         }
  47 
  48 #define VOIDFUNC(x)                     \
  49         BEGIN                           \
  50         /*DSTYLED*/                     \
  51         {                               \
  52                 subr++;                 \
  53         /*DSTYLED*/                     \
  54         }
  55 
  56 INTFUNC(rand())
  57 INTFUNC(mutex_owned(&`cpu_lock))
  58 INTFUNC(mutex_owner(&`cpu_lock))
  59 INTFUNC(mutex_type_adaptive(&`cpu_lock))
  60 INTFUNC(mutex_type_spin(&`cpu_lock))
  61 INTFUNC(rw_read_held(&`vfssw_lock))
  62 INTFUNC(rw_write_held(&`vfssw_lock))
  63 INTFUNC(rw_iswriter(&`vfssw_lock))
  64 INTFUNC(copyin(NULL, 1))
  65 STRFUNC(copyinstr(NULL, 1))
  66 INTFUNC(speculation())
  67 INTFUNC(progenyof($pid))
  68 INTFUNC(strlen("fooey"))
  69 VOIDFUNC(copyout)
  70 VOIDFUNC(copyoutstr)
  71 INTFUNC(alloca(10))
  72 VOIDFUNC(bcopy)
  73 VOIDFUNC(copyinto)
  74 INTFUNC(msgdsize(NULL))
  75 INTFUNC(msgsize(NULL))
  76 INTFUNC(getmajor(0))
  77 INTFUNC(getminor(0))
  78 STRFUNC(ddi_pathname(NULL, 0))
  79 STRFUNC(strjoin("foo", "bar"))
  80 STRFUNC(lltostr(12373))
  81 STRFUNC(basename("/var/crash/systemtap"))
  82 STRFUNC(dirname("/var/crash/systemtap"))
  83 STRFUNC(cleanpath("/var/crash/systemtap"))
  84 STRFUNC(strchr("The SystemTap, The.", 't'))
  85 STRFUNC(strrchr("The SystemTap, The.", 't'))




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  * Copyright 2020 Joyent, Inc.
  26  */
  27 
  28 #include <sys/dtrace.h>
  29 
  30 #define INTFUNC(x)                      \
  31         BEGIN                           \
  32         /*DSTYLED*/                     \
  33         {                               \
  34                 subr++;                 \
  35                 @[(long)x] = sum(1);    \
  36         /*DSTYLED*/                     \
  37         }
  38 
  39 #define STRFUNC(x)                      \
  40         BEGIN                           \
  41         /*DSTYLED*/                     \
  42         {                               \
  43                 subr++;                 \
  44                 @str[x] = sum(1);       \
  45         /*DSTYLED*/                     \
  46         }
  47 
  48 #define VOIDFUNC(x)                     \
  49         BEGIN                           \
  50         /*DSTYLED*/                     \
  51         {                               \
  52                 subr++;                 \
  53         /*DSTYLED*/                     \
  54         }
  55 
  56 INTFUNC(rand())
  57 INTFUNC(mutex_owned(&`cpu_lock))
  58 INTFUNC(mutex_owner(&`cpu_lock))
  59 INTFUNC(mutex_type_adaptive(&`cpu_lock))
  60 INTFUNC(mutex_type_spin(&`cpu_lock))
  61 INTFUNC(rw_read_held(&`vfssw_lock))
  62 INTFUNC(rw_write_held(&`vfssw_lock))
  63 INTFUNC(rw_iswriter(&`vfssw_lock))
  64 INTFUNC(copyin((uintptr_t)NULL, 1))
  65 STRFUNC(copyinstr((uintptr_t)NULL, 1))
  66 INTFUNC(speculation())
  67 INTFUNC(progenyof($pid))
  68 INTFUNC(strlen("fooey"))
  69 VOIDFUNC(copyout)
  70 VOIDFUNC(copyoutstr)
  71 INTFUNC(alloca(10))
  72 VOIDFUNC(bcopy)
  73 VOIDFUNC(copyinto)
  74 INTFUNC(msgdsize(NULL))
  75 INTFUNC(msgsize(NULL))
  76 INTFUNC(getmajor(0))
  77 INTFUNC(getminor(0))
  78 STRFUNC(ddi_pathname(NULL, 0))
  79 STRFUNC(strjoin("foo", "bar"))
  80 STRFUNC(lltostr(12373))
  81 STRFUNC(basename("/var/crash/systemtap"))
  82 STRFUNC(dirname("/var/crash/systemtap"))
  83 STRFUNC(cleanpath("/var/crash/systemtap"))
  84 STRFUNC(strchr("The SystemTap, The.", 't'))
  85 STRFUNC(strrchr("The SystemTap, The.", 't'))