003 File Manager
Current Path:
/usr/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid
usr
/
src
/
cddl
/
contrib
/
opensolaris
/
cmd
/
dtrace
/
test
/
tst
/
common
/
pid
/
📁
..
📄
err.D_PDESC_ZERO.badlib.d
(1.08 KB)
📄
err.D_PDESC_ZERO.badlib.exe
(963 B)
📄
err.D_PDESC_ZERO.badproc1.d
(1.08 KB)
📄
err.D_PROC_BADPID.badproc2.d
(1.06 KB)
📄
err.D_PROC_CREATEFAIL.many.d
(998 B)
📄
err.D_PROC_CREATEFAIL.many.exe
(954 B)
📄
err.D_PROC_FUNC.badfunc.d
(1.12 KB)
📄
err.D_PROC_FUNC.badfunc.exe
(963 B)
📄
err.D_PROC_LIB.libdash.d
(1.09 KB)
📄
err.D_PROC_LIB.libdash.exe
(963 B)
📄
err.D_PROC_NAME.alldash.d
(1.08 KB)
📄
err.D_PROC_NAME.alldash.exe
(963 B)
📄
err.D_PROC_NAME.badname.d
(1.09 KB)
📄
err.D_PROC_NAME.badname.exe
(963 B)
📄
err.D_PROC_NAME.globdash.d
(1.09 KB)
📄
err.D_PROC_NAME.globdash.exe
(963 B)
📄
err.D_PROC_OFF.toobig.d
(1.15 KB)
📄
err.D_PROC_OFF.toobig.exe
(963 B)
📄
tst.addprobes.ksh
(1.37 KB)
📄
tst.args1.c
(1.42 KB)
📄
tst.args1.d
(1.74 KB)
📄
tst.coverage.d
(1.2 KB)
📄
tst.coverage.exe
(986 B)
📄
tst.emptystack.d
(1.34 KB)
📄
tst.emptystack.d.out
(20 B)
📄
tst.emptystack.exe
(978 B)
📄
tst.float.c
(1.14 KB)
📄
tst.float.d
(1.21 KB)
📄
tst.fork.c
(1.28 KB)
📄
tst.fork.d
(1.58 KB)
📄
tst.gcc.c
(1.38 KB)
📄
tst.gcc.d
(1.23 KB)
📄
tst.killonerror.ksh
(1.12 KB)
📄
tst.main.ksh
(1.3 KB)
📄
tst.manypids.ksh
(1.5 KB)
📄
tst.newprobes.ksh
(1.36 KB)
📄
tst.newprobes.ksh.out
(70 B)
📄
tst.probemod.ksh
(1.39 KB)
📄
tst.provregex1.ksh
(1.64 KB)
📄
tst.provregex2.ksh
(2.23 KB)
📄
tst.provregex2.ksh.out
(38 B)
📄
tst.provregex3.ksh
(1.9 KB)
📄
tst.provregex3.ksh.out
(33 B)
📄
tst.provregex4.ksh
(2.72 KB)
📄
tst.provregex4.ksh.out
(38 B)
📄
tst.ret1.c
(1.33 KB)
📄
tst.ret1.d
(1.55 KB)
📄
tst.ret2.c
(1.28 KB)
📄
tst.ret2.d
(1.55 KB)
📄
tst.vfork.c
(1.31 KB)
📄
tst.vfork.d
(1.4 KB)
📄
tst.weak1.c
(1.3 KB)
📄
tst.weak1.d
(1.68 KB)
📄
tst.weak2.c
(1.3 KB)
📄
tst.weak2.d
(1.68 KB)
Editing: tst.provregex4.ksh
#!/bin/ksh -p # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" # # This test verifies that USDT probes will be picked up after a dlopen(3C) # when a regex in the provider name matches both USDT probes and pid probes # (e.g., p*d$target matches both pid$target and pyramid$target.) # if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>' exit 2 fi dtrace=$1 DIR=${TMPDIR:-/tmp}/dtest.$$ mkdir $DIR cd $DIR cat > Makefile <<EOF all: main altlib.so main: main.o provmain.o cc -o main main.o provmain.o main.o: main.c prov.h cc -c main.c prov.h: prov.d $dtrace -h -s prov.d provmain.o: prov.d main.o $dtrace -G -32 -o provmain.o -s prov.d main.o altlib.so: altlib.o provalt.o cc -shared -o altlib.so altlib.o provalt.o -lc altlib.o: altlib.c prov.h cc -c altlib.c provalt.o: prov.d altlib.o $dtrace -G -32 -o provalt.o -s prov.d altlib.o EOF cat > prov.d <<EOF provider pyramid { probe entry(); }; EOF cat > altlib.c <<EOF #include <sys/sdt.h> #include "prov.h" void go(void) { PYRAMID_ENTRY(); } EOF cat > main.c <<EOF #include <dlfcn.h> #include <unistd.h> #include <stdio.h> #include <sys/sdt.h> #include "prov.h" void go(void) { PYRAMID_ENTRY(); } int main(int argc, char **argv) { void *alt; void *alt_go; go(); if ((alt = dlopen("./altlib.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { printf("dlopen of altlib.so failed: %s\n", dlerror()); return (1); } if ((alt_go = dlsym(alt, "go")) == NULL) { printf("failed to lookup 'go' in altlib.so\n"); return (1); } ((void (*)(void))alt_go)(); return (0); } EOF make > /dev/null if [ $? -ne 0 ]; then print -u2 "failed to build" exit 1 fi cat > main.d <<'EOF' p*d$target::go:entry { @foo[probemod, probefunc, probename] = count(); } END { printa("%s:%s:%s %@u\n",@foo); } EOF script() { $dtrace -q -s ./main.d -c ./main } script status=$? cd /tmp /bin/rm -rf $DIR exit $status
Upload File
Create Folder