@@ -197,7 +197,7 @@ _MAKE+= MK_META_MODE=no | ||
_TARGET_ARCH= ${TARGET:S/pc98/ | ||
.elif !defined(TARGET) | ||
${TARGET_ARCH} != ${MACHINE_ARCH} | ||
-_TARGET= ${TARGET_ARCH:C/ | ||
+_TARGET= ${TARGET_ARCH:C/ | ||
.endif | ||
.if defined(TARGET) && !defined(_TARGET | ||
_TARGET=${TARGET | ||
@@ -374,7 +374,7 @@ worlds: | ||
.if make(universe) || make(universe_ke | ||
TARGETS?=amd64 arm arm64 i386 mips pc98 powerpc sparc64 | ||
_UNIVERSE_TARGET | ||
-TARGET_ARCHES_a | ||
+TARGET_ARCHES_a | ||
TARGET_ARCHES_ar | ||
TARGET_ARCHES_mi | ||
TARGET_ARCHES_po |
@@ -48,6 +48,7 @@ | ||
.error "Both TARGET and TARGET_ARCH must be defined." | ||
.endif | ||
+SRCDIR?= ${.CURDIR} | ||
LOCALBASE?= /usr/local | ||
# Cross toolchain changes must be in effect before bsd.compiler.mk | ||
@@ -56,8 +57,104 @@ LOCALBASE?= /usr/local | ||
.include "${LOCALBASE}/sh | ||
CROSSENV+=CROSS_ | ||
.endif | ||
-.include <bsd.compiler.mk | ||
-.include "share/mk/src.op | ||
+.if defined(CROSS_TO | ||
+CROSS_COMPILER_ | ||
+.endif | ||
+ | ||
+XCOMPILERS= CC CXX CPP | ||
+.for COMPILER in ${XCOMPILERS} | ||
+.if defined(CROSS_CO | ||
+X${COMPILER}?= ${CROSS_COMPILER | ||
+.else | ||
+X${COMPILER}?= ${${COMPILER}} | ||
+.endif | ||
+.endfor | ||
+# If a full path to an external cross compiler is given, don't build | ||
+# a cross compiler. | ||
+.if ${XCC:N${CCACHE_ | ||
+MK_CROSS_COMPIL | ||
+.endif | ||
+ | ||
+# Pull in COMPILER_TYPE and COMPILER_FREEBSD | ||
+.include <bsd.compiler.mk | ||
+.include "share/mk/src.op | ||
+ | ||
+# Check if there is a local compiler that can satisfy as an external compiler. | ||
+.if ${MK_SYSTEM_COMP | ||
+ (${MK_CLANG_BOOT | ||
+ !make(showconfig | ||
+# Which compiler is expected to be used? | ||
+.if ${MK_CLANG_BOOTS | ||
+_expected_compi | ||
+.elif ${MK_GCC_BOOTSTR | ||
+_expected_compi | ||
+.endif | ||
+# If the expected vs CC is different then we can't skip. | ||
+# GCC cannot be used for cross-arch yet. For clang we pass -target later if | ||
+# TARGET_ARCH!=MAC | ||
+.if ${_expected_comp | ||
+ (${COMPILER_TYPE | ||
+# It needs to be the same revision as we would build for the bootstrap. | ||
+.if !defined(CROSS_C | ||
+.if ${_expected_comp | ||
+CROSS_COMPILER_ | ||
+ awk '$$2 == "FREEBSD_CC_VERS | ||
+ ${SRCDIR}/lib/cl | ||
+CROSS_COMPILER_ | ||
+ awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ | ||
+ ${SRCDIR}/lib/cl | ||
+.elif ${_expected_comp | ||
+CROSS_COMPILER_ | ||
+ awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \ | ||
+ ${SRCDIR}/gnu/us | ||
+CROSS_COMPILER_ | ||
+ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \ | ||
+ ${SRCDIR}/contri | ||
+.endif | ||
+.export CROSS_COMPILER_F | ||
+.endif # !defined(CROSS_C | ||
+.if ${COMPILER_VERSI | ||
+ ${COMPILER_FREEB | ||
+# Everything matches, disable the bootstrap compiler. | ||
+MK_CLANG_BOOTST | ||
+MK_GCC_BOOTSTRA | ||
+CROSSENV+= COMPILER_VERSION | ||
+ COMPILER_TYPE=${ | ||
+ COMPILER_FREEBSD | ||
+.if make(buildworld) | ||
+.info SYSTEM_COMPILER: | ||
+.endif | ||
+.endif # ${COMPILER_VERSI | ||
+.endif # ${_expected_comp | ||
+.endif # ${XCC:N${CCACHE_ | ||
+ | ||
+# Handle external binutils. | ||
+.if defined(CROSS_TO | ||
+CROSS_BINUTILS_ | ||
+.endif | ||
+# If we do not have a bootstrap binutils (because the in-tree one does not | ||
+# support the target architecture), provide a default cross-binutils prefix. | ||
+# This allows aarch64 builds, for example, to automatically use the | ||
+# aarch64-binutils | ||
+.if !make(showconfig | ||
+.if !empty(BROKEN_OP | ||
+ !defined(CROSS_B | ||
+CROSS_BINUTILS_ | ||
+.if !exists(${CROSS_ | ||
+.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-b | ||
+.endif | ||
+.endif | ||
+.endif | ||
+XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS | ||
+.for BINUTIL in ${XBINUTILS} | ||
+.if defined(CROSS_BI | ||
+ exists(${CROSS_B | ||
+X${BINUTIL}?= ${CROSS_BINUTILS | ||
+.else | ||
+X${BINUTIL}?= ${${BINUTIL}} | ||
+.endif | ||
+.endfor | ||
+ | ||
# We must do lib/ and libexec/ before bin/ in case of a mid-install error to | ||
# keep the users system reasonably usable. For static->dynamic root upgrades, | ||
@@ -67,7 +164,6 @@ CROSSENV+=CROSS_ | ||
# This ordering is not a guarantee though. The only guarantee of a working | ||
# system here would require fine-grained ordering of all components based | ||
# on their dependencies. | ||
-SRCDIR?= ${.CURDIR} | ||
.if !empty(SUBDIR_OV | ||
SUBDIR= ${SUBDIR_OVERRID | ||
.else | ||
@@ -204,7 +300,7 @@ VERSION= FreeBSD ${_REVISION}-${_ | ||
.endif | ||
.if !defined(PKG_VER | ||
-.if ${_BRANCH:MSTABL | ||
+.if ${_BRANCH:MSTABL | ||
TIMENOW= %Y%m%d%H%M%S | ||
EXTRA_REVISION= .s${TIMENOW:gmti | ||
.endif | ||
@@ -219,14 +315,13 @@ KNOWN_ARCHES?= aarch64/arm64 \ | ||
arm \ | ||
armeb/arm \ | ||
armv6/arm \ | ||
- armv6hf/arm \ | ||
i386 \ | ||
i386/pc98 \ | ||
mips \ | ||
mipsel/mips \ | ||
mips64el/mips \ | ||
- mips64/mips \ | ||
mipsn32el/mips \ | ||
+ mips64/mips \ | ||
mipsn32/mips \ | ||
powerpc \ | ||
powerpc64/powerp | ||
@@ -405,43 +500,7 @@ HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LO | ||
HMAKE+= PATH=${TMPPATH} METALOG=${METALO | ||
.endif | ||
-.if defined(CROSS_TO | ||
-CROSS_COMPILER_ | ||
-CROSS_BINUTILS_ | ||
-.endif | ||
- | ||
-# If we do not have a bootstrap binutils (because the in-tree one does not | ||
-# support the target architecture), provide a default cross-binutils prefix. | ||
-# This allows aarch64 builds, for example, to automatically use the | ||
-# aarch64-binutils | ||
-.if !make(showconfig | ||
-.if !empty(BROKEN_OP | ||
- !defined(CROSS_B | ||
-CROSS_BINUTILS_ | ||
-.if !exists(${CROSS_ | ||
-.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-b | ||
-.endif | ||
-.endif | ||
-.endif | ||
- | ||
-XCOMPILERS= CC CXX CPP | ||
-.for COMPILER in ${XCOMPILERS} | ||
-.if defined(CROSS_CO | ||
-X${COMPILER}?= ${CROSS_COMPILER | ||
-.else | ||
-X${COMPILER}?= ${${COMPILER}} | ||
-.endif | ||
-.endfor | ||
-XBINUTILS= AS AR LD NM OBJCOPY OBJDUMP RANLIB SIZE STRINGS | ||
-.for BINUTIL in ${XBINUTILS} | ||
-.if defined(CROSS_BI | ||
- exists(${CROSS_B | ||
-X${BINUTIL}?= ${CROSS_BINUTILS | ||
-.else | ||
-X${BINUTIL}?= ${${BINUTIL}} | ||
-.endif | ||
-.endfor | ||
-CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ | ||
+CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCXXFLAGS} ${XCFLAGS}" \ | ||
CPP="${XCPP} ${XCFLAGS}" \ | ||
AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ | ||
OBJDUMP=${XOBJDU | ||
@@ -456,31 +515,25 @@ BFLAGS+= -B${CROSS_BINUTI | ||
.endif | ||
# External compiler needs sysroot and target flags. | ||
-.if ${XCC:N${CCACHE_ | ||
+.if ${MK_CROSS_COMPI | ||
+ (${MK_CLANG_BOOT | ||
.if !defined(CROSS_B | ||
BFLAGS+= -B${WORLDTMP}/us | ||
.endif | ||
.if ${TARGET} == "arm" | ||
-.if ${TARGET_ARCH:M* | ||
+.if ${TARGET_ARCH:Ma | ||
TARGET_ABI= gnueabihf | ||
.else | ||
TARGET_ABI= gnueabi | ||
.endif | ||
.endif | ||
-.if defined(X_COMPIL | ||
-# GCC requires -isystem and -L when using a cross-compiler. | ||
-XCFLAGS+= -isystem ${WORLDTMP}/usr/ | ||
-# Force using libc++ for external GCC. | ||
-XCXXFLAGS+= -isystem ${WORLDTMP}/usr/ | ||
- -nostdinc++ -L${WORLDTMP}/.. | ||
-.else | ||
+.if defined(X_COMPIL | ||
TARGET_ABI?= unknown | ||
TARGET_TRIPLE?= ${TARGET_ARCH:C/ | ||
XCFLAGS+= -target ${TARGET_TRIPLE} | ||
.endif | ||
XCFLAGS+= --sysroot=${WORL | ||
-.else | ||
-.endif # ${XCC:M/*} || ${MK_CROSS_COMPI | ||
+.endif # ${MK_CROSS_COMPI | ||
.if !empty(BFLAGS) | ||
XCFLAGS+= ${BFLAGS} | ||
@@ -918,7 +971,7 @@ distributeworld installworld stageworld: _installcheck_wo | ||
.for dist in base ${EXTRA_DISTRIBU | ||
@# For each file that exists in this dist, print the corresponding | ||
@# line from the METALOG. This relies on the fact that | ||
- @# a line containing only the filename will sort immediatly before | ||
+ @# a line containing only the filename will sort immediately before | ||
@# the relevant mtree line. | ||
cd ${DESTDIR}/${DIS | ||
find ./${dist} | sort -u ${METALOG} - | \ | ||
@@ -928,7 +981,7 @@ distributeworld installworld stageworld: _installcheck_wo | ||
.for dist in ${DEBUG_DISTRIBU | ||
@# For each file that exists in this dist, print the corresponding | ||
@# line from the METALOG. This relies on the fact that | ||
- @# a line containing only the filename will sort immediatly before | ||
+ @# a line containing only the filename will sort immediately before | ||
@# the relevant mtree line. | ||
cd ${DESTDIR}/${DIS | ||
find ./${dist}/usr/li | ||
@@ -971,34 +1024,26 @@ packageworld: .PHONY | ||
# and do a 'make reinstall' on the *client* to install new binaries from the | ||
# most recent server build. | ||
# | ||
-reinstall: .MAKE .PHONY | ||
+restage reinstall: .MAKE .PHONY | ||
@echo "--------------- | ||
@echo ">>> Making hierarchy" | ||
@echo "--------------- | ||
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ | ||
LOCAL_MTREE=${LO | ||
- @echo | ||
- @echo "--------------- | ||
- @echo ">>> Installing everything" | ||
- @echo "--------------- | ||
- ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install | ||
-.if defined(LIBCOMPA | ||
- ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcomp | ||
-.endif | ||
- | ||
-restage: .MAKE .PHONY | ||
+.if make(restage) | ||
@echo "--------------- | ||
- @echo ">>> Making hierarchy" | ||
+ @echo ">>> Making distribution" | ||
@echo "--------------- | ||
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ | ||
- LOCAL_MTREE=${LO | ||
+ LOCAL_MTREE=${LO | ||
+.endif | ||
@echo | ||
@echo "--------------- | ||
@echo ">>> Installing everything" | ||
@echo "--------------- | ||
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install | ||
-.if defined(LIB32TMP | ||
- ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 | ||
+.if defined(LIBCOMPA | ||
+ ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcomp | ||
.endif | ||
redistribute: .MAKE .PHONY | ||
@@ -1044,7 +1089,7 @@ KERNCONF=${KERNF | ||
.endif | ||
.endif | ||
.if ${TARGET_ARCH} == "powerpc64" | ||
-KERNCONF?= GENERIC64 | ||
+KERNCONF?= HARDENEDBSD64 | ||
.else | ||
KERNCONF?= HARDENEDBSD | ||
.endif | ||
@@ -1128,6 +1173,8 @@ buildkernel: .MAKE .PHONY | ||
@echo "--------------- | ||
.endfor | ||
+NO_INSTALLEXTRA | ||
+ | ||
# | ||
# installkernel, etc. | ||
# | ||
@@ -1147,7 +1194,7 @@ reinstallkernel reinstallkernel. | ||
${CROSSENV} PATH=${TMPPATH} \ | ||
${MAKE} ${IMAKE_INSTALL} | ||
.endif | ||
-.if ${BUILDKERNELS:[ | ||
+.if ${BUILDKERNELS:[ | ||
.for _kernel in ${BUILDKERNELS:[ | ||
@echo "--------------- | ||
@echo ">>> Installing kernel ${_kernel}" | ||
@@ -1178,7 +1225,7 @@ distributekernel | ||
${DESTDIR}/${DIS | ||
.endif | ||
.endif | ||
-.if ${BUILDKERNELS:[ | ||
+.if ${BUILDKERNELS:[ | ||
.for _kernel in ${BUILDKERNELS:[ | ||
.if defined(NO_ROOT) | ||
@echo "#${MTREE_MAGIC} | ||
@@ -1209,7 +1256,7 @@ packagekernel: .PHONY | ||
tar cvf - --include '*/*/*.debug' \ | ||
@${DESTDIR}/${DI | ||
${XZ_CMD} > ${DESTDIR}/${DIS | ||
-.if ${BUILDKERNELS:[ | ||
+.if ${BUILDKERNELS:[ | ||
.for _kernel in ${BUILDKERNELS:[ | ||
cd ${DESTDIR}/${DIS | ||
tar cvf - --exclude '*.debug' \ | ||
@@ -1230,7 +1277,7 @@ packagekernel: .PHONY | ||
cd ${DESTDIR}/${DIS | ||
tar cvf - --include '*/*/*.debug' $$(eval find .) | \ | ||
${XZ_CMD} > ${DESTDIR}/${DIS | ||
-.if ${BUILDKERNELS:[ | ||
+.if ${BUILDKERNELS:[ | ||
.for _kernel in ${BUILDKERNELS:[ | ||
cd ${DESTDIR}/${DIS | ||
tar cvf - --exclude '*.debug' . | \ | ||
@@ -1340,7 +1387,7 @@ create-kernel-pa | ||
-o ${REPODIR}/$$(pk | ||
.endfor | ||
.endif | ||
-.if ${BUILDKERNELS:[ | ||
+.if ${BUILDKERNELS:[ | ||
.for _kernel in ${BUILDKERNELS:[ | ||
.if exists(${KSTAGED | ||
.for flavor in "" -debug | ||
@@ -1516,9 +1563,15 @@ _dd= bin/dd | ||
# r277259 crunchide: Correct 64-bit section header offset | ||
# r281674 crunchide: always include both 32- and 64-bit ELF support | ||
-# r285986 crunchen: use STRIPBIN rather than STRIP | ||
.if ${BOOTSTRAPPING} | ||
-_crunch= usr.sbin/crunch | ||
+_crunchide= usr.sbin/crunch/ | ||
+.endif | ||
+ | ||
+# r285986 crunchen: use STRIPBIN rather than STRIP | ||
+# 1100113: Support MK_AUTO_OBJ | ||
+.if ${BOOTSTRAPPING} | ||
+ (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} | ||
+_crunchgen= usr.sbin/crunch/ | ||
.endif | ||
.if ${BOOTSTRAPPING} | ||
@@ -1607,7 +1660,8 @@ bootstrap-tools: | ||
usr.bin/xinstall | ||
${_gensnmptree} \ | ||
usr.sbin/config \ | ||
- ${_crunch} \ | ||
+ ${_crunchide} \ | ||
+ ${_crunchgen} \ | ||
${_nmtree} \ | ||
${_vtfontcvt} \ | ||
usr.bin/localede | ||
@@ -1717,9 +1771,7 @@ _elftctools= lib/libelftc \ | ||
usr.bin/elfcopy | ||
.endif | ||
-# If an full path to an external cross compiler is given, don't build | ||
-# a cross compiler. | ||
-.if ${XCC:N${CCACHE_ | ||
+.if ${MK_CROSS_COMPI | ||
.if ${MK_CLANG_BOOTS | ||
_clang= usr.bin/clang | ||
_clang_libs= lib/clang | ||
@@ -1741,7 +1793,6 @@ cross-tools: .MAKE .PHONY | ||
${_dtrace_tools} | ||
${_cc} \ | ||
${_btxld} \ | ||
- ${_crunchide} \ | ||
${_usb_tools} | ||
${_+_}@${ECHODIR | ||
cd ${.CURDIR}/${_to |
@@ -72,14 +72,6 @@ LIBCOMPATCFLAGS+ | ||
# -B is needed to find /usr/lib32/crti. | ||
# Clang/GCC. | ||
LIBCOMPATCFLAGS+ | ||
-# GCC requires -isystem when using a cross-compiler. | ||
-LIBCOMPATCFLAGS | ||
- | ||
-.if defined(X_COMPIL | ||
-# Force using libc++ for external GCC. | ||
-LIBCOMPATCXXFLA | ||
- -nostdinc++ -L${LIBCOMPAT_OB | ||
-.endif | ||
# Yes, the flags are redundant. | ||
LIBCOMPATWMAKEEN |
@@ -22,7 +22,7 @@ | ||
# grep '+=' /usr/src/tools/b | ||
# sort | uniq -d | ||
# | ||
-# To find regular duplicates not dependant on optional components, you can | ||
+# To find regular duplicates not dependent on optional components, you can | ||
# also use something that will not give you false positives, e.g.: | ||
# for t in `make -V TARGETS universe`; do | ||
# __MAKE_CONF=/dev | ||
@@ -38,6 +38,20 @@ | ||
# xargs -n1 | sort | uniq -d; | ||
# done | ||
+# 20160519: remove DTrace Toolkit from base | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+OLD_FILES+=usr/ | ||
+OLD_DIRS+=usr/s | ||
+# 20160519: stale MLINK removed | ||
+OLD_FILES+=usr/ | ||
+# 20160517: ReiserFS removed | ||
+OLD_FILES+=usr/ | ||
+# 20160430: kvm_getfiles(3) removed from kvm(3) | ||
+OLD_LIBS+=usr/l | ||
+OLD_FILES+=usr/ | ||
# 20160423: remove mroute6d | ||
OLD_FILES+=etc/r | ||
# 20160419: rename units.lib -> definitions.unit | ||
@@ -3776,7 +3790,7 @@ OLD_FILES+=usr/i | ||
OLD_FILES+=usr/s | ||
# 20071108: Removed very crunch OLDCARD support file | ||
OLD_FILES+=etc/d | ||
-# 20071025: rc.d/nfslocking superceeded by rc.d/lockd and rc.d/statd | ||
+# 20071025: rc.d/nfslocking superseded by rc.d/lockd and rc.d/statd | ||
OLD_FILES+=etc/r | ||
# 20070930: rename of cached to nscd | ||
OLD_FILES+=etc/c |
@@ -45,8 +45,6 @@ crypto Cryptography stuff (see crypto/README). | ||
etc Template files for /etc. | ||
-games Amusements. | ||
- | ||
gnu Various commands and libraries under the GNU Public License. | ||
Please see gnu/COPYING* for more information. | ||
@@ -31,6 +31,48 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: | ||
disable the most expensive debugging functionality run | ||
"ln -s 'abort:false,jun | ||
+20160527: | ||
+ CAM will now strip leading spaces from SCSI disks' serial numbers. | ||
+ This will effect users who create UFS filesystems on SCSI disks using | ||
+ those disk's diskid device nodes. For example, if /etc/fstab | ||
+ previously contained a line like | ||
+ "/dev/diskid/DIS | ||
+ change it to "/dev/diskid/DIS | ||
+ transforms like gmirror may also be affected. ZFS users should | ||
+ generally be fine. | ||
+ | ||
+20160523: | ||
+ The bitstring(3) API has been updated with new functionality and | ||
+ improved performance. But it is binary-incompati | ||
+ Objects built with the new headers may not be linked against objects | ||
+ built with the old headers. | ||
+ | ||
+20160520: | ||
+ The brk and sbrk functions have been removed from libc on arm64. | ||
+ Binutils from ports has been updated to not link to these | ||
+ functions and should be updated to the latest version before | ||
+ installing a new libc. | ||
+ | ||
+20160517: | ||
+ The armv6 port now defaults to hard float ABI. Limited support | ||
+ for running both hardfloat and soft float on the same system | ||
+ is available using the libraries installed with -DWITH_LIBSOFT. | ||
+ This has only been tested as an upgrade path for installworld | ||
+ and packages may fail or need manual intervention to run. New | ||
+ packages will be needed. | ||
+ | ||
+ To update an existing self-hosted armv6hf system, you must add | ||
+ TARGET_ARCH=armv | ||
+ and the install steps. | ||
+ | ||
+20160510: | ||
+ Kernel modules compiled outside of a kernel build now default to | ||
+ installing to /boot/modules instead of /boot/kernel. Many kernel | ||
+ modules built this way (such as those in ports) already overrode | ||
+ KMODDIR explicitly to install into /boot/modules. However, | ||
+ manually building and installing a module from /sys/modules will | ||
+ now install to /boot/modules instead of /boot/kernel. | ||
+ | ||
20160414: | ||
The CAM I/O scheduler has been committed to the kernel. There should be | ||
no user visible impact. This does enable NCQ Trim on ada SSDs. While the | ||
@@ -905,7 +947,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: | ||
WITH_ICONV has been split into two feature sets. WITH_ICONV now | ||
enables just the iconv* functionality and is now on by default. | ||
WITH_LIBICONV_CO | ||
- compatability. Set WITHOUT_ICONV to build the old way. | ||
+ compatibility. Set WITHOUT_ICONV to build the old way. | ||
If you have been using WITH_ICONV before, you will very likely | ||
need to turn on WITH_LIBICONV_CO | ||
@@ -14,6 +14,15 @@ __HardenedBSD_ve | ||
When PIE is enabled, compile non-static libraries with -fPIC. | ||
Default WITH_SHARED_TOOL | ||
+ If you encounter build problems during make buildworld, | ||
+ try to clean the object files directory, which is typically | ||
+ /usr/obj: | ||
+ | ||
+ cd /usr/obj; rm -rf * | ||
+ | ||
+ And retry to build the world. This will require due to not | ||
+ proper cleaning mechanizm of FreeBSD's build framework. | ||
+ | ||
[201603XX] noexec and ASLR changes | ||
__HardenedBSD_ve |
@@ -1,15 +1,11 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
NETBSD_ATF_TESTS | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= d_align.in | ||
-FILES+= d_align.out | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <netbsd-tests.te | ||
@@ -118,7 +118,7 @@ gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_ME | ||
tc.defs.c: gethost ${TCSHDIR}/host. | ||
@rm -f ${.TARGET} | ||
@echo "/* Do not edit this file, make creates it */" > ${.TARGET} | ||
- ./gethost ${TCSHDIR}/host. | ||
+ ${BTOOLSPATH:U.} | ||
ed.defns.h: ed.defns.c | ||
@rm -f ${.TARGET} |
@@ -99,7 +99,7 @@ | ||
#define HAVE_PATHS_H 1 | ||
/* Define to 1 if you have the `sbrk' function. */ | ||
-#define HAVE_SBRK 1 | ||
+/* #undef HAVE_SBRK 1 */ | ||
/* Define to 1 if you have the `setpgid' function. */ | ||
#define HAVE_SETPGID 1 |
@@ -1,11 +1,5 @@ | ||
# $FreeBSD$ | ||
-.include <bsd.own.mk> | ||
- | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
ATF_TESTS_SH= format_string_te | ||
.include <bsd.test.mk> |
@@ -1,9 +1,5 @@ | ||
# $FreeBSD$ | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
NETBSD_ATF_TESTS | ||
.include <netbsd-tests.te |
@@ -90,16 +90,13 @@ void | ||
init_des_cipher( | ||
{ | ||
#ifdef DES | ||
- int i; | ||
- | ||
des_ct = des_n = 0; | ||
/* initialize the initialization vector */ | ||
MEMZERO(ivec, 8); | ||
/* initialize the padding vector */ | ||
- for (i = 0; i < 8; i++) | ||
- pvec[i] = (char) (arc4random() % 256); | ||
+ arc4random_buf(p | ||
#endif | ||
} | ||
@@ -164,7 +161,7 @@ get_keyword(void | ||
/* | ||
* get the key | ||
*/ | ||
- if (*(p = getpass("Enter key: "))) { | ||
+ if ((p = getpass("Enter key: ")) != NULL && *p != '\0') { | ||
/* | ||
* copy it, nul-padded, into the key area | ||
@@ -257,7 +254,7 @@ expand_des_key(c | ||
/* | ||
* now translate it, bombing on any illegal binary digit | ||
*/ | ||
- for (i = 0; kbuf[i] && i < 16; i++) | ||
+ for (i = 0; i < 16 && kbuf[i]; i++) | ||
if ((nbuf[i] = hex_to_binary((i | ||
des_error("bad binary digit in key"); | ||
while (i < 64) |
@@ -36,20 +36,24 @@ read_file(char *fn, long n) | ||
{ | ||
FILE *fp; | ||
long size; | ||
- | ||
+ int cs; | ||
fp = (*fn == '!') ? popen(fn + 1, "r") : fopen(strip_esca | ||
if (fp == NULL) { | ||
fprintf(stderr, "%s: %s\n", fn, strerror(errno)) | ||
errmsg = "cannot open input file"; | ||
return ERR; | ||
- } else if ((size = read_stream(fp, n)) < 0) | ||
- return ERR; | ||
- else if (((*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { | ||
+ } | ||
+ if ((size = read_stream(fp, n)) < 0) { | ||
+ fprintf(stderr, "%s: %s\n", fn, strerror(errno)) | ||
+ errmsg = "error reading input file"; | ||
+ } | ||
+ if ((cs = (*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { | ||
fprintf(stderr, "%s: %s\n", fn, strerror(errno)) | ||
errmsg = "cannot close input file"; | ||
- return ERR; | ||
} | ||
+ if (size < 0 || cs < 0) | ||
+ return ERR; | ||
if (!scripted) | ||
fprintf(stdout, "%lu\n", size); | ||
return current_addr - n; | ||
@@ -143,19 +147,24 @@ write_file(char *fn, const char *mode, long n, long m) | ||
{ | ||
FILE *fp; | ||
long size; | ||
+ int cs; | ||
fp = (*fn == '!') ? popen(fn+1, "w") : fopen(strip_esca | ||
if (fp == NULL) { | ||
fprintf(stderr, "%s: %s\n", fn, strerror(errno)) | ||
errmsg = "cannot open output file"; | ||
return ERR; | ||
- } else if ((size = write_stream(fp, | ||
- return ERR; | ||
- else if (((*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { | ||
+ } | ||
+ if ((size = write_stream(fp, | ||
+ fprintf(stderr, "%s: %s\n", fn, strerror(errno)) | ||
+ errmsg = "error writing output file"; | ||
+ } | ||
+ if ((cs = (*fn == '!') ? pclose(fp) : fclose(fp)) < 0) { | ||
fprintf(stderr, "%s: %s\n", fn, strerror(errno)) | ||
errmsg = "cannot close output file"; | ||
- return ERR; | ||
} | ||
+ if (size < 0 || cs < 0) | ||
+ return ERR; | ||
if (!scripted) | ||
fprintf(stdout, "%lu\n", size); | ||
return n ? m - n + 1 : 0; |
@@ -1,9 +1,5 @@ | ||
# $FreeBSD$ | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
NETBSD_ATF_TESTS | ||
ATF_TESTS_SH_SED |
@@ -1,9 +1,5 @@ | ||
# $FreeBSD$ | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
ATF_TESTS_SH+= ls_tests | ||
# This seems like overkill, but the idea in mind is that all of the testcases | ||
# should be runnable as !root |
@@ -286,6 +286,7 @@ fastcopy(const char *from, const char *to, struct stat *sbp) | ||
} | ||
if (bp == NULL && (bp = malloc((size_t)b | ||
warnx("malloc(%u | ||
+ (void)close(from | ||
return (1); | ||
} | ||
while ((to_fd = |
@@ -2,10 +2,6 @@ | ||
.include <bsd.own.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
TAP_TESTS_SH= legacy_test | ||
.include <bsd.test.mk> |
@@ -68,7 +68,7 @@ static int no_op(void); | ||
static void printflg(unsigne | ||
static int c_frmt(const void *, const void *); | ||
static off_t str_offt(char *); | ||
-static char *getline(FILE *fp); | ||
+static char *get_line(FILE *fp); | ||
static void pax_options(int, | ||
static void pax_usage(void); | ||
static void tar_options(int, | ||
@@ -76,10 +76,10 @@ static void tar_usage(void); | ||
static void cpio_options(int | ||
static void cpio_usage(void) | ||
-/* errors from getline */ | ||
+/* errors from get_line */ | ||
#define GETLINE_FILE_COR | ||
#define GETLINE_OUT_OF_M | ||
-static int getline_error; | ||
+static int get_line_error; | ||
char *chdname; | ||
@@ -873,14 +873,14 @@ tar_options(int argc, char **argv) | ||
paxwarn(1, "Unable to open file '%s' for read", file); | ||
tar_usage(); | ||
} | ||
- while ((str = getline(fp)) != NULL) { | ||
+ while ((str = get_line(fp)) != NULL) { | ||
if (pat_add(str, dir) < 0) | ||
tar_usage(); | ||
sawpat = 1; | ||
} | ||
if (strcmp(file, "-") != 0) | ||
fclose(fp); | ||
- if (getline_error) { | ||
+ if (get_line_error) | ||
paxwarn(1, "Problem with file '%s'", file); | ||
tar_usage(); | ||
} | ||
@@ -946,13 +946,13 @@ tar_options(int argc, char **argv) | ||
paxwarn(1, "Unable to open file '%s' for read", file); | ||
tar_usage(); | ||
} | ||
- while ((str = getline(fp)) != NULL) { | ||
+ while ((str = get_line(fp)) != NULL) { | ||
if (ftree_add(str, 0) < 0) | ||
tar_usage(); | ||
} | ||
if (strcmp(file, "-") != 0) | ||
fclose(fp); | ||
- if (getline_error) { | ||
+ if (get_line_error) | ||
paxwarn(1, "Problem with file '%s'", | ||
file); | ||
tar_usage(); | ||
@@ -1159,11 +1159,11 @@ cpio_options(int | ||
paxwarn(1, "Unable to open file '%s' for read", optarg); | ||
cpio_usage(); | ||
} | ||
- while ((str = getline(fp)) != NULL) { | ||
+ while ((str = get_line(fp)) != NULL) { | ||
pat_add(str, NULL); | ||
} | ||
fclose(fp); | ||
- if (getline_error) { | ||
+ if (get_line_error) | ||
paxwarn(1, "Problem with file '%s'", optarg); | ||
cpio_usage(); | ||
} | ||
@@ -1258,10 +1258,10 @@ cpio_options(int | ||
* no read errors allowed on updates/append operation! | ||
*/ | ||
maxflt = 0; | ||
- while ((str = getline(stdin)) != NULL) { | ||
+ while ((str = get_line(stdin)) | ||
ftree_add(str, 0); | ||
} | ||
- if (getline_error) { | ||
+ if (get_line_error) | ||
paxwarn(1, "Problem while reading stdin"); | ||
cpio_usage(); | ||
} | ||
@@ -1489,21 +1489,21 @@ str_offt(char *val) | ||
} | ||
char * | ||
-getline(FILE *f) | ||
+get_line(FILE *f) | ||
{ | ||
char *name, *temp; | ||
size_t len; | ||
name = fgetln(f, &len); | ||
if (!name) { | ||
- getline_error = ferror(f) ? GETLINE_FILE_COR | ||
+ get_line_error = ferror(f) ? GETLINE_FILE_COR | ||
return(0); | ||
} | ||
if (name[len-1] != '\n') | ||
len++; | ||
temp = malloc(len); | ||
if (!temp) { | ||
- getline_error = GETLINE_OUT_OF_M | ||
+ get_line_error = GETLINE_OUT_OF_M | ||
return(0); | ||
} | ||
memcpy(temp, name, len-1); |
@@ -2,10 +2,6 @@ | ||
.include <bsd.own.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
TAP_TESTS_PERL= legacy_test | ||
.include <bsd.test.mk> |
@@ -2,10 +2,6 @@ | ||
.include <bsd.own.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
TAP_TESTS_SH= pgrep-F_test | ||
TAP_TESTS_SH+= pgrep-LF_test | ||
TAP_TESTS_SH+= pgrep-P_test |
@@ -1235,6 +1235,7 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki, | ||
static void | ||
saveuser(KINFO *ki) | ||
{ | ||
+ char *argsp; | ||
if (ki->ki_p->ki_fl | ||
/* | ||
@@ -1253,10 +1254,12 @@ saveuser(KINFO *ki) | ||
if (ki->ki_p->ki_st | ||
ki->ki_args = strdup("<defunct | ||
else if (UREADOK(ki) || (ki->ki_p->ki_ar | ||
- ki->ki_args = strdup(fmt(kvm_g | ||
- ki->ki_p->ki_com | ||
- else | ||
- asprintf(&ki->ki | ||
+ ki->ki_args = fmt(kvm_getargv, | ||
+ ki->ki_p->ki_com | ||
+ else { | ||
+ asprintf(&argsp, | ||
+ ki->ki_args = argsp; | ||
+ } | ||
if (ki->ki_args == NULL) | ||
xo_errx(1, "malloc failed"); | ||
} else { | ||
@@ -1264,8 +1267,8 @@ saveuser(KINFO *ki) | ||
} | ||
if (needenv) { | ||
if (UREADOK(ki)) | ||
- ki->ki_env = strdup(fmt(kvm_g | ||
- (char *)NULL, (char *)NULL, 0)); | ||
+ ki->ki_env = fmt(kvm_getenvv, | ||
+ (char *)NULL, (char *)NULL, 0); | ||
else | ||
ki->ki_env = strdup("()"); | ||
if (ki->ki_env == NULL) |
@@ -42,8 +42,8 @@ typedef struct kinfo_str { | ||
typedef struct kinfo { | ||
struct kinfo_proc *ki_p; /* kinfo_proc structure */ | ||
- char *ki_args; /* exec args */ | ||
- char *ki_env; /* environment */ | ||
+ const char *ki_args; /* exec args */ | ||
+ const char *ki_env; /* environment */ | ||
int ki_valid; /* 1 => uarea stuff valid */ | ||
double ki_pcpu; /* calculated in main() */ | ||
segsz_t ki_memsize; /* calculated in main() */ |
@@ -43,7 +43,7 @@ acl_t | ||
get_acl_from_fil | ||
{ | ||
FILE *file; | ||
- char buf[BUFSIZ]; | ||
+ char buf[BUFSIZ+1]; | ||
if (filename == NULL) | ||
err(1, "(null) filename in get_acl_from_fil | ||
@@ -61,7 +61,7 @@ get_acl_from_fil | ||
err(1, "fopen() %s failed", filename); | ||
} | ||
- fread(buf, sizeof(buf), (size_t)1, file); | ||
+ fread(buf, sizeof(buf) - 1, (size_t)1, file); | ||
if (ferror(file) != 0) { | ||
fclose(file); | ||
err(1, "error reading from %s", filename); |
@@ -52,11 +52,11 @@ mksyntax: mksyntax.o ${BUILD_TOOLS_ME | ||
.ORDER: nodes.c nodes.h | ||
nodes.c nodes.h: mknodes nodetypes nodes.c.pat | ||
- ./mknodes ${.CURDIR}/nodet | ||
+ ${BTOOLSPATH:U.} | ||
.ORDER: syntax.c syntax.h | ||
syntax.c syntax.h: mksyntax | ||
- ./mksyntax | ||
+ ${BTOOLSPATH:U.} | ||
token.h: mktokens | ||
sh ${.CURDIR}/mktok |
@@ -1998,7 +1998,7 @@ getprompt(void *unused __unused) | ||
/* | ||
* Format prompt string. | ||
*/ | ||
- for (i = 0; (i < 127) && (*fmt != '\0'); i++, fmt++) | ||
+ for (i = 0; (i < PROMPTLEN - 1) && (*fmt != '\0'); i++, fmt++) | ||
if (*fmt == '\\') | ||
switch (*++fmt) { | ||
@@ -2011,11 +2011,13 @@ getprompt(void *unused __unused) | ||
case 'h': | ||
case 'H': | ||
ps[i] = '\0'; | ||
- gethostname(&ps[ | ||
+ gethostname(&ps[ | ||
+ ps[PROMPTLEN - 1] = '\0'; | ||
/* Skip to end of hostname. */ | ||
trim = (*fmt == 'h') ? '.' : '\0'; | ||
- while ((ps[i+1] != '\0') && (ps[i+1] != trim)) | ||
+ while ((ps[i] != '\0') && (ps[i] != trim)) | ||
i++; | ||
+ --i; | ||
break; | ||
/* | ||
@@ -2027,7 +2029,7 @@ getprompt(void *unused __unused) | ||
case 'W': | ||
case 'w': | ||
pwd = lookupvar("PWD") | ||
- if (pwd == NULL) | ||
+ if (pwd == NULL || *pwd == '\0') | ||
pwd = "?"; | ||
if (*fmt == 'W' && | ||
*pwd == '/' && pwd[1] != '\0') | ||
@@ -2060,8 +2062,9 @@ getprompt(void *unused __unused) | ||
* Emit unrecognized formats verbatim. | ||
*/ | ||
default: | ||
- ps[i++] = '\\'; | ||
- ps[i] = *fmt; | ||
+ ps[i] = '\\'; | ||
+ if (i < PROMPTLEN - 1) | ||
+ ps[++i] = *fmt; | ||
break; | ||
} | ||
else |
@@ -32,7 +32,7 @@ | ||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 | ||
.\" $FreeBSD$ | ||
.\" | ||
-.Dd January 30, 2016 | ||
+.Dd May 24, 2016 | ||
.Dt SH 1 | ||
.Os | ||
.Sh NAME | ||
@@ -1403,9 +1403,9 @@ may include any of the following formatting sequences, | ||
which are replaced by the given information: | ||
.Bl -tag -width indent | ||
.It Li \eH | ||
-The local hostname. | ||
-.It Li \eh | ||
The fully-qualified hostname. | ||
+.It Li \eh | ||
+The local hostname. | ||
.It Li \eW | ||
The final component of the current working directory. | ||
.It Li \ew |
@@ -2,10 +2,6 @@ | ||
.include <bsd.own.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
TESTS_SUBDIRS+= builtins | ||
TESTS_SUBDIRS+= errors | ||
TESTS_SUBDIRS+= execution |
@@ -1,181 +1,178 @@ | ||
# $FreeBSD$ | ||
+PACKAGE= tests | ||
+ | ||
.include <src.opts.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= alias.0 alias.0.stdout | ||
-FILES+= alias.1 alias.1.stderr | ||
-FILES+= alias3.0 alias3.0.stdout | ||
-FILES+= alias4.0 | ||
-FILES+= break1.0 | ||
-FILES+= break2.0 break2.0.stdout | ||
-FILES+= break3.0 | ||
-FILES+= break4.4 | ||
-FILES+= break5.4 | ||
-FILES+= break6.0 | ||
-FILES+= builtin1.0 | ||
-FILES+= case1.0 | ||
-FILES+= case2.0 | ||
-FILES+= case3.0 | ||
-FILES+= case4.0 | ||
-FILES+= case5.0 | ||
-FILES+= case6.0 | ||
-FILES+= case7.0 | ||
-FILES+= case8.0 | ||
-FILES+= case9.0 | ||
-FILES+= case10.0 | ||
-FILES+= case11.0 | ||
-FILES+= case12.0 | ||
-FILES+= case13.0 | ||
-FILES+= case14.0 | ||
-FILES+= case15.0 | ||
-FILES+= case16.0 | ||
-FILES+= case17.0 | ||
-FILES+= case18.0 | ||
-FILES+= case19.0 | ||
-FILES+= case20.0 | ||
-FILES+= cd1.0 | ||
-FILES+= cd2.0 | ||
-FILES+= cd3.0 | ||
-FILES+= cd4.0 | ||
-FILES+= cd5.0 | ||
-FILES+= cd6.0 | ||
-FILES+= cd7.0 | ||
-FILES+= cd8.0 | ||
-FILES+= cd9.0 cd9.0.stdout | ||
-FILES+= command1.0 | ||
-FILES+= command2.0 | ||
-FILES+= command3.0 | ||
-FILES+= command3.0.stdou | ||
-FILES+= command4.0 | ||
-FILES+= command5.0 | ||
-FILES+= command5.0.stdou | ||
-FILES+= command6.0 | ||
-FILES+= command6.0.stdou | ||
-FILES+= command7.0 | ||
-FILES+= command8.0 | ||
-FILES+= command9.0 | ||
-FILES+= command10.0 | ||
-FILES+= command11.0 | ||
-FILES+= command12.0 | ||
-FILES+= dot1.0 | ||
-FILES+= dot2.0 | ||
-FILES+= dot3.0 | ||
-FILES+= dot4.0 | ||
-FILES+= eval1.0 | ||
-FILES+= eval2.0 | ||
-FILES+= eval3.0 | ||
-FILES+= eval4.0 | ||
-FILES+= eval5.0 | ||
-FILES+= eval6.0 | ||
-FILES+= eval7.0 | ||
-FILES+= eval8.7 | ||
-FILES+= exec1.0 | ||
-FILES+= exec2.0 | ||
-FILES+= exit1.0 | ||
-FILES+= exit2.8 | ||
-FILES+= exit3.0 | ||
-FILES+= export1.0 | ||
-FILES+= fc1.0 | ||
-FILES+= fc2.0 | ||
-FILES+= for1.0 | ||
-FILES+= for2.0 | ||
-FILES+= for3.0 | ||
-FILES+= getopts1.0 getopts1.0.stdou | ||
-FILES+= getopts2.0 getopts2.0.stdou | ||
-FILES+= getopts3.0 | ||
-FILES+= getopts4.0 | ||
-FILES+= getopts5.0 | ||
-FILES+= getopts6.0 | ||
-FILES+= getopts7.0 | ||
-FILES+= getopts8.0 getopts8.0.stdou | ||
-FILES+= getopts9.0 getopts9.0.stdou | ||
-FILES+= getopts10.0 | ||
-FILES+= hash1.0 hash1.0.stdout | ||
-FILES+= hash2.0 hash2.0.stdout | ||
-FILES+= hash3.0 hash3.0.stdout | ||
-FILES+= hash4.0 | ||
-FILES+= jobid1.0 | ||
-FILES+= jobid2.0 | ||
-FILES+= kill1.0 kill2.0 | ||
-FILES+= lineno.0 lineno.0.stdout | ||
-FILES+= lineno2.0 | ||
-FILES+= lineno3.0 lineno3.0.stdout | ||
-FILES+= local1.0 | ||
-FILES+= local2.0 | ||
-FILES+= local3.0 | ||
-FILES+= local4.0 | ||
-FILES+= local5.0 | ||
-FILES+= local6.0 | ||
-FILES+= local7.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.if ${MK_NLS} != "no" | ||
-FILES+= locale1.0 | ||
+${PACKAGE}FILES | ||
.endif | ||
-FILES+= printf1.0 | ||
-FILES+= printf2.0 | ||
-FILES+= printf3.0 | ||
-FILES+= printf4.0 | ||
-FILES+= read1.0 read1.0.stdout | ||
-FILES+= read2.0 | ||
-FILES+= read3.0 read3.0.stdout | ||
-FILES+= read4.0 read4.0.stdout | ||
-FILES+= read5.0 | ||
-FILES+= read6.0 | ||
-FILES+= read7.0 | ||
-FILES+= read8.0 | ||
-FILES+= read9.0 | ||
-FILES+= return1.0 | ||
-FILES+= return2.1 | ||
-FILES+= return3.1 | ||
-FILES+= return4.0 | ||
-FILES+= return5.0 | ||
-FILES+= return6.4 | ||
-FILES+= return7.4 | ||
-FILES+= return8.0 | ||
-FILES+= set1.0 | ||
-FILES+= set2.0 | ||
-FILES+= set3.0 | ||
-FILES+= trap1.0 | ||
-FILES+= trap10.0 | ||
-FILES+= trap11.0 | ||
-FILES+= trap12.0 | ||
-FILES+= trap13.0 | ||
-FILES+= trap14.0 | ||
-FILES+= trap15.0 | ||
-FILES+= trap16.0 | ||
-FILES+= trap17.0 | ||
-FILES+= trap2.0 | ||
-FILES+= trap3.0 | ||
-FILES+= trap4.0 | ||
-FILES+= trap5.0 | ||
-FILES+= trap6.0 | ||
-FILES+= trap7.0 | ||
-FILES+= trap8.0 | ||
-FILES+= trap9.0 | ||
-FILES+= type1.0 type1.0.stderr | ||
-FILES+= type2.0 | ||
-FILES+= type3.0 | ||
-FILES+= unalias.0 | ||
-FILES+= var-assign.0 | ||
-FILES+= var-assign2.0 | ||
-FILES+= wait1.0 | ||
-FILES+= wait2.0 | ||
-FILES+= wait3.0 | ||
-FILES+= wait4.0 | ||
-FILES+= wait5.0 | ||
-FILES+= wait6.0 | ||
-FILES+= wait7.0 | ||
-FILES+= wait8.0 | ||
-FILES+= wait9.127 | ||
-FILES+= wait10.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -1,37 +1,34 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
+ | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= assignment-error | ||
-FILES+= assignment-error | ||
-FILES+= backquote-error1 | ||
-FILES+= backquote-error2 | ||
-FILES+= bad-binary1.126 | ||
-FILES+= bad-keyword1.0 | ||
-FILES+= bad-parm-exp1.0 | ||
-FILES+= bad-parm-exp2.2 bad-parm-exp2.2. | ||
-FILES+= bad-parm-exp3.2 bad-parm-exp3.2. | ||
-FILES+= bad-parm-exp4.2 bad-parm-exp4.2. | ||
-FILES+= bad-parm-exp5.2 bad-parm-exp5.2. | ||
-FILES+= bad-parm-exp6.2 bad-parm-exp6.2. | ||
-FILES+= bad-parm-exp7.0 | ||
-FILES+= bad-parm-exp8.0 | ||
-FILES+= option-error.0 | ||
-FILES+= redirection-erro | ||
-FILES+= redirection-erro | ||
-FILES+= redirection-erro | ||
-FILES+= redirection-erro | ||
-FILES+= redirection-erro | ||
-FILES+= redirection-erro | ||
-FILES+= redirection-erro | ||
-FILES+= write-error1.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -1,59 +1,56 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
+ | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= bg1.0 | ||
-FILES+= bg2.0 | ||
-FILES+= bg3.0 | ||
-FILES+= bg4.0 | ||
-FILES+= bg5.0 | ||
-FILES+= bg6.0 bg6.0.stdout | ||
-FILES+= bg7.0 | ||
-FILES+= bg8.0 | ||
-FILES+= bg9.0 | ||
-FILES+= bg10.0 bg10.0.stdout | ||
-FILES+= fork1.0 | ||
-FILES+= fork2.0 | ||
-FILES+= fork3.0 | ||
-FILES+= func1.0 | ||
-FILES+= func2.0 | ||
-FILES+= func3.0 | ||
-FILES+= hash1.0 | ||
-FILES+= int-cmd1.0 | ||
-FILES+= killed1.0 | ||
-FILES+= killed2.0 | ||
-FILES+= not1.0 | ||
-FILES+= not2.0 | ||
-FILES+= path1.0 | ||
-FILES+= redir1.0 | ||
-FILES+= redir2.0 | ||
-FILES+= redir3.0 | ||
-FILES+= redir4.0 | ||
-FILES+= redir5.0 | ||
-FILES+= redir6.0 | ||
-FILES+= redir7.0 | ||
-FILES+= set-n1.0 | ||
-FILES+= set-n2.0 | ||
-FILES+= set-n3.0 | ||
-FILES+= set-n4.0 | ||
-FILES+= set-x1.0 | ||
-FILES+= set-x2.0 | ||
-FILES+= set-x3.0 | ||
-FILES+= set-x4.0 | ||
-FILES+= shellproc1.0 | ||
-FILES+= subshell1.0 subshell1.0.stdo | ||
-FILES+= subshell2.0 | ||
-FILES+= subshell3.0 | ||
-FILES+= subshell4.0 | ||
-FILES+= unknown1.0 | ||
-FILES+= var-assign1.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -1,98 +1,95 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
+ | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= arith1.0 | ||
-FILES+= arith2.0 | ||
-FILES+= arith3.0 | ||
-FILES+= arith4.0 | ||
-FILES+= arith5.0 | ||
-FILES+= arith6.0 | ||
-FILES+= arith7.0 | ||
-FILES+= arith8.0 | ||
-FILES+= arith9.0 | ||
-FILES+= arith10.0 | ||
-FILES+= arith11.0 | ||
-FILES+= arith12.0 | ||
-FILES+= arith13.0 | ||
-FILES+= arith14.0 | ||
-FILES+= assign1.0 | ||
-FILES+= cmdsubst1.0 | ||
-FILES+= cmdsubst2.0 | ||
-FILES+= cmdsubst3.0 | ||
-FILES+= cmdsubst4.0 | ||
-FILES+= cmdsubst5.0 | ||
-FILES+= cmdsubst6.0 | ||
-FILES+= cmdsubst7.0 | ||
-FILES+= cmdsubst8.0 | ||
-FILES+= cmdsubst9.0 | ||
-FILES+= cmdsubst10.0 | ||
-FILES+= cmdsubst11.0 | ||
-FILES+= cmdsubst12.0 | ||
-FILES+= cmdsubst13.0 | ||
-FILES+= cmdsubst14.0 | ||
-FILES+= cmdsubst15.0 | ||
-FILES+= cmdsubst16.0 | ||
-FILES+= cmdsubst17.0 | ||
-FILES+= export1.0 | ||
-FILES+= export2.0 | ||
-FILES+= export3.0 | ||
-FILES+= heredoc1.0 | ||
-FILES+= heredoc2.0 | ||
-FILES+= ifs1.0 | ||
-FILES+= ifs2.0 | ||
-FILES+= ifs3.0 | ||
-FILES+= ifs4.0 | ||
-FILES+= ifs5.0 | ||
-FILES+= ifs6.0 | ||
-FILES+= ifs7.0 | ||
-FILES+= length1.0 | ||
-FILES+= length2.0 | ||
-FILES+= length3.0 | ||
-FILES+= length4.0 | ||
-FILES+= length5.0 | ||
-FILES+= length6.0 | ||
-FILES+= length7.0 | ||
-FILES+= length8.0 | ||
-FILES+= local1.0 | ||
-FILES+= local2.0 | ||
-FILES+= pathname1.0 | ||
-FILES+= pathname2.0 | ||
-FILES+= pathname3.0 | ||
-FILES+= pathname4.0 | ||
-FILES+= pathname5.0 | ||
-FILES+= plus-minus1.0 | ||
-FILES+= plus-minus2.0 | ||
-FILES+= plus-minus3.0 | ||
-FILES+= plus-minus4.0 | ||
-FILES+= plus-minus5.0 | ||
-FILES+= plus-minus6.0 | ||
-FILES+= plus-minus7.0 | ||
-FILES+= plus-minus8.0 | ||
-FILES+= question1.0 | ||
-FILES+= readonly1.0 | ||
-FILES+= redir1.0 | ||
-FILES+= set-u1.0 | ||
-FILES+= set-u2.0 | ||
-FILES+= set-u3.0 | ||
-FILES+= tilde1.0 | ||
-FILES+= tilde2.0 | ||
-FILES+= trim1.0 | ||
-FILES+= trim2.0 | ||
-FILES+= trim3.0 | ||
-FILES+= trim4.0 | ||
-FILES+= trim5.0 | ||
-FILES+= trim6.0 | ||
-FILES+= trim7.0 | ||
-FILES+= trim8.0 | ||
-FILES+= trim9.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -1,31 +1,28 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
+ | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= env1.0 | ||
-FILES+= exitstatus1.0 | ||
-FILES+= mail1.0 | ||
-FILES+= mail2.0 | ||
-FILES+= optind1.0 | ||
-FILES+= optind2.0 | ||
-FILES+= positional1.0 | ||
-FILES+= positional2.0 | ||
-FILES+= positional3.0 | ||
-FILES+= positional4.0 | ||
-FILES+= positional5.0 | ||
-FILES+= positional6.0 | ||
-FILES+= positional7.0 | ||
-FILES+= positional8.0 | ||
-FILES+= positional9.0 | ||
-FILES+= pwd1.0 | ||
-FILES+= pwd2.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -1,88 +1,85 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
+ | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= alias1.0 | ||
-FILES+= alias2.0 | ||
-FILES+= alias3.0 | ||
-FILES+= alias4.0 | ||
-FILES+= alias5.0 | ||
-FILES+= alias6.0 | ||
-FILES+= alias7.0 | ||
-FILES+= alias8.0 | ||
-FILES+= alias9.0 | ||
-FILES+= alias10.0 | ||
-FILES+= alias11.0 | ||
-FILES+= alias12.0 | ||
-FILES+= alias13.0 | ||
-FILES+= alias14.0 | ||
-FILES+= alias15.0 alias15.0.stdout | ||
-FILES+= and-pipe-not.0 | ||
-FILES+= case1.0 | ||
-FILES+= case2.0 | ||
-FILES+= comment1.0 | ||
-FILES+= comment2.42 | ||
-FILES+= dollar-quote1.0 | ||
-FILES+= dollar-quote2.0 | ||
-FILES+= dollar-quote3.0 | ||
-FILES+= dollar-quote4.0 | ||
-FILES+= dollar-quote5.0 | ||
-FILES+= dollar-quote6.0 | ||
-FILES+= dollar-quote7.0 | ||
-FILES+= dollar-quote8.0 | ||
-FILES+= dollar-quote9.0 | ||
-FILES+= dollar-quote10.0 | ||
-FILES+= dollar-quote11.0 | ||
-FILES+= dollar-quote12.0 | ||
-FILES+= dollar-quote13.0 | ||
-FILES+= empty-braces1.0 | ||
-FILES+= empty-cmd1.0 | ||
-FILES+= for1.0 | ||
-FILES+= for2.0 | ||
-FILES+= func1.0 | ||
-FILES+= func2.0 | ||
-FILES+= func3.0 | ||
-FILES+= heredoc1.0 | ||
-FILES+= heredoc2.0 | ||
-FILES+= heredoc3.0 | ||
-FILES+= heredoc4.0 | ||
-FILES+= heredoc5.0 | ||
-FILES+= heredoc6.0 | ||
-FILES+= heredoc7.0 | ||
-FILES+= heredoc8.0 | ||
-FILES+= heredoc9.0 | ||
-FILES+= heredoc10.0 | ||
-FILES+= heredoc11.0 | ||
-FILES+= heredoc12.0 | ||
-FILES+= heredoc13.0 | ||
-FILES+= line-cont1.0 | ||
-FILES+= line-cont2.0 | ||
-FILES+= line-cont3.0 | ||
-FILES+= line-cont4.0 | ||
-FILES+= line-cont5.0 | ||
-FILES+= line-cont6.0 | ||
-FILES+= line-cont7.0 | ||
-FILES+= line-cont8.0 | ||
-FILES+= line-cont9.0 | ||
-FILES+= line-cont10.0 | ||
-FILES+= line-cont11.0 | ||
-FILES+= no-space1.0 | ||
-FILES+= no-space2.0 | ||
-FILES+= nul1.0 | ||
-FILES+= only-redir1.0 | ||
-FILES+= only-redir2.0 | ||
-FILES+= only-redir3.0 | ||
-FILES+= only-redir4.0 | ||
-FILES+= pipe-not1.0 | ||
-FILES+= set-v1.0 set-v1.0.stderr | ||
-FILES+= var-assign1.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -1,49 +1,46 @@ | ||
# $FreeBSD$ | ||
PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
+ | ||
TESTSDIR= ${TESTSBASE}/bin | ||
.PATH: ${.CURDIR:H} | ||
ATF_TESTS_SH= functional_test | ||
-FILESDIR= ${TESTSDIR} | ||
- | ||
-FILES= and1.0 | ||
-FILES+= and2.1 | ||
-FILES+= and3.0 | ||
-FILES+= and4.0 | ||
-FILES+= background1.0 | ||
-FILES+= cmd1.0 | ||
-FILES+= cmd2.1 | ||
-FILES+= elif1.0 | ||
-FILES+= elif2.0 | ||
-FILES+= eval1.0 | ||
-FILES+= eval2.1 | ||
-FILES+= for1.0 | ||
-FILES+= func1.0 | ||
-FILES+= func2.1 | ||
-FILES+= if1.0 | ||
-FILES+= if2.0 | ||
-FILES+= if3.0 | ||
-FILES+= not1.0 | ||
-FILES+= not2.0 | ||
-FILES+= or1.0 | ||
-FILES+= or2.0 | ||
-FILES+= or3.1 | ||
-FILES+= pipe1.1 | ||
-FILES+= pipe2.0 | ||
-FILES+= return1.0 | ||
-FILES+= semi1.1 | ||
-FILES+= semi2.1 | ||
-FILES+= subshell1.0 | ||
-FILES+= subshell2.1 | ||
-FILES+= until1.0 | ||
-FILES+= until2.0 | ||
-FILES+= until3.0 | ||
-FILES+= while1.0 | ||
-FILES+= while2.0 | ||
-FILES+= while3.0 | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
+${PACKAGE}FILES | ||
.include <bsd.test.mk> |
@@ -2,10 +2,6 @@ | ||
.include <bsd.own.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
NETBSD_ATF_TESTS | ||
.include <bsd.test.mk> |
@@ -2,10 +2,6 @@ | ||
.include <bsd.own.mk> | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
- | ||
TAP_TESTS_SH= legacy_test | ||
# Some tests in here are silently not run when the tests are executed as | ||
# root. Explicitly tell Kyua to drop privileges. |
@@ -1,12 +1,5 @@ | ||
# $FreeBSD$ | ||
-.include <bsd.own.mk> | ||
- | ||
-PACKAGE= tests | ||
-FILESGROUPS= TESTS | ||
-TESTSPACKAGE= ${PACKAGE} | ||
-TESTS+= Kyuafile | ||
- | ||
.PATH: ${SRCTOP}/tests | ||
KYUAFILE= yes | ||
@@ -69,7 +69,7 @@ restart_mountd(v | ||
* mountpoint specified in the 'skip' argument. | ||
*/ | ||
static char * | ||
-getline(FILE *fd, const char *skip) | ||
+zgetline(FILE *fd, const char *skip) | ||
{ | ||
static char line[MAXLINESIZE | ||
size_t len, skiplen; | ||
@@ -200,7 +200,7 @@ fsshare_main(con | ||
/* Place big, fat warning at the begining of the file. */ | ||
fprintf(newfd, "%s", FILE_HEADER); | ||
- while (oldfd != NULL && (line = getline(oldfd, mountpoint)) != NULL) | ||
+ while (oldfd != NULL && (line = zgetline(oldfd, mountpoint)) != NULL) | ||
fprintf(newfd, "%s\n", line); | ||
if (oldfd != NULL && ferror(oldfd) != 0) { | ||
error = ferror(oldfd); |
@@ -1,5 +0,0 @@ | ||
-Apps - Specific Application based analysis | ||
- | ||
- These are DTrace scripts that are written to analyse a particular | ||
- application or applictaion layer protocol. For example, Apache or NFS | ||
- scripts would appear here. |
@@ -1,132 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * httpdstat.d - realtime httpd statistics. Uses DTrace. | ||
- * | ||
- * $Id: httpdstat.d 2 2007-08-01 10:01:43Z brendan $ | ||
- * | ||
- * USAGE: httpdstat.d [interval [count]] | ||
- * | ||
- * interval seconds | ||
- * count number of samples | ||
- * | ||
- * FIELDS: | ||
- * TIME Time, string | ||
- * NUM Number of connections | ||
- * GET Number of "GET"s | ||
- * POST Number of "POST"s | ||
- * HEAD Number of "HEAD"s | ||
- * TRACE Number of "TRACE"s | ||
- * | ||
- * All of the statistics are printed as a value per interval (not per second). | ||
- * | ||
- * NOTE: This version does not process subsequent operations on keepalives. | ||
- * | ||
- * IDEA: Ryan Matteson (who first wrote a solution to this). | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 20-Nov-2005 Brendan Gregg Created this. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
-#pragma D option defaultargs | ||
- | ||
-inline int SCREEN = 21; | ||
- | ||
-/* | ||
- * Program Start | ||
- */ | ||
-dtrace:::BEGIN | ||
-{ | ||
- num = 0; get = 0; head = 0; post = 0; trac = 0; | ||
- lines = SCREEN + 1; | ||
- secs = $1 ? $1 : 1; | ||
- counts = $2 ? $2 : -1; | ||
- first = 1; | ||
-} | ||
- | ||
-profile:::tick- | ||
-{ | ||
- secs--; | ||
-} | ||
- | ||
-/* | ||
- * Print Header | ||
- */ | ||
-dtrace:::BEGIN, | ||
-profile:::tick- | ||
-/first || (secs == 0 && lines > SCREEN)/ | ||
-{ | ||
- printf("%-20s %6s %6s %5s %5s %5s\n", "TIME", | ||
- "NUM", "GET", "POST", "HEAD", "TRACE"); | ||
- lines = 0; | ||
- first = 0; | ||
-} | ||
- | ||
-/* | ||
- * Track Accept Events | ||
- */ | ||
-syscall::accept | ||
-/execname == "httpd"/ | ||
-{ | ||
- self->buf = 1; | ||
-} | ||
- | ||
-syscall::read:e | ||
-/self->buf/ | ||
-{ | ||
- self->buf = arg1; | ||
-} | ||
- | ||
-/* | ||
- * Tally Data | ||
- */ | ||
-syscall::read:r | ||
-/self->buf && arg0/ | ||
-{ | ||
- this->str = (char *)copyin(self->b | ||
- this->str[4] = '\0'; | ||
- get += stringof(this->s | ||
- post += stringof(this->s | ||
- head += stringof(this->s | ||
- trac += stringof(this->s | ||
- num++; | ||
- self->buf = 0; | ||
-} | ||
- | ||
-/* | ||
- * Print Output | ||
- */ | ||
-profile:::tick- | ||
-/secs == 0/ | ||
-{ | ||
- printf("%-20Y %6d %6d %5d %5d %5d\n", walltimestamp, | ||
- num, get, post, head, trac); | ||
- num = 0; get = 0; head = 0; post = 0; trac = 0; | ||
- secs = $1 ? $1 : 1; | ||
- lines++; | ||
- counts--; | ||
-} | ||
- | ||
-/* | ||
- * End | ||
- */ | ||
-profile:::tick- | ||
-/counts == 0/ | ||
-{ | ||
- exit(0); | ||
-} |
@@ -1,102 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * nfswizard.d - nfs client activity wizard. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * This examines activity caused by NFS client processes on the same server | ||
- * that you are running this script on. A detailed report is generated | ||
- * to explain various details of NFS client activity, including response | ||
- * times and file access. | ||
- * | ||
- * $Id: nfswizard.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: nfswizard.d # hit Ctrl-C to end sample | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 02-Dec-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
- scriptstart = walltimestamp; | ||
- timestart = timestamp; | ||
-} | ||
- | ||
-io:nfs::start | ||
-{ | ||
- /* tally file sizes */ | ||
- @file[args[2]->f | ||
- | ||
- /* time response */ | ||
- start[args[0]->b | ||
- | ||
- /* overall stats */ | ||
- @rbytes = sum(args[0]->b_f | ||
- @wbytes = sum(args[0]->b_f | ||
- @events = count(); | ||
-} | ||
- | ||
-io:nfs::done | ||
-/start[args[0]- | ||
-{ | ||
- /* calculate and save response time stats */ | ||
- this->elapsed = timestamp - start[args[0]->b | ||
- @maxtime = max(this->elapse | ||
- @avgtime = avg(this->elapse | ||
- @qnztime = quantize(this->e | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- /* print header */ | ||
- printf("NFS Client Wizard. %Y -> %Y\n\n", scriptstart, walltimestamp); | ||
- | ||
- /* print read/write stats */ | ||
- printa("Read: %@d bytes ", @rbytes); | ||
- normalize(@rbyte | ||
- printa("(%@d Mb)\n", @rbytes); | ||
- printa("Write: %@d bytes ", @wbytes); | ||
- normalize(@wbyte | ||
- printa("(%@d Mb)\n\n", @wbytes); | ||
- | ||
- /* print throughput stats */ | ||
- denormalize(@rby | ||
- normalize(@rbyte | ||
- printa("Read: %@d Kb/sec\n", @rbytes); | ||
- denormalize(@wby | ||
- normalize(@wbyte | ||
- printa("Write: %@d Kb/sec\n\n", @wbytes); | ||
- | ||
- /* print time stats */ | ||
- printa("NFS I/O events: %@d\n", @events); | ||
- normalize(@avgti | ||
- printa("Avg response time: %@d ms\n", @avgtime); | ||
- normalize(@maxti | ||
- printa("Max response time: %@d ms\n\n", @maxtime); | ||
- printa("Response | ||
- | ||
- /* print file stats */ | ||
- printf("Top 25 files accessed (bytes):\n"); | ||
- printf(" %-64s %s\n", "PATHNAME", "BYTES"); | ||
- trunc(@file, 25); | ||
- printa(" %-64s %@d\n", @file); | ||
-} |
@@ -1,264 +0,0 @@ | ||
-#!/bin/sh | ||
-# | ||
-# shellsnoop - A program to print read/write details from shells, | ||
-# such as keystrokes and command outputs. | ||
-# Written using DTrace (Solaris 10 3/05). | ||
-# | ||
-# This program sounds somewhat dangerous (snooping keystrokes), but is | ||
-# no more so than /usr/bin/truss, and both need root or dtrace privileges to | ||
-# run. In fact, less dangerous, as we only print visible text (not password | ||
-# text, for example). Having said that, it goes without saying that this | ||
-# program shouldn't be used for breeching privacy of other users. | ||
-# | ||
-# This was written as a tool to demonstrate the capabilities of DTrace. | ||
-# | ||
-# $Id: shellsnoop 19 2007-09-12 07:47:59Z brendan $ | ||
-# | ||
-# USAGE: shellsnoop [-hqsv] [-p PID] [-u UID] | ||
-# | ||
-# -q # quiet, only print data | ||
-# -s # include start time, us | ||
-# -v # include start time, string | ||
-# -p PID # process ID to snoop | ||
-# -u UID # user ID to snoop | ||
-# eg, | ||
-# shellsnoop # default output | ||
-# shellsnoop -v # human readable timestamps | ||
-# shellsnoop -p 1892 # snoop this PID only | ||
-# shellsnoop -qp 1892 # watch this PID data only | ||
-# | ||
-# FIELDS: | ||
-# UID User ID | ||
-# PID process ID | ||
-# PPID parent process ID | ||
-# COMM command name | ||
-# DIR direction (R read, W write) | ||
-# TEXT text contained in the read/write | ||
-# TIME timestamp for the command, us | ||
-# STRTIME timestamp for the command, string | ||
-# | ||
-# SEE ALSO: ttywatcher | ||
-# | ||
-# COPYRIGHT: Copyright (c) 2005 Brendan Gregg. | ||
-# | ||
-# CDDL HEADER START | ||
-# | ||
-# The contents of this file are subject to the terms of the | ||
-# Common Development and Distribution License, Version 1.0 only | ||
-# (the "License"). You may not use this file except in compliance | ||
-# with the License. | ||
-# | ||
-# You can obtain a copy of the license at Docs/cddl1.txt | ||
-# or http://www.opens | ||
-# See the License for the specific language governing permissions | ||
-# and limitations under the License. | ||
-# | ||
-# CDDL HEADER END | ||
-# | ||
-# Author: Brendan Gregg [Sydney, Australia] | ||
-# | ||
-# 28-Mar-2004 Brendan Gregg Created this. | ||
-# 21-Jan-2005 " " Wrapped in sh to provide options. | ||
-# 30-Nov-2005 " " Fixed trailing buffer text bug. | ||
-# 30-Nov-2005 " " Fixed sh no keystroke text in quiet bug. | ||
-# 30-Nov-2005 " " Last update. | ||
-# | ||
- | ||
- | ||
-############### | ||
-# --- Process Arguments --- | ||
-# | ||
-opt_pid=0; opt_uid=0; opt_time=0; opt_timestr=0; opt_quiet=0; opt_debug=0 | ||
-filter=0; pid=0; uid=0 | ||
- | ||
-while getopts dhp:qsu:v name | ||
-do | ||
- case $name in | ||
- d) opt_debug=1 ;; | ||
- p) opt_pid=1; pid=$OPTARG ;; | ||
- q) opt_quiet=1 ;; | ||
- s) opt_time=1 ;; | ||
- u) opt_uid=1; uid=$OPTARG ;; | ||
- v) opt_timestr=1 ;; | ||
- h|?) cat <<-END >&2 | ||
- USAGE: shellsnoop [-hqsv] [-p PID] [-u UID] | ||
- shellsnoop # default output | ||
- -q # quiet, only print data | ||
- -s # include start time, us | ||
- -v # include start time, string | ||
- -p PID # process ID to snoop | ||
- -u UID # user ID to snoop | ||
- END | ||
- exit 1 | ||
- esac | ||
-done | ||
- | ||
-if [ $opt_quiet -eq 1 ]; then | ||
- opt_time=0; opt_timestr=0 | ||
-fi | ||
-if [ $opt_pid -eq 1 -o $opt_uid -eq 1 ]; then | ||
- filter=1 | ||
-fi | ||
- | ||
- | ||
-############### | ||
-# --- Main Program, DTrace --- | ||
-# | ||
-dtrace -n ' | ||
- /* | ||
- * Command line arguments | ||
- */ | ||
- inline int OPT_debug = '$opt_debug'; | ||
- inline int OPT_quiet = '$opt_quiet'; | ||
- inline int OPT_pid = '$opt_pid'; | ||
- inline int OPT_uid = '$opt_uid'; | ||
- inline int OPT_time = '$opt_time'; | ||
- inline int OPT_timestr = '$opt_timestr'; | ||
- inline int FILTER = '$filter'; | ||
- inline int PID = '$pid'; | ||
- inline int UID = '$uid'; | ||
- | ||
- #pragma D option quiet | ||
- #pragma D option switchrate=20hz | ||
- | ||
- /* | ||
- * Print header | ||
- */ | ||
- dtrace:::BEGIN /OPT_time == 1/ | ||
- { | ||
- printf("%-14s ","TIME"); | ||
- } | ||
- dtrace:::BEGIN /OPT_timestr == 1/ | ||
- { | ||
- printf("%-20s ","STRTIME"); | ||
- } | ||
- dtrace:::BEGIN /OPT_quiet == 0/ | ||
- { | ||
- printf("%5s %5s %8s %3s %s\n", "PID", "PPID", "CMD", "DIR", "TEXT"); | ||
- } | ||
- | ||
- /* | ||
- * Remember this PID is a shell child | ||
- */ | ||
- syscall::execve: | ||
- /execname == "sh" || execname == "ksh" || execname == "csh" || | ||
- execname == "tcsh" || execname == "zsh" || execname == "bash"/ | ||
- { | ||
- child[pid] = 1; | ||
- | ||
- } | ||
- syscall::execve: | ||
- /(OPT_pid == 1 && PID != ppid) || (OPT_uid == 1 && UID != uid)/ | ||
- { | ||
- /* forget if filtered */ | ||
- child[pid] = 0; | ||
- } | ||
- | ||
- /* | ||
- * Print shell keystrokes | ||
- */ | ||
- syscall::write:e | ||
- /(execname == "sh" || execname == "ksh" || execname == "csh" || | ||
- execname == "tcsh" || execname == "zsh" || execname == "bash") | ||
- && (arg0 >= 0 && arg0 <= 2)/ | ||
- { | ||
- self->buf = arg1; | ||
- } | ||
- syscall::write:e | ||
- /(OPT_pid == 1 && PID != pid) || (OPT_uid == 1 && UID != uid)/ | ||
- { | ||
- self->buf = 0; | ||
- } | ||
- syscall::write:r | ||
- /self->buf && child[pid] == 0 && OPT_time == 1/ | ||
- { | ||
- printf("%-14d ", timestamp/1000); | ||
- } | ||
- syscall::write:r | ||
- /self->buf && child[pid] == 0 && OPT_timestr == 1/ | ||
- { | ||
- printf("%-20Y ", walltimestamp); | ||
- } | ||
- syscall::write:r | ||
- /self->buf && child[pid] == 0 && OPT_quiet == 0/ | ||
- { | ||
- this->text = (char *)copyin(self->b | ||
- this->text[arg0] | ||
- | ||
- printf("%5d %5d %8s %3s %s\n", pid, curpsinfo->pr_pp | ||
- probefunc == "read" ? "R" : "W", stringof(this->t | ||
- } | ||
- syscall::write:r | ||
- /self->buf && child[pid] == 0 && OPT_quiet == 1/ | ||
- { | ||
- this->text = (char *)copyin(self->b | ||
- this->text[arg0] | ||
- printf("%s", stringof(this->t | ||
- } | ||
- syscall::read:re | ||
- /self->buf && execname == "sh" && child[pid] == 0 && OPT_quiet == 1/ | ||
- { | ||
- this->text = (char *)copyin(self->b | ||
- this->text[arg0] | ||
- printf("%s", stringof(this->t | ||
- } | ||
- syscall::write:r | ||
- /self->buf && child[pid] == 0/ | ||
- { | ||
- self->buf = 0; | ||
- } | ||
- | ||
- /* | ||
- * Print command output | ||
- */ | ||
- syscall::write:e | ||
- /child[pid] == 1 && (arg0 == 1 || arg0 == 2)/ | ||
- { | ||
- self->buf = arg1; | ||
- } | ||
- syscall::write:r | ||
- /self->buf && OPT_time == 1/ | ||
- { | ||
- printf("%-14d ", timestamp/1000); | ||
- } | ||
- syscall::write:r | ||
- /self->buf && OPT_timestr == 1/ | ||
- { | ||
- printf("%-20Y ", walltimestamp); | ||
- } | ||
- syscall::write:r | ||
- /self->buf && OPT_quiet == 0/ | ||
- { | ||
- this->text = (char *)copyin(self->b | ||
- this->text[arg0] | ||
- | ||
- printf("%5d %5d %8s %3s %s", pid, curpsinfo->pr_pp | ||
- probefunc == "read" ? "R" : "W", stringof(this->t | ||
- | ||
- /* here we check if a newline is needed */ | ||
- this->length = strlen(this->tex | ||
- printf("%s", this->text[this- | ||
- self->buf = 0; | ||
- } | ||
- syscall::write:r | ||
- /self->buf && OPT_quiet == 1/ | ||
- { | ||
- this->text = (char *)copyin(self->b | ||
- this->text[arg0] | ||
- printf("%s", stringof(this->t | ||
- self->buf = 0; | ||
- } | ||
- | ||
- /* | ||
- * Cleanup | ||
- */ | ||
- syscall::exit:en | ||
- { | ||
- child[pid] = 0; | ||
- | ||
- /* debug */ | ||
- this->parent = (char *)curthread->td_ | ||
- OPT_debug == 1 ? printf("PID %d CMD %s exited. (%s)\n", | ||
- pid, execname, stringof(this->p | ||
- } | ||
-' |
@@ -1,186 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * weblatency.d - website latency statistics. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * $Id: weblatency.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: weblatency.d # hit Ctrl-C to end sample | ||
- * | ||
- * See the code below for the "BROWSER" variable, which sets the browser | ||
- * to trace (currently set to "mozilla-bin"). | ||
- * | ||
- * This is written as an experimental tool, and may not work at all with | ||
- * your browser. | ||
- * | ||
- * FIELDS: | ||
- * HOST Hostname from URL | ||
- * NUM Number of GETs | ||
- * AVGTIME(ms) Average time for response, ms | ||
- * MAXTIME(ms) Maximum time for response, ms | ||
- * | ||
- * NOTE: | ||
- * | ||
- * The latency measured here is from the browser sending the GET | ||
- * request to when the browser begins to recieve the response. It | ||
- * is an overall response time for the client, and encompasses | ||
- * connection speed delays, DNS lookups, proxy delays, and web server | ||
- * response time. | ||
- * | ||
- * IDEA: Bryan Cantrill (who wrote an elegant version for Sol 10 update 1) | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * ToDo: | ||
- * Check write fd for socket, not file. | ||
- * | ||
- * 30-Nov-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-/* browser's execname */ | ||
-inline string BROWSER = "mozilla-bin"; | ||
- | ||
-/* maximum expected hostname length + "GET http://" */ | ||
-inline int MAX_REQ = 64; | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-/* | ||
- * Trace brower request | ||
- * | ||
- * This is achieved by matching writes for the browser's execname that | ||
- * start with "GET", and then timing from the return of the write to | ||
- * the return of the next read in the same thread. Various stateful flags | ||
- * are used: self->fd, self->read. | ||
- * | ||
- * For performance reasons, I'd like to only process writes that follow a | ||
- * connect(), however this approach fails to process keepalives. | ||
- */ | ||
-syscall::write: | ||
-/execname == BROWSER/ | ||
-{ | ||
- self->buf = arg1; | ||
- self->fd = arg0 + 1; | ||
- self->nam = ""; | ||
-} | ||
- | ||
-syscall::write: | ||
-/self->fd/ | ||
-{ | ||
- this->str = (char *)copyin(self->b | ||
- this->str[4] = '\0'; | ||
- self->fd = stringof(this->s | ||
-} | ||
- | ||
-syscall::write: | ||
-/self->fd/ | ||
-{ | ||
- /* fetch browser request */ | ||
- this->str = (char *)copyin(self->b | ||
- this->str[MAX_RE | ||
- | ||
- /* | ||
- * This unrolled loop strips down a URL to it's hostname. | ||
- * We ought to use strtok(), but it's not available on Sol 10 3/05, | ||
- * so instead I used dirname(). It's not pretty - it's done so that | ||
- * this works on all Sol 10 versions. | ||
- */ | ||
- self->req = stringof(this->s | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->req = dirname(self->re | ||
- self->nam = strlen(self->req | ||
- self->nam = basename(self->n | ||
- | ||
- /* start the timer */ | ||
- start[pid, self->fd - 1] = timestamp; | ||
- host[pid, self->fd - 1] = self->nam; | ||
- self->buf = 0; | ||
- self->fd = 0; | ||
- self->req = 0; | ||
- self->nam = 0; | ||
-} | ||
- | ||
-/* this one wasn't a GET */ | ||
-syscall::write: | ||
-/self->buf/ | ||
-{ | ||
- self->buf = 0; | ||
- self->fd = 0; | ||
-} | ||
- | ||
-syscall::read:e | ||
-/execname == BROWSER && start[pid, arg0]/ | ||
-{ | ||
- self->fd = arg0 + 1; | ||
-} | ||
- | ||
-/* | ||
- * Record host details | ||
- */ | ||
-syscall::read:r | ||
-/self->fd/ | ||
-{ | ||
- /* fetch details */ | ||
- self->host = stringof(host[pi | ||
- this->start = start[pid, self->fd - 1]; | ||
- | ||
- /* save details */ | ||
- @Avg[self->host] | ||
- @Max[self->host] | ||
- @Num[self->host] | ||
- | ||
- /* clear vars */ | ||
- start[pid, self->fd - 1] = 0; | ||
- host[pid, self->fd - 1] = 0; | ||
- self->host = 0; | ||
- self->fd = 0; | ||
-} | ||
- | ||
-/* | ||
- * Output report | ||
- */ | ||
-dtrace:::END | ||
-{ | ||
- printf("%-32s %11s\n", "HOST", "NUM"); | ||
- printa("%-32s %@11d\n", @Num); | ||
- | ||
- printf("\n%-32s %11s\n", "HOST", "AVGTIME(ms)"); | ||
- printa("%-32s %@11d\n", @Avg); | ||
- | ||
- printf("\n%-32s %11s\n", "HOST", "MAXTIME(ms)"); | ||
- printa("%-32s %@11d\n", @Max); | ||
-} |
@@ -1 +0,0 @@ | ||
-../Mem/anonpgpi |
@@ -1 +0,0 @@ | ||
-../Disk/bitesiz |
@@ -1 +0,0 @@ | ||
-../Net/connecti |
@@ -1 +0,0 @@ | ||
-../Kernel/cpudi |
@@ -1 +0,0 @@ | ||
-../Kernel/cputi |
@@ -1 +0,0 @@ | ||
-../Cpu/cputypes |
@@ -1 +0,0 @@ | ||
-../Cpu/cpuwalk. |
@@ -1 +0,0 @@ | ||
-../Proc/crash.d |
@@ -1 +0,0 @@ | ||
-../Proc/creatby |
@@ -1 +0,0 @@ | ||
-../Kernel/cswst |
@@ -1 +0,0 @@ | ||
-../Proc/dapppro |
@@ -1 +0,0 @@ | ||
-../Proc/dapptra |
@@ -1 +0,0 @@ | ||
-../dexplorer |
@@ -1 +0,0 @@ | ||
-../Disk/diskhit |
@@ -1 +0,0 @@ | ||
-../Cpu/dispqlen |
@@ -1 +0,0 @@ | ||
-../Kernel/dnlcp |
@@ -1 +0,0 @@ | ||
-../Kernel/dnlcs |
@@ -1 +0,0 @@ | ||
-../Kernel/dnlcs |
@@ -1 +0,0 @@ | ||
-../dtruss |
@@ -1 +0,0 @@ | ||
-../dvmstat |
@@ -1 +0,0 @@ | ||
-../errinfo |
@@ -1 +0,0 @@ | ||
-../execsnoop |
@@ -1 +0,0 @@ | ||
-../Proc/fddist |
@@ -1 +0,0 @@ | ||
-../Proc/filebyp |
@@ -1 +0,0 @@ | ||
-../FS/fspaging. |
@@ -1 +0,0 @@ | ||
-../FS/fsrw.d |
@@ -1 +0,0 @@ | ||
-../Misc/guess.d |
@@ -1 +0,0 @@ | ||
-../hotkernel |
@@ -1 +0,0 @@ | ||
-../Disk/hotspot |
@@ -1 +0,0 @@ | ||
-../hotuser |
@@ -1 +0,0 @@ | ||
-../Apps/httpdst |
@@ -1 +0,0 @@ | ||
-../Net/icmpstat |
@@ -1 +0,0 @@ | ||
-../Cpu/intbycpu |
@@ -1 +0,0 @@ | ||
-../Cpu/intoncpu |
@@ -1 +0,0 @@ | ||
-../Cpu/inttimes |
@@ -1 +0,0 @@ | ||
-../Disk/iofile. |
@@ -1 +0,0 @@ | ||
-../Disk/iofileb |
@@ -1 +0,0 @@ | ||
-../iopattern |
@@ -1 +0,0 @@ | ||
-../Disk/iopendi |
@@ -1 +0,0 @@ | ||
-../iosnoop |
@@ -1 +0,0 @@ | ||
-../iotop |
@@ -1 +0,0 @@ | ||
-../Java/j_calld |
@@ -1 +0,0 @@ | ||
-../Java/j_calls |
@@ -1 +0,0 @@ | ||
-../Java/j_callt |
@@ -1 +0,0 @@ | ||
-../Java/j_class |
@@ -1 +0,0 @@ | ||
-../Java/j_cpudi |
@@ -1 +0,0 @@ | ||
-../Java/j_cputi |
@@ -1 +0,0 @@ | ||
-../Java/j_event |
@@ -1 +0,0 @@ | ||
-../Java/j_flow. |
@@ -1 +0,0 @@ | ||
-../Java/j_flowt |
@@ -1 +0,0 @@ | ||
-../Java/j_metho |
@@ -1 +0,0 @@ | ||
-../Java/j_objne |
@@ -1 +0,0 @@ | ||
-../Java/j_packa |
@@ -1 +0,0 @@ | ||
-../Java/j_profi |
@@ -1 +0,0 @@ | ||
-../Java/j_stat. |
@@ -1 +0,0 @@ | ||
-../Java/j_sysca |
@@ -1 +0,0 @@ | ||
-../Java/j_sysco |
@@ -1 +0,0 @@ | ||
-../Java/j_threa |
@@ -1 +0,0 @@ | ||
-../Java/j_who.d |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../JavaScript/j |
@@ -1 +0,0 @@ | ||
-../Proc/kill.d |
@@ -1 +0,0 @@ | ||
-../Kernel/kstat |
@@ -1 +0,0 @@ | ||
-../Proc/lastwor |
@@ -1 +0,0 @@ | ||
-../Cpu/loads.d |
@@ -1 +0,0 @@ | ||
-../Locks/lockby |
@@ -1 +0,0 @@ | ||
-../Locks/lockby |
@@ -1 +0,0 @@ | ||
-../Mem/minfbypi |
@@ -1 +0,0 @@ | ||
-../Mem/minfbypr |
@@ -1 +0,0 @@ | ||
-../Proc/mmapfil |
@@ -1 +0,0 @@ | ||
-../Kernel/modca |
@@ -1 +0,0 @@ | ||
-../Proc/newproc |
@@ -1 +0,0 @@ | ||
-../Apps/nfswiza |
@@ -1 +0,0 @@ | ||
-../opensnoop |
@@ -1 +0,0 @@ | ||
-../Proc/pathope |
@@ -1 +0,0 @@ | ||
-../Proc/pfilest |
@@ -1 +0,0 @@ | ||
-../Mem/pgpginby |
@@ -1 +0,0 @@ | ||
-../Mem/pgpginby |
@@ -1 +0,0 @@ | ||
-../Php/php_call |
@@ -1 +0,0 @@ | ||
-../Php/php_call |
@@ -1 +0,0 @@ | ||
-../Php/php_cpud |
@@ -1 +0,0 @@ | ||
-../Php/php_cput |
@@ -1 +0,0 @@ | ||
-../Php/php_flow |
@@ -1 +0,0 @@ | ||
-../Php/php_flow |
@@ -1 +0,0 @@ | ||
-../Php/php_flow |
@@ -1 +0,0 @@ | ||
-../Php/php_func |
@@ -1 +0,0 @@ | ||
-../Php/php_mall |
@@ -1 +0,0 @@ | ||
-../Php/php_sysc |
@@ -1 +0,0 @@ | ||
-../Php/php_sysc |
@@ -1 +0,0 @@ | ||
-../Php/php_who. |
@@ -1 +0,0 @@ | ||
-../Proc/pidpers |
@@ -1 +0,0 @@ | ||
-../Perl/pl_call |
@@ -1 +0,0 @@ | ||
-../Perl/pl_call |
@@ -1 +0,0 @@ | ||
-../Perl/pl_cpud |
@@ -1 +0,0 @@ | ||
-../Perl/pl_cput |
@@ -1 +0,0 @@ | ||
-../Perl/pl_flow |
@@ -1 +0,0 @@ | ||
-../Perl/pl_flow |
@@ -1 +0,0 @@ | ||
-../Perl/pl_flow |
@@ -1 +0,0 @@ | ||
-../Perl/pl_mall |
@@ -1 +0,0 @@ | ||
-../Perl/pl_subc |
@@ -1 +0,0 @@ | ||
-../Perl/pl_sysc |
@@ -1 +0,0 @@ | ||
-../Perl/pl_sysc |
@@ -1 +0,0 @@ | ||
-../Perl/pl_who. |
@@ -1 +0,0 @@ | ||
-../Kernel/pricl |
@@ -1 +0,0 @@ | ||
-../Kernel/pridi |
@@ -1 +0,0 @@ | ||
-../procsystime |
@@ -1 +0,0 @@ | ||
-../Kernel/putne |
@@ -1 +0,0 @@ | ||
-../Python/py_ca |
@@ -1 +0,0 @@ | ||
-../Python/py_ca |
@@ -1 +0,0 @@ | ||
-../Python/py_cp |
@@ -1 +0,0 @@ | ||
-../Python/py_cp |
@@ -1 +0,0 @@ | ||
-../Python/py_fl |
@@ -1 +0,0 @@ | ||
-../Python/py_fl |
@@ -1 +0,0 @@ | ||
-../Python/py_fl |
@@ -1 +0,0 @@ | ||
-../Python/py_fu |
@@ -1 +0,0 @@ | ||
-../Python/py_ma |
@@ -1 +0,0 @@ | ||
-../Python/py_ma |
@@ -1 +0,0 @@ | ||
-../Python/py_pr |
@@ -1 +0,0 @@ | ||
-../Python/py_sy |
@@ -1 +0,0 @@ | ||
-../Python/py_sy |
@@ -1 +0,0 @@ | ||
-../Python/py_wh |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_call |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_call |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_call |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_cpud |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_cput |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_flow |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_flow |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_flow |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_func |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_line |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_mall |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_objc |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_objn |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_stat |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_sysc |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_sysc |
@@ -1 +0,0 @@ | ||
-../Ruby/rb_who. |
@@ -1 +0,0 @@ | ||
-../Proc/readbyt |
@@ -1 +0,0 @@ | ||
-../Proc/readdis |
@@ -1 +0,0 @@ | ||
-../FS/rfileio.d |
@@ -1 +0,0 @@ | ||
-../FS/rfsio.d |
@@ -1 +0,0 @@ | ||
-../Cpu/runocc.d |
@@ -1 +0,0 @@ | ||
-../Proc/rwbbypi |
@@ -1 +0,0 @@ | ||
-../Proc/rwbypid |
@@ -1 +0,0 @@ | ||
-../Proc/rwbytyp |
@@ -1 +0,0 @@ | ||
-../rwsnoop |
@@ -1 +0,0 @@ | ||
-../rwtop |
@@ -1 +0,0 @@ | ||
-../Proc/samplep |
@@ -1 +0,0 @@ | ||
-../System/sar-c |
@@ -1 +0,0 @@ | ||
-../Disk/seeksiz |
@@ -1 +0,0 @@ | ||
-../User/setuids |
@@ -1 +0,0 @@ | ||
-../Shell/sh_cal |
@@ -1 +0,0 @@ | ||
-../Shell/sh_cal |
@@ -1 +0,0 @@ | ||
-../Shell/sh_cal |
@@ -1 +0,0 @@ | ||
-../Shell/sh_cpu |
@@ -1 +0,0 @@ | ||
-../Shell/sh_cpu |
@@ -1 +0,0 @@ | ||
-../Shell/sh_flo |
@@ -1 +0,0 @@ | ||
-../Shell/sh_flo |
@@ -1 +0,0 @@ | ||
-../Shell/sh_flo |
@@ -1 +0,0 @@ | ||
-../Shell/sh_lin |
@@ -1 +0,0 @@ | ||
-../Shell/sh_pid |
@@ -1 +0,0 @@ | ||
-../Shell/sh_sta |
@@ -1 +0,0 @@ | ||
-../Shell/sh_sys |
@@ -1 +0,0 @@ | ||
-../Shell/sh_sys |
@@ -1 +0,0 @@ | ||
-../Shell/sh_was |
@@ -1 +0,0 @@ | ||
-../Shell/sh_who |
@@ -1 +0,0 @@ | ||
-../Apps/shellsn |
@@ -1 +0,0 @@ | ||
-../Proc/shortli |
@@ -1 +0,0 @@ | ||
-../Proc/sigdist |
@@ -1 +0,0 @@ | ||
-../Proc/stacksi |
@@ -1 +0,0 @@ | ||
-../statsnoop |
@@ -1 +0,0 @@ | ||
-../Mem/swapinfo |
@@ -1 +0,0 @@ | ||
-../Proc/sysbypi |
@@ -1 +0,0 @@ | ||
-../Proc/syscall |
@@ -1 +0,0 @@ | ||
-../Proc/syscall |
@@ -1 +0,0 @@ | ||
-../System/sysca |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_call |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_call |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_call |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_cpud |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_cput |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_flow |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_flow |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_ins. |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_insf |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_proc |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_proc |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_stat |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_sysc |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_sysc |
@@ -1 +0,0 @@ | ||
-../Tcl/tcl_who. |
@@ -1 +0,0 @@ | ||
-../Net/tcpsnoop |
@@ -1 +0,0 @@ | ||
-../Net/tcpsnoop |
@@ -1 +0,0 @@ | ||
-../Net/tcpsnoop |
@@ -1 +0,0 @@ | ||
-../Net/tcpsnoop |
@@ -1 +0,0 @@ | ||
-../Net/tcpstat. |
@@ -1 +0,0 @@ | ||
-../Net/tcptop |
@@ -1 +0,0 @@ | ||
-../Net/tcptop_s |
@@ -1 +0,0 @@ | ||
-../Net/tcpwdist |
@@ -1 +0,0 @@ | ||
-../Proc/threade |
@@ -1 +0,0 @@ | ||
-../System/topsy |
@@ -1 +0,0 @@ | ||
-../Proc/topsysp |
@@ -1 +0,0 @@ | ||
-../Net/udpstat. |
@@ -1 +0,0 @@ | ||
-../System/uname |
@@ -1 +0,0 @@ | ||
-../Mem/vmbypid. |
@@ -1 +0,0 @@ | ||
-../Mem/vmstat-p |
@@ -1 +0,0 @@ | ||
-../Mem/vmstat.d |
@@ -1 +0,0 @@ | ||
-../FS/vopstat |
@@ -1 +0,0 @@ | ||
-../Apps/weblate |
@@ -1 +0,0 @@ | ||
-../Kernel/whate |
@@ -1 +0,0 @@ | ||
-../Misc/woof.d |
@@ -1 +0,0 @@ | ||
-../Misc/wpm.d |
@@ -1 +0,0 @@ | ||
-../Proc/writeby |
@@ -1 +0,0 @@ | ||
-../Proc/writedi |
@@ -1 +0,0 @@ | ||
-../Cpu/xcallsby |
@@ -1 +0,0 @@ | ||
-../Mem/xvmstat |
@@ -1 +0,0 @@ | ||
-../Zones/zvmsta |
@@ -1,26 +0,0 @@ | ||
-public class Func_abc { | ||
- public static void func_c() { | ||
- System.out.print | ||
- try { | ||
- Thread.currentTh | ||
- } catch (Exception e) { } | ||
- } | ||
- public static void func_b() { | ||
- System.out.print | ||
- try { | ||
- Thread.currentTh | ||
- } catch (Exception e) { } | ||
- func_c(); | ||
- } | ||
- public static void func_a() { | ||
- System.out.print | ||
- try { | ||
- Thread.currentTh | ||
- } catch (Exception e) { } | ||
- func_b(); | ||
- } | ||
- | ||
- public static void main(String[] args) { | ||
- func_a(); | ||
- } | ||
-} |
@@ -1,19 +0,0 @@ | ||
-public class Func_loop { | ||
- public static void func_c() { | ||
- System.out.print | ||
- while (true) { | ||
- } | ||
- } | ||
- public static void func_b() { | ||
- System.out.print | ||
- func_c(); | ||
- } | ||
- public static void func_a() { | ||
- System.out.print | ||
- func_b(); | ||
- } | ||
- | ||
- public static void main(String[] args) { | ||
- func_a(); | ||
- } | ||
-} |
@@ -1,39 +0,0 @@ | ||
-<HTML> | ||
-<HEAD> | ||
-<TITLE>func_clo | ||
-<SCRIPT type="text/javas | ||
-function func_c() { | ||
- document.getElem | ||
- for (i = 0; i < 30000; i++) { | ||
- j = i + 1 | ||
- } | ||
-} | ||
- | ||
-function func_b() { | ||
- document.getElem | ||
- for (i = 0; i < 20000; i++) { | ||
- j = i + 1 | ||
- } | ||
- func_c() | ||
-} | ||
- | ||
-function func_a() { | ||
- document.getElem | ||
- for (i = 0; i < 10000; i++) { | ||
- j = i + 1 | ||
- } | ||
- func_b() | ||
-} | ||
- | ||
-function start() { | ||
- now = new Date() | ||
- document.getElem | ||
- func_a() | ||
- var timeout = setTimeout('star | ||
-} | ||
-</SCRIPT> | ||
-</HEAD> | ||
-<BODY onload="start()" | ||
-<DIV id="now"></DIV> | ||
-</BODY> | ||
-</HTML> |
@@ -1,31 +0,0 @@ | ||
-<HTML> | ||
-<HEAD><TITLE>fu | ||
-<BODY> | ||
-<SCRIPT type="text/javas | ||
-function func_c() { | ||
- document.write(" | ||
- for (i = 0; i < 30000; i++) { | ||
- j = i + 1 | ||
- } | ||
-} | ||
- | ||
-function func_b() { | ||
- document.write(" | ||
- for (i = 0; i < 20000; i++) { | ||
- j = i + 1 | ||
- } | ||
- func_c() | ||
-} | ||
- | ||
-function func_a() { | ||
- document.write(" | ||
- for (i = 0; i < 10000; i++) { | ||
- j = i + 1 | ||
- } | ||
- func_b() | ||
-} | ||
- | ||
-func_a() | ||
-</SCRIPT> | ||
-</BODY> | ||
-</HTML> |
@@ -1,20 +0,0 @@ | ||
-#!./perl -w | ||
- | ||
-sub func_c { | ||
- print "Function C\n"; | ||
- sleep 1; | ||
-} | ||
- | ||
-sub func_b { | ||
- print "Function B\n"; | ||
- sleep 1; | ||
- func_c(); | ||
-} | ||
- | ||
-sub func_a { | ||
- print "Function A\n"; | ||
- sleep 1; | ||
- func_b(); | ||
-} | ||
- | ||
-func_a(); |
@@ -1,18 +0,0 @@ | ||
-#!./perl -w | ||
- | ||
-sub func_c { | ||
- print "Function C\n"; | ||
-} | ||
- | ||
-sub func_b { | ||
- print "Function B\n"; | ||
- my $b = "B" x 100_000; | ||
- func_c(); | ||
-} | ||
- | ||
-sub func_a { | ||
- print "Function A\n"; | ||
- func_b(); | ||
-} | ||
- | ||
-func_a(); |
@@ -1,20 +0,0 @@ | ||
-#!./perl -w | ||
- | ||
-sub func_c { | ||
- print "Function C\n"; | ||
- for (my $i = 0; $i < 3000000; $i++) { my $j = $i + 1; } | ||
-} | ||
- | ||
-sub func_b { | ||
- print "Function B\n"; | ||
- for (my $i = 0; $i < 2000000; $i++) { my $j = $i + 1 ; } | ||
- func_c(); | ||
-} | ||
- | ||
-sub func_a { | ||
- print "Function A\n"; | ||
- for (my $i = 0; $i < 1000000; $i++) { my $j = $i + 1; } | ||
- func_b(); | ||
-} | ||
- | ||
-func_a(); |
@@ -1,3 +0,0 @@ | ||
-#!./perl | ||
- | ||
-print "Hello World!\n"; |
@@ -1,5 +0,0 @@ | ||
-#!./perl -w | ||
- | ||
-use strict; | ||
- | ||
-print "Hello World!\n"; |
@@ -1,23 +0,0 @@ | ||
-<?php | ||
-function func_c() | ||
-{ | ||
- echo "Function C\n"; | ||
- sleep(1); | ||
-} | ||
- | ||
-function func_b() | ||
-{ | ||
- echo "Function B\n"; | ||
- sleep(1); | ||
- func_c(); | ||
-} | ||
- | ||
-function func_a() | ||
-{ | ||
- echo "Function A\n"; | ||
- sleep(1); | ||
- func_b(); | ||
-} | ||
- | ||
-func_a(); | ||
Bulk data, 3 bytes |
@@ -1,19 +0,0 @@ | ||
-#!/usr/bin/pyth | ||
- | ||
-import time | ||
- | ||
-def func_c(): | ||
- print "Function C" | ||
- time.sleep(1) | ||
- | ||
-def func_b(): | ||
- print "Function B" | ||
- time.sleep(1) | ||
- func_c() | ||
- | ||
-def func_a(): | ||
- print "Function A" | ||
- time.sleep(1) | ||
- func_b() | ||
- | ||
-func_a() |
@@ -1,26 +0,0 @@ | ||
-#!/usr/bin/pyth | ||
- | ||
-def func_c(): | ||
- print "Function C" | ||
- i = 0 | ||
- while (i < 3000000): | ||
- i = i + 1 | ||
- j = i + 1 | ||
- | ||
-def func_b(): | ||
- print "Function B" | ||
- i = 0 | ||
- while (i < 2000000): | ||
- i = i + 1 | ||
- j = i + 1 | ||
- func_c() | ||
- | ||
-def func_a(): | ||
- print "Function A" | ||
- i = 0 | ||
- while (i < 1000000): | ||
- i = i + 1 | ||
- j = i + 1 | ||
- func_b() | ||
- | ||
-func_a() |
@@ -1,16 +0,0 @@ | ||
-Code - Example Programs | ||
- | ||
- This directory contains example software sorted by language, which may | ||
- be used as the target for DTrace scripts. These examples are simple and | ||
- to the point, and are intended as example targets for when learing | ||
- DTrace. | ||
- | ||
- Some people attempt to learn DTrace by tracing their complex real | ||
- world application first. That's the hard way. Try these programs instead, | ||
- and once you are confident here, move onto harder targets. | ||
- | ||
- Some of these programs feature in the example files in the /Examples | ||
- directory. | ||
- | ||
- This directory does not contain DTrace scripts. | ||
- |
@@ -1,20 +0,0 @@ | ||
-#!./ruby -w | ||
- | ||
-def func_c | ||
- print "Function C\n" | ||
- sleep 1 | ||
-end | ||
- | ||
-def func_b | ||
- print "Function B\n" | ||
- sleep 1 | ||
- func_c | ||
-end | ||
- | ||
-def func_a | ||
- print "Function A\n" | ||
- sleep 1 | ||
- func_b | ||
-end | ||
- | ||
-func_a |
@@ -1,32 +0,0 @@ | ||
-#!./ruby -w | ||
- | ||
-def func_c | ||
- print "Function C\n" | ||
- i = 0 | ||
- while i < 300000 | ||
- i = i + 1 | ||
- j = i + 1 | ||
- end | ||
-end | ||
- | ||
-def func_b | ||
- print "Function B\n" | ||
- i = 0 | ||
- while i < 200000 | ||
- i = i + 1 | ||
- j = i + 1 | ||
- end | ||
- func_c | ||
-end | ||
- | ||
-def func_a | ||
- print "Function A\n" | ||
- i = 0 | ||
- while i < 100000 | ||
- i = i + 1 | ||
- j = i + 1 | ||
- end | ||
- func_b | ||
-end | ||
- | ||
-func_a |
@@ -1,23 +0,0 @@ | ||
-#!./sh | ||
- | ||
-func_c() | ||
-{ | ||
- echo "Function C" | ||
- sleep 1 | ||
-} | ||
- | ||
-func_b() | ||
-{ | ||
- echo "Function B" | ||
- sleep 1 | ||
- func_c | ||
-} | ||
- | ||
-func_a() | ||
-{ | ||
- echo "Function A" | ||
- sleep 1 | ||
- func_b | ||
-} | ||
- | ||
-func_a |
@@ -1,35 +0,0 @@ | ||
-#!./sh | ||
- | ||
-func_c() | ||
-{ | ||
- echo "Function C" | ||
- i=0 | ||
- while [ $i -lt 300 ] | ||
- do | ||
- i=`expr $i + 1` | ||
- done | ||
-} | ||
- | ||
-func_b() | ||
-{ | ||
- echo "Function B" | ||
- i=0 | ||
- while [ $i -lt 200 ] | ||
- do | ||
- i=`expr $i + 1` | ||
- done | ||
- func_c | ||
-} | ||
- | ||
-func_a() | ||
-{ | ||
- echo "Function A" | ||
- i=0 | ||
- while [ $i -lt 100 ] | ||
- do | ||
- i=`expr $i + 1` | ||
- done | ||
- func_b | ||
-} | ||
- | ||
-func_a |
@@ -1,23 +0,0 @@ | ||
-#!./sh | ||
- | ||
-func_c() | ||
-{ | ||
- /usr/bin/echo "Function C" | ||
- sleep 1 | ||
-} | ||
- | ||
-func_b() | ||
-{ | ||
- /usr/bin/echo "Function B" | ||
- sleep 1 | ||
- func_c | ||
-} | ||
- | ||
-func_a() | ||
-{ | ||
- /usr/bin/echo "Function A" | ||
- sleep 1 | ||
- func_b | ||
-} | ||
- | ||
-func_a |
@@ -1,20 +0,0 @@ | ||
-#!./tclsh | ||
- | ||
-proc func_c {} { | ||
- puts "Function C" | ||
- after 1000 | ||
-} | ||
- | ||
-proc func_b {} { | ||
- puts "Function B" | ||
- after 1000 | ||
- func_c | ||
-} | ||
- | ||
-proc func_a {} { | ||
- puts "Function A" | ||
- after 1000 | ||
- func_b | ||
-} | ||
- | ||
-func_a |
@@ -1,29 +0,0 @@ | ||
-#!./tclsh | ||
- | ||
-proc func_c {} { | ||
- puts "Function C" | ||
- set i 0 | ||
- while {$i < 300000} { | ||
- set i [expr $i + 1] | ||
- } | ||
-} | ||
- | ||
-proc func_b {} { | ||
- puts "Function B" | ||
- set i 0 | ||
- while {$i < 200000} { | ||
- set i [expr $i + 1] | ||
- } | ||
- func_c | ||
-} | ||
- | ||
-proc func_a {} { | ||
- puts "Function A" | ||
- set i 0 | ||
- while {$i < 100000} { | ||
- set i [expr $i + 1] | ||
- } | ||
- func_b | ||
-} | ||
- | ||
-func_a |
@@ -1,3 +0,0 @@ | ||
-Cpu - CPU based analysis | ||
- | ||
- This would include activity by CPU. |
@@ -1,66 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * cputypes.d - list CPU type info. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * $Id: cputypes.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: cputypes.d | ||
- * | ||
- * FIELDS: | ||
- * CPU CPU ID | ||
- * CHIP chip ID | ||
- * PSET processor set ID | ||
- * LGRP latency group ID | ||
- * CLOCK clock speed, MHz | ||
- * TYPE CPU type | ||
- * FPU floating point identifier types | ||
- * | ||
- * SEE ALSO: psrinfo(1M) | ||
- * /usr/include/sys | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 27-Jun-2005 Brendan Gregg Created this. | ||
- * 27-Jun-2005 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
-#pragma D option bufsize=64k | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("%4s %4s %4s %4s %6s %-16s %s\n", | ||
- "CPU", "CHIP", "PSET", "LGRP", "CLOCK", "TYPE", "FPU"); | ||
- done[0] = 0; | ||
-} | ||
- | ||
-profile:::profi | ||
-/done[cpu] == 0/ | ||
-{ | ||
- printf("%4d %4d %4d %4d %6d %-16s %s\n", | ||
- cpu, curcpu->cpu_chip | ||
- curcpu->cpu_lgrp | ||
- stringof(curcpu- | ||
- stringof(curcpu- | ||
- done[cpu]++; | ||
-} | ||
- | ||
-profile:::tick- | ||
-{ | ||
- exit(0); | ||
-} |
@@ -1,72 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * cpuwalk.d - Measure which CPUs a process runs on. | ||
- * Written using DTrace (Solaris 10 3/05) | ||
- * | ||
- * This program is for multi-CPU servers, and can help identify if a process | ||
- * is running on multiple CPUs concurrently or not. | ||
- * | ||
- * $Id: cpuwalk.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: cpuwalk.d [duration] | ||
- * eg, | ||
- * cpuwalk.d 10 # sample for 10 seconds | ||
- * cpuwalk.d # sample until Ctrl-C is hit | ||
- * | ||
- * FIELDS: | ||
- * value CPU id | ||
- * count Number of 1000 hz samples on this CPU | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 22-Sep-2005 Brendan Gregg Created this. | ||
- * 14-Feb-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
-#pragma D option defaultargs | ||
- | ||
-inline int MAXCPUID = 1024; | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- $1 ? printf("Sampling | ||
- printf("Sampling | ||
- seconds = 0; | ||
-} | ||
- | ||
-profile:::profi | ||
-/pid/ | ||
-{ | ||
- @sample[pid, execname] = lquantize(cpu, 0, MAXCPUID, 1); | ||
-} | ||
- | ||
-profile:::tick- | ||
-{ | ||
- seconds++; | ||
-} | ||
- | ||
-profile:::tick- | ||
-/seconds == $1/ | ||
-{ | ||
- exit(0); | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- printa("\n PID: %-8d CMD: %s\n%@d", @sample); | ||
-} |
@@ -1,52 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * dispqlen.d - dispatcher queue length by CPU. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * $Id: dispqlen.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: dispqlen.d # hit Ctrl-C to end sample | ||
- * | ||
- * NOTES: The dispatcher queue length is an indication of CPU saturation. | ||
- * It is not an indicatior of utilisation - the CPUs may or may not be | ||
- * utilised when the dispatcher queue reports a length of zero. | ||
- * | ||
- * SEE ALSO: uptime(1M) | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 27-Jun-2005 Brendan Gregg Created this. | ||
- * 14-Feb-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Sampling | ||
-} | ||
- | ||
-profile:::profi | ||
-{ | ||
- @queue[cpu] = | ||
- lquantize(curthr | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- printa(" CPU %d%@d\n", @queue); | ||
-} |
@@ -1,49 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * intbycpu.d - interrupts by CPU. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * $Id: intbycpu.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: intbycpu.d # hit Ctrl-C to end sample | ||
- * | ||
- * FIELDS: | ||
- * CPU CPU number | ||
- * INTERRUPTS number of interrupts in sample | ||
- * | ||
- * This is based on a DTrace OneLiner from the DTraceToolkit. | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 15-May-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-sdt:::interrupt | ||
- | ||
-dtrace:::END | ||
-{ | ||
- printf("%-16s %16s\n", "CPU", "INTERRUPTS"); | ||
- printa("%-16d %@16d\n", @num); | ||
-} |
@@ -1,66 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * intoncpu.d - print interrupt on-cpu usage. | ||
- * Written using DTrace (Solaris 10 3/05) | ||
- * | ||
- * $Id: intoncpu.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: intoncpu.d # wait several seconds, then hit Ctrl-C | ||
- * | ||
- * FIELDS: | ||
- * value Time interrupt thread was on-cpu, ns | ||
- * count Number of occurrences of at least this time | ||
- * | ||
- * BASED ON: /usr/demo/dtrace | ||
- * | ||
- * SEE ALSO: DTrace Guide "sdt Provider" chapter (docs.sun.com) | ||
- * intrstat(1M) | ||
- * | ||
- * PORTIONS: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 09-May-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-sdt:::interrupt | ||
-{ | ||
- self->ts = vtimestamp; | ||
-} | ||
- | ||
-sdt:::interrupt | ||
-/self->ts && arg0 != 0/ | ||
-{ | ||
- this->devi = (struct dev_info *)arg0; | ||
- /* this checks the pointer is valid, */ | ||
- self->name = this->devi != 0 ? | ||
- stringof(`devnam | ||
- this->inst = this->devi != 0 ? this->devi->devi | ||
- @Time[self->name | ||
- self->name = 0; | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- printa("%s%d\n%@ | ||
-} |
@@ -1,73 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * inttimes.d - print interrupt on-cpu time. | ||
- * Written using DTrace (Solaris 10 3/05) | ||
- * | ||
- * $Id: inttimes.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: inttimes.d # wait several seconds, then hit Ctrl-C | ||
- * | ||
- * FIELDS: | ||
- * DEVICE instance name of device driver | ||
- * TIME (ns) sum of time spent servicing interrupt (ns) | ||
- * | ||
- * BASED ON: /usr/demo/dtrace | ||
- * | ||
- * SEE ALSO: | ||
- * DTrace Guide "sdt Provider" chapter (docs.sun.com) | ||
- * intrstat(1M) | ||
- * | ||
- * PORTIONS: Copyright (c) 2005 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 28-Jun-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-sdt:::interrupt | ||
-{ | ||
- self->ts = vtimestamp; | ||
-} | ||
- | ||
-sdt:::interrupt | ||
-/self->ts && arg0 != 0/ | ||
-{ | ||
- this->devi = (struct dev_info *)arg0; | ||
- /* this checks the pointer is valid, */ | ||
- self->name = this->devi != 0 ? | ||
- stringof(`devnam | ||
- this->inst = this->devi != 0 ? this->devi->devi | ||
- @num[self->name, | ||
- self->name = 0; | ||
-} | ||
- | ||
-sdt:::interrupt | ||
-{ | ||
- self->ts = 0; | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- printf("%11s %16s\n", "DEVICE", "TIME (ns)"); | ||
- printa("%10s%-3d | ||
-} |
@@ -1,58 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * loads.d - print load averages. Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * These are the same load averages that the "uptime" command prints. | ||
- * The purpose of this script is to demonstrate fetching these values | ||
- * from the DTrace language. | ||
- * | ||
- * $Id: loads.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: loads.d | ||
- * | ||
- * SEE ALSO: uptime(1) | ||
- * | ||
- * The first field is the 1 minute average, the second is the 5 minute, | ||
- * and the third is the 15 minute average. The value represents the average | ||
- * number of runnable threads in the system, a value higher than your | ||
- * CPU (core/hwthread) count may be a sign of CPU saturation. | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 10-Jun-2005 Brendan Gregg Created this. | ||
- * 10-Jun-2005 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- /* fetch load averages */ | ||
- this->load1a = `hp_avenrun[0] / 65536; | ||
- this->load5a = `hp_avenrun[1] / 65536; | ||
- this->load15a = `hp_avenrun[2] / 65536; | ||
- this->load1b = ((`hp_avenrun[0] | ||
- this->load5b = ((`hp_avenrun[1] | ||
- this->load15b = ((`hp_avenrun[2] | ||
- | ||
- /* print load average */ | ||
- printf("%Y, load average: %d.%02d, %d.%02d, %d.%02d\n", | ||
- walltimestamp, this->load1a, this->load1b, this->load5a, | ||
- this->load5b, this->load15a, this->load15b); | ||
- | ||
- exit(0); | ||
-} |
@@ -1,56 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * runocc.d - run queue occupancy by CPU. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * This prints the dispatcher run queue occupancy by CPU each second. | ||
- * A consistant run queue occupancy is a sign of CPU saturation. | ||
- * | ||
- * The value is similar to that seen in "sar -q", however this is | ||
- * calculated in a more accurate manner - sampling at 1000 Hertz. | ||
- * | ||
- * $Id: runocc.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: runocc.d | ||
- * | ||
- * FIELDS: | ||
- * CPU cpu ID | ||
- * %runocc % run queue occupancy, sampled at 1000 Hertz | ||
- * | ||
- * SEE ALSO: Solaris Internals 2nd Ed, vol 2, CPU chapter. | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 02-Mar-2006 Brendan Gregg Created this. | ||
- * 24-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-profile-1000hz | ||
-/curthread->t_c | ||
-{ | ||
- @qocc[cpu] = count(); | ||
-} | ||
- | ||
-profile:::tick- | ||
-{ | ||
- normalize(@qocc, | ||
- printf("\n%8s %8s\n", "CPU", "%runocc"); | ||
- printa("%8d %@8d\n", @qocc); | ||
- clear(@qocc); | ||
-} |
@@ -1,51 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * xcallsbypid.d - CPU cross calls by PID. | ||
- * Writen using DTrace (Solaris 10 3/05). | ||
- * | ||
- * $Id: xcallsbypid.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: xcallsbypid.d # hit Ctrl-C to end sample | ||
- * | ||
- * FIELDS: | ||
- * PID process ID | ||
- * CMD process name | ||
- * XCALLS number of cross calls | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 17-Sep-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-sysinfo:::xcall | ||
-{ | ||
- @num[pid, execname] = count(); | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- printf("%6s %-16s %16s\n", "PID", "CMD", "XCALLS"); | ||
- printa("%6d %-16s %@16d\n", @num); | ||
-} |
@@ -1,3 +0,0 @@ | ||
-Disk - Disk based analysis | ||
- | ||
- These are scripts that analyse I/O activity that has made it to the disks. |
@@ -1,81 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * bitesize.d - analyse disk I/O size by process. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * This produces a report for the size of disk events caused by | ||
- * processes. These are the disk events sent by the block I/O driver. | ||
- * | ||
- * If applications must use the disks, we generally prefer they do so | ||
- * with large I/O sizes. | ||
- * | ||
- * $Id: bitesize.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: bitesize.d # wait several seconds, then hit Ctrl-C | ||
- * | ||
- * FIELDS: | ||
- * PID process ID | ||
- * CMD command and argument list | ||
- * value size in bytes | ||
- * count number of I/O operations | ||
- * | ||
- * NOTES: | ||
- * | ||
- * The application may be requesting smaller sized operations, which | ||
- * are being rounded up to the nearest sector size or UFS block size. | ||
- * To analyse what the application is requesting, DTraceToolkit programs | ||
- * such as Proc/fddist may help. | ||
- * | ||
- * SEE ALSO: seeksize.d, iosnoop | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 31-Mar-2004 Brendan Gregg Created this, build 51. | ||
- * 10-Oct-2004 " " Rewrote to use the io provider, build 63. | ||
- * 18-Feb-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-/* | ||
- * Print header | ||
- */ | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-/* | ||
- * Process io start | ||
- */ | ||
-io:::start | ||
-{ | ||
- /* fetch details */ | ||
- this->size = args[0]->b_bcoun | ||
- | ||
- /* store details */ | ||
- @Size[pid, curpsinfo->pr_ps | ||
-} | ||
- | ||
-/* | ||
- * Print final report | ||
- */ | ||
-dtrace:::END | ||
-{ | ||
- printf("\n%8s %s\n", "PID", "CMD"); | ||
- printa("%8d %S\n%@d\n", @Size); | ||
-} |
@@ -1,113 +0,0 @@ | ||
-#!/usr/bin/ksh | ||
-# | ||
-# diskhits - disk access by file offset. | ||
-# Written using DTrace (Solaris 10 3/05). | ||
-# | ||
-# $Id: diskhits 3 2007-08-01 10:50:08Z brendan $ | ||
-# | ||
-# This prints how a file was accessed, the locations on a distribution plot. | ||
-# This is for the cache misses only - the file activity that resulted in | ||
-# disk events. | ||
-# | ||
-# USAGE: diskhits pathname | ||
-# eg, | ||
-# diskhits /var/adm/message | ||
-# | ||
-# FIELDS: | ||
-# Location (KB) The file offset of the disk activity, Kbytes. | ||
-# Size (KB) Size of the disk activity, Kbytes. | ||
-# Total RW Total disk activity, reads + writes. | ||
-# | ||
-# BASED ON: /usr/demo/dtrace | ||
-# | ||
-# SEE ALSO: DTrace Guide "io Provider" chapter (docs.sun.com) | ||
-# iosnoop (DTraceToolkit) | ||
-# | ||
-# PORTIONS: Copyright (c) 2005, 2006 Brendan Gregg. | ||
-# | ||
-# CDDL HEADER START | ||
-# | ||
-# The contents of this file are subject to the terms of the | ||
-# Common Development and Distribution License, Version 1.0 only | ||
-# (the "License"). You may not use this file except in compliance | ||
-# with the License. | ||
-# | ||
-# You can obtain a copy of the license at Docs/cddl1.txt | ||
-# or http://www.opens | ||
-# See the License for the specific language governing permissions | ||
-# and limitations under the License. | ||
-# | ||
-# CDDL HEADER END | ||
-# | ||
-# 08-Jun-2005 Brendan Gregg Created this. | ||
-# 20-Apr-2006 " " Last update. | ||
-# | ||
- | ||
-### Usage | ||
-function usage | ||
-{ | ||
- cat <<-END >&2 | ||
- USAGE: diskhits pathname | ||
- eg, | ||
- diskhits /var/adm/wtmpx | ||
- END | ||
- exit 1 | ||
-} | ||
- | ||
-### Process arguments | ||
-if (( $# != 1 )); then | ||
- usage | ||
-fi | ||
-if [[ $1 == "-h" ]]; then | ||
- usage | ||
-fi | ||
-pathname=$1 | ||
-if [[ ! -e $pathname ]]; then | ||
- print "ERROR2: file $pathname not found" >&2 | ||
- exit 2 | ||
-fi | ||
- | ||
-### Calculate output scale | ||
-report_lines=20 | ||
-set -- `ls -l $pathname` | ||
-filesize=$5 | ||
-(( file_kb_max = filesize / 1024 )) | ||
-(( scale_kb = filesize / (1024 * report_lines) )) | ||
-if (( file_kb_max < 20 )); then file_kb_max=20; fi | ||
-if (( scale_kb < 1 )); then scale_kb=1; fi | ||
- | ||
-# | ||
-# Run DTrace | ||
-# | ||
-/usr/sbin/dtrac | ||
- #pragma D option quiet | ||
- | ||
- inline string PATHNAME = "'$pathname'"; | ||
- inline int FILE_KB_MAX = '$file_kb_max'; | ||
- inline int SCALE_KB = '$scale_kb'; | ||
- | ||
- dtrace:::BEGIN | ||
- { | ||
- printf("Tracing. | ||
- } | ||
- | ||
- io:::start | ||
- /args[2]->fi_pat | ||
- { | ||
- this->kb = args[2]->fi_offs | ||
- @Location = lquantize(this-> | ||
- @Size = quantize(args[0] | ||
- @Total = sum(args[0]->b_b | ||
- } | ||
- | ||
- dtrace:::END | ||
- { | ||
- printf("Location | ||
- printa(@Location | ||
- | ||
- printf("Size (KB),"); | ||
- printa(@Size); | ||
- | ||
- printa("Total RW: %@d KB\n", @Total); | ||
- } | ||
-' |
@@ -1,71 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * hotspot.d - plot disk event by location, look for hotspots. | ||
- * Written in DTrace (Solaris 10 3/05). | ||
- * | ||
- * This simple DTrace script determines if disk activity is occuring in | ||
- * the one place - a "hotspot". This helps us understand the system's usage | ||
- * of a disk, it does not imply that the existance or not of a hotspot is | ||
- * good or bad (often may be good, less seeking). | ||
- * | ||
- * $Id: hotspot.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: hotspot.d # hit Ctrl-C to end | ||
- * | ||
- * FIELDS: | ||
- * Disk disk instance name | ||
- * Major driver major number | ||
- * Minor driver minor number | ||
- * value location, by megabyte | ||
- * count number of I/O operations | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 07-May-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-inline int DISK_MB_MAX = 1000000; /* max size of a single disk */ | ||
-inline int REPORT_SCALE_MB = 1000; /* output step size for report */ | ||
- | ||
-/* | ||
- * Print header | ||
- */ | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-/* | ||
- * Process disk event | ||
- */ | ||
-io:::start | ||
-{ | ||
- this->mb = args[0]->b_blkno | ||
- @Block[args[1]-> | ||
- lquantize(this-> | ||
-} | ||
- | ||
-/* | ||
- * Print final report | ||
- */ | ||
-dtrace:::END | ||
-{ | ||
- printa("Disk: %s Major,Minor: %d,%d\n%@d\n", @Block); | ||
-} |
@@ -1,79 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * iofile.d - I/O wait time by filename and process. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * This prints the total I/O wait times for each filename by process. | ||
- * This can help determine why an application is performing poorly by | ||
- * identifying which file they are waiting on, and the total times. | ||
- * Both disk and NFS I/O are measured. | ||
- * | ||
- * $Id: iofile.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: iofile.d # wait, then hit Ctrl-C to end | ||
- * | ||
- * FIELDS: | ||
- * PID Process ID | ||
- * CMD Process name | ||
- * TIME Total wait time for disk events, us | ||
- * FILE File pathname | ||
- * | ||
- * BASED ON: /usr/demo/dtrace | ||
- * | ||
- * SEE ALSO: iosnoop, iotop | ||
- * | ||
- * PORTIONS: Copyright (c) 2005, 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 24-Jul-2005 Brendan Gregg Created this. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-/* print header */ | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-/* save time at start */ | ||
-io:::wait-start | ||
-{ | ||
- self->start = timestamp; | ||
-} | ||
- | ||
-/* process event */ | ||
-io:::wait-done | ||
-/self->start/ | ||
-{ | ||
- /* | ||
- * wait-done is used as we are measing wait times. It also | ||
- * is triggered when the correct thread is on the CPU, obviating | ||
- * the need to link process details to the start event. | ||
- */ | ||
- this->elapsed = timestamp - self->start; | ||
- @files[pid, execname, args[2]->fi_path | ||
- self->start = 0; | ||
-} | ||
- | ||
-/* print report */ | ||
-dtrace:::END | ||
-{ | ||
- normalize(@files | ||
- printf("%6s %-12s %8s %s\n", "PID", "CMD", "TIME", "FILE"); | ||
- printa("%6d %-12.12s %@8d %s\n", @files); | ||
-} |
@@ -1,59 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * iofileb.d - I/O bytes by filename and process. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * This prints a summary of requested disk activity by pathname, | ||
- * providing totals of the I/O events in bytes. It is a companion to the | ||
- * iofile.d script - which prints in terms of I/O wait time, not bytes. | ||
- * I/O wait time is a better metric for understanding performance issues. | ||
- * Both disk and NFS I/O are measured. | ||
- * | ||
- * $Id: iofileb.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: iofileb.d # wait several seconds, then hit Ctrl-C | ||
- * | ||
- * FIELDS: | ||
- * PID process ID | ||
- * CMD command name | ||
- * KB Kilobytes of disk I/O | ||
- * FILE Full pathname of the file | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 20-Feb-2006 Brendan Gregg Created this. | ||
- * 20-Feb-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-io:::start | ||
-{ | ||
- @files[pid, execname, args[2]->fi_path | ||
-} | ||
- | ||
-dtrace:::END | ||
-{ | ||
- normalize(@files | ||
- printf("%6s %-12s %6s %s\n", "PID", "CMD", "KB", "FILE"); | ||
- printa("%6d %-12.12s %@6d %s\n", @files); | ||
-} |
@@ -1,261 +0,0 @@ | ||
-#!/usr/bin/ksh | ||
-# | ||
-# iopending - Print a plot for the number of pending disk I/O events. | ||
-# Written using DTrace (Solaris 10 3/05). | ||
-# | ||
-# This is measuring disk events that have made it past system caches. | ||
-# By plotting a distribution graph of the number of pending events, the | ||
-# "serialness" or "parallelness" of disk behaviour can be distinguished. | ||
-# | ||
-# $Id: iopending 3 2007-08-01 10:50:08Z brendan $ | ||
-# | ||
-# USAGE: iopending [-c] [-d device] [-f filename] | ||
-# [-m mount_point] [interval [count]] | ||
-# | ||
-# -c # clear the screen | ||
-# -d device # instance name to snoop (eg, dad0) | ||
-# -f filename # full pathname of file to snoop | ||
-# -m mount_point # this FS only (will skip raw events) | ||
-# eg, | ||
-# iopending # default output, 5 second intervals | ||
-# iopending 1 # 1 second samples | ||
-# iopending -c # clear the screen | ||
-# iopending 5 12 # print 12 x 5 second samples | ||
-# | ||
-# FIELDS: | ||
-# value number of pending events, 0 == idle | ||
-# count number of samples @ 1000 Hz | ||
-# load 1 min load average | ||
-# disk_r total disk read Kbytes for sample | ||
-# disk_w total disk write Kbytes for sample | ||
-# | ||
-# SEE ALSO: iosnoop, iotop | ||
-# | ||
-# IDEA: Dr Rex di Bona (Sydney, Australia) | ||
-# | ||
-# COPYRIGHT: Copyright (c) 2005, 2006 Brendan Gregg. | ||
-# | ||
-# CDDL HEADER START | ||
-# | ||
-# The contents of this file are subject to the terms of the | ||
-# Common Development and Distribution License, Version 1.0 only | ||
-# (the "License"). You may not use this file except in compliance | ||
-# with the License. | ||
-# | ||
-# You can obtain a copy of the license at Docs/cddl1.txt | ||
-# or http://www.opens | ||
-# See the License for the specific language governing permissions | ||
-# and limitations under the License. | ||
-# | ||
-# CDDL HEADER END | ||
-# | ||
-# Author: Brendan Gregg [Sydney, Australia] | ||
-# | ||
-# 01-Nov-2005 Brendan Gregg Created this. | ||
-# 20-Apr-2006 " " Last update. | ||
-# | ||
- | ||
- | ||
-############### | ||
-# --- Process Arguments --- | ||
-# | ||
- | ||
-### default variables | ||
-opt_device=0; opt_file=0; opt_mount=0; opt_clear=0; | ||
-opt_def=1; filter=0; device=.; filename=.; mount=. | ||
-interval=5; count=-1 | ||
- | ||
-### process options | ||
-while getopts cd:f:hm: name | ||
-do | ||
- case $name in | ||
- c) opt_clear=1 ;; | ||
- d) opt_device=1; device=$OPTARG ;; | ||
- f) opt_file=1; filename=$OPTARG | ||
- m) opt_mount=1; mount=$OPTARG ;; | ||
- h|?) cat <<-END >&2 | ||
- USAGE: iopending [-c] [-d device] [-f filename] | ||
- [-m mount_point] [interval [count]] | ||
- | ||
- -c # clear the screen | ||
- -d device # instance name to snoop | ||
- -f filename # snoop this file only | ||
- -m mount_point # this FS only | ||
- eg, | ||
- iopending # default output, 5 second samples | ||
- iopending 1 # 1 second samples | ||
- iopending -m / # snoop events on filesystem / only | ||
- iopending 5 12 # print 12 x 5 second samples | ||
- END | ||
- exit 1 | ||
- esac | ||
-done | ||
- | ||
-shift $(( $OPTIND - 1 )) | ||
- | ||
-### option logic | ||
-if [[ "$1" > 0 ]]; then | ||
- interval=$1; shift | ||
-fi | ||
-if [[ "$1" > 0 ]]; then | ||
- count=$1; shift | ||
-fi | ||
-if (( opt_device || opt_mount || opt_file )); then | ||
- filter=1 | ||
-fi | ||
-if (( opt_clear )); then | ||
- clearstr=`clear` | ||
-else | ||
- clearstr=. | ||
-fi | ||
- | ||
- | ||
- | ||
-############### | ||
-# --- Main Program, DTrace --- | ||
-# | ||
-/usr/sbin/dtrac | ||
- /* | ||
- * Command line arguments | ||
- */ | ||
- inline int OPT_def = '$opt_def'; | ||
- inline int OPT_clear = '$opt_clear'; | ||
- inline int OPT_device = '$opt_device'; | ||
- inline int OPT_mount = '$opt_mount'; | ||
- inline int OPT_file = '$opt_file'; | ||
- inline int INTERVAL = '$interval'; | ||
- inline int COUNTER = '$count'; | ||
- inline int FILTER = '$filter'; | ||
- inline string DEVICE = "'$device'"; | ||
- inline string FILENAME = "'$filename'"; | ||
- inline string MOUNT = "'$mount'"; | ||
- inline string CLEAR = "'$clearstr'"; | ||
- | ||
- inline int MAX_PENDING = 32; /* max pending value */ | ||
- | ||
- #pragma D option quiet | ||
- | ||
- /* | ||
- * Print header | ||
- */ | ||
- dtrace:::BEGIN | ||
- { | ||
- /* starting values */ | ||
- counts = COUNTER; | ||
- secs = INTERVAL; | ||
- disk_r = 0; | ||
- disk_w = 0; | ||
- pending = 0; | ||
- | ||
- printf("Tracing. | ||
- } | ||
- | ||
- /* | ||
- * Check event is being traced | ||
- */ | ||
- io:genunix::star | ||
- io:genunix::done | ||
- { | ||
- /* default is to trace unless filtering, */ | ||
- this->ok = FILTER ? 0 : 1; | ||
- | ||
- /* check each filter, */ | ||
- (OPT_device == 1 && DEVICE == args[1]->dev_sta | ||
- (OPT_file == 1 && FILENAME == args[2]->fi_path | ||
- (OPT_mount == 1 && MOUNT == args[2]->fi_moun | ||
- } | ||
- | ||
- /* | ||
- * Store entry details | ||
- */ | ||
- io:genunix::star | ||
- /this->ok/ | ||
- { | ||
- /* track bytes */ | ||
- disk_r += args[0]->b_flags | ||
- disk_w += args[0]->b_flags | ||
- | ||
- /* increase event pending count */ | ||
- pending++; | ||
- } | ||
- | ||
- /* | ||
- * Process and Print completion | ||
- */ | ||
- io:genunix::done | ||
- /this->ok/ | ||
- { | ||
- /* decrease event pending count */ | ||
- pending--; | ||
- } | ||
- | ||
- /* | ||
- * Prevent pending from underflowing | ||
- * this can happen if this program is started during disk events. | ||
- */ | ||
- io:genunix::done | ||
- /pending < 0/ | ||
- { | ||
- pending = 0; | ||
- } | ||
- | ||
- /* | ||
- * Timer | ||
- */ | ||
- profile:::tick-1 | ||
- { | ||
- secs--; | ||
- } | ||
- | ||
- profile:::profil | ||
- { | ||
- @out = lquantize(pendin | ||
- } | ||
- | ||
- /* | ||
- * Print Report | ||
- */ | ||
- profile:::tick-1 | ||
- /secs == 0/ | ||
- { | ||
- /* fetch 1 min load average */ | ||
- this->load1a = `hp_avenrun[0] / 65536; | ||
- this->load1b = ((`hp_avenrun[0] | ||
- | ||
- /* convert counters to Kbytes */ | ||
- disk_r /= 1024; | ||
- disk_w /= 1024; | ||
- | ||
- /* print status */ | ||
- OPT_clear ? printf("%s", CLEAR) : 1; | ||
- printf("%Y, load: %d.%02d, disk_r: %6d KB, disk_w: %6d KB", | ||
- walltimestamp, this->load1a, this->load1b, disk_r, disk_w); | ||
- | ||
- /* print output */ | ||
- printa(@out); | ||
- | ||
- /* clear data */ | ||
- trunc(@out); | ||
- disk_r = 0; | ||
- disk_w = 0; | ||
- secs = INTERVAL; | ||
- counts--; | ||
- } | ||
- | ||
- /* | ||
- * End of program | ||
- */ | ||
- profile:::tick-1 | ||
- /counts == 0/ | ||
- { | ||
- exit(0); | ||
- } | ||
- | ||
- /* | ||
- * Cleanup for Ctrl-C | ||
- */ | ||
- dtrace:::END | ||
- { | ||
- trunc(@out); | ||
- } | ||
-' |
@@ -1,85 +0,0 @@ | ||
-#!/usr/sbin/dtr | ||
-/* | ||
- * seeksize.d - analyse disk head seek distance by process. | ||
- * Written using DTrace (Solaris 10 3/05). | ||
- * | ||
- * Disk I/O events caused by processes will in turn cause the disk heads | ||
- * to seek. This program analyses those seeks, so that we can determine | ||
- * if processes are causing the disks to seek in a "random" or "sequential" | ||
- * manner. | ||
- * | ||
- * $Id: seeksize.d 3 2007-08-01 10:50:08Z brendan $ | ||
- * | ||
- * USAGE: seeksize.d # wait several seconds, then hit Ctrl-C | ||
- * | ||
- * FIELDS: | ||
- * PID process ID | ||
- * CMD command and argument list | ||
- * value distance in disk blocks (sectors) | ||
- * count number of I/O operations | ||
- * | ||
- * SEE ALSO: bitesize.d, iosnoop | ||
- * | ||
- * COPYRIGHT: Copyright (c) 2006 Brendan Gregg. | ||
- * | ||
- * CDDL HEADER START | ||
- * | ||
- * The contents of this file are subject to the terms of the | ||
- * Common Development and Distribution License, Version 1.0 only | ||
- * (the "License"). You may not use this file except in compliance | ||
- * with the License. | ||
- * | ||
- * You can obtain a copy of the license at Docs/cddl1.txt | ||
- * or http://www.opens | ||
- * See the License for the specific language governing permissions | ||
- * and limitations under the License. | ||
- * | ||
- * CDDL HEADER END | ||
- * | ||
- * 11-Sep-2004 Brendan Gregg Created this. | ||
- * 10-Oct-2004 " " Rewrote to use the io provider. | ||
- * 20-Apr-2006 " " Last update. | ||
- */ | ||
- | ||
-#pragma D option quiet | ||
- | ||
-/* | ||
- * Print header | ||
- */ | ||
-dtrace:::BEGIN | ||
-{ | ||
- printf("Tracing. | ||
-} | ||
- | ||
-self int last[dev_t]; | ||
- | ||
-/* | ||
- * Process io start | ||
- */ | ||
-io:genunix::sta | ||
-/self->last[arg | ||
-{ | ||
- /* calculate seek distance */ | ||
- this->last = self->last[args[ | ||
- this->dist = (int)(args[0]->b | ||
- args[0]->b_blkno | ||
- | ||
- /* store details */ | ||
- @Size[pid, curpsinfo->pr_ps | ||
-} | ||
- | ||
-io:genunix::sta | ||
-{ | ||
- /* save last position of disk head */ | ||
- self->last[args[ | ||
- args[0]->b_bcoun | ||
-} | ||
- | ||
-/* | ||
- * Print final report | ||
- */ | ||
-dtrace:::END | ||
-{ | ||
- printf("\n%8s %s\n", "PID", "CMD"); | ||
- printa("%8d %S\n%@d\n", @Size); | ||
-} |
@@ -1,152 +0,0 @@ | ||
-Contents - Command Summary | ||
- | ||
- The following is a list of commands found in the DTraceToolkit, along | ||
- with their directory location. | ||
- | ||
-Generally commands that end in a ".d" are DTrace scripts, and commands | ||
-that don't are DTrace scripts wrapped in another language (eg, shell | ||
-or Perl). See the Docs/Readme for instructions for finding their docs. | ||
- | ||
-DTraceToolkit/ | ||
- dexplorer run a series of scripts and archive output | ||
- dtruss process syscall info. DTrace truss | ||
- dvmstat vmstat by PID/name/command | ||
- errinfo report syscall failures with details | ||
- execsnoop snoop process execution as it occurs | ||
- iosnoop snoop I/O events as they occur | ||
- iopattern print disk I/O pattern | ||
- iotop display top disk I/O events by process | ||
- opensnoop snoop file opens as they occur | ||
- procsystime analyse process system call times | ||
- rwsnoop snoop read/write events | ||
- rwtop display top read/write bytes by process | ||
- statsnoop snoop file stats as they occur | ||
- Apps/ | ||
- httpdstat.d realtime httpd statistics | ||
- nfswizard.d NFS client activity wizard | ||
- shellsnoop snoop live shell activity | ||
- weblatency.d website latency statistics | ||
- Cpu/ | ||
- cputypes.d list CPU types | ||
- cpuwalk.d measure which CPUs a process runs on | ||
- dispqlen.d dispatcher queue length by CPU | ||
- intbycpu.d interrupts by CPU | ||
- intoncpu.d interrput on-cpu usage | ||
- inttimes.d interrput on-cpu time total | ||
- loads.d print load averages | ||
- runocc.d run queue occupancy by CPU | ||
- xcallsbypid.d CPU cross calls by PID | ||
- Disk/ | ||
- bitesize.d print disk event size report | ||
- diskhits disk access by file offset | ||
- hotspot.d print disk event by location | ||
- iofile.d I/O wait time by filename and process | ||
- iofileb.d I/O bytes by filename and process | ||
- iopending plot number of pending disk events | ||
- pathopens.d pathnames successfully opened count | ||
- seeksize.d print disk seek size report | ||
- Docs/ | ||
- oneliners.txt DTrace oneliners | ||
- FS/ | ||
- fsrw.d file system read/write event tracing | ||
- fspaging.d file system read/write and paging tracing | ||
- rfsio.d read FS I/O stats, with cache miss rate | ||
- rfileio.d read file I/O stats, with cache miss rate | ||
- vopstat vnode interface statistics | ||
- Java/ | ||
- j_*.d 18 scripts for tracing Java using the hotspot provider | ||
- JavaScript/ | ||
- js_*.d 14 scripts for JavaScript with the Mozilla provider | ||
- Kernel/ | ||
- cputimes print time by Kernel/Idle/Proc | ||
- cpudists time distribution by Kernel/Idle/Proc | ||
- cswstat.d context switch time statistics | ||
- dnlcps.d DNLC stats by process | ||
- dnlcsnoop.d snoop DNLC activity | ||
- dnlcstat DNLC statistics | ||
- kstat_types.d trace kstat reads with type info | ||
- modcalls.d kernel function calls by module name | ||
- priclass.d priority distribution by scheduling class | ||
- pridist.d process priority distribution | ||
- putnexts.d trace who is putting to which streams module | ||
- whatexec.d examine the type of files executed | ||
- Locks/ | ||
- lockbyproc.d lock time by process name | ||
- lockbydist.d lock time distribution by process name | ||
- Mem/ | ||
- anonpgpid.d anonymous memory paging info by PID on CPU | ||
- minfbypid.d minor faults by PID | ||
- minfbyproc.d minor faults by process name | ||
- pgpginbypid.d pages paged in by PID | ||
- pgpginbyproc.d pages paged in by process name | ||
- swapinfo.d print virtual memory info | ||
- vmbypid.d virtual memory stats by PID | ||
- vmstat.d vmstat demo using DTrace | ||
- vmstat-p.d vmstat -p demo using DTrace | ||
- xvmstat extended vmstat demo using DTrace | ||
- Misc/ | ||
- guess.d guessing game | ||
- wpm.d words per minute tracing | ||
- woof.d audio alert for new processes | ||
- Net/ | ||
- connections print inbound TCP connections by process | ||
- icmpstat.d print ICMP statistics | ||
- tcpsnoop snoop TCP network packets by process, Solaris 10 3/05 | ||
- tcpsnoop_snv snoop TCP network packets by process, Solaris Nevada | ||
- tcpsnoop.d snoop TCP network packets by process, Solaris 10 3/05 | ||
- tcpsnoop_snv.d snoop TCP network packets by process, Solaris Nevada | ||
- tcpstat.d print TCP statistics | ||
- tcptop display top TCP network packets by PID, Solaris 10 3/05 | ||
- tcptop_snv display top TCP network packets by PID, Solaris Nevada | ||
- tcpwdist.d simple TCP write distribution by process | ||
- udpstat.d print UDP statistics | ||
- Perl/ | ||
- pl_*.d 12 scripts for tracing Perl | ||
- Php/ | ||
- php_*.d 12 scripts for tracing Php | ||
- Proc/ | ||
- crash.d crashed application report | ||
- creatbyproc.d snoop file creat() by process name | ||
- dappprof profile user and lib function usage | ||
- dapptrace trace user and lib function usage | ||
- fddist file descriptor usage distribution | ||
- fileproc.d snoop files opened by process | ||
- kill.d snoop process signals | ||
- lastwords print syscalls before exit | ||
- mmapfiles.d mmap'd files by process | ||
- newproc.d snoop new processes | ||
- pfilestat show I/O latency break down by FD | ||
- pidpersec.d print new PIDs per sec | ||
- readbytes.d read bytes by process name | ||
- readdist.d read distribution by process name | ||
- rwbbypid.d read/write bytes by PID | ||
- rwbypid.d read/write calls by PID | ||
- rwbytype.d read/write bytes by vnode type | ||
- sampleproc sample processes on the CPUs | ||
- shortlived.d check short lived process time | ||
- sigdist.d signal distribution by process name | ||
- stacksize.d measure stack size for running threads | ||
- sysbypid.d system stats by PID | ||
- syscallbyproc.d system calls by process name | ||
- syscallbypid.d system calls by process ID | ||
- threaded.d sample multi-threaded CPU usage | ||
- topsysproc display top syscalls by process name | ||
- writebytes.d write bytes by process name | ||
- writedist.d write distribution by process name | ||
- Python/ | ||
- py_*.d 14 scripts for tracing Python | ||
- Shell/ | ||
- sh_*.d 15 scripts for tracing the Bourne shell | ||
- System/ | ||
- sar-c.d sar -c demo using DTrace | ||
- syscallbysysc.d system calls by system call | ||
- topsyscall display top system call type | ||
- uname-a.d uname -a demo using DTrace | ||
- Tcl/ | ||
- tcl_*.d 15 scripts for tracing Tcl | ||
- User/ | ||
- setuids.d snoop setuid calls | ||
- Zones/ | ||
- zvmstat vmstat info by zone | ||
- | ||
-Total: 230 scripts |
@@ -1 +0,0 @@ | ||
-../Examples |
@@ -1,126 +0,0 @@ | ||
-Faq - Frequently Asked Questions | ||
- | ||
- The following may serve as a guide to the DTraceToolkit. | ||
- | ||
-16-May-2005, ver 0.30 (first version of the FAQ) | ||
- | ||
-The DTraceToolkit is new, and as such there hasn't been many questions asked. | ||
-This may be better called a "possibly asked questions" :) | ||
- | ||
- | ||
-Questions | ||
- | ||
-1. Intro | ||
-1.1. What is the DTraceToolkit? | ||
-1.2. Who wrote the DTraceToolkit? | ||
-1.3. Where do I get support? | ||
-1.4. Am I now a performance tuning expert? | ||
-1.5. Will this solve all my performance problems? | ||
-1.6. So the DTraceToolkit *is* DTrace? | ||
- | ||
-2. Toolkit | ||
-2.1. What is in it? | ||
-2.2. What performance effect can the DTraceToolkit cause? | ||
- | ||
-3. Contributing | ||
-3.1. Where do I send bugs? | ||
- | ||
- | ||
-Answers | ||
- | ||
-1. Intro | ||
- | ||
-1.1. What is the DTraceToolkit? | ||
- | ||
- The DTraceToolkit is a collection of tools written using DTrace for | ||
- the Solaris 10[tm] OS by Sun Microsystems[tm] | ||
- will also work on OpenSolaris. | ||
- | ||
-1.2. Who wrote the DTraceToolkit? | ||
- | ||
- Volunteers of the DTrace and OpenSolaris community. Check the scripts | ||
- themselves, Docs/Contrib, Docs/Who and Docs/History. | ||
- | ||
-1.3. Where do I get support? | ||
- | ||
- As the DTraceToolkit is a freeware product, there is no official company | ||
- offering support for this. Sun Microsystems does not support this. If you | ||
- post messages to the DTrace forums found in the Docs/Links file, a | ||
- volunteer may help you out. | ||
- | ||
-1.4. Am I now a performance tuning expert? | ||
- | ||
- The DTraceToolkit does not turn people into performance tuning experts in | ||
- the same way that owning a set of golf clubs won't make you a professional | ||
- golfer. Experience and understanding are necessary. The toolkit certainly | ||
- helps by fetching the data in an easy way, and also by providing some | ||
- documentation. So it is valuable, but not magical. | ||
- | ||
-1.5. Will this solve all my performance problems? | ||
- | ||
- This is similar to the previous point; the DTraceToolkit is valuable | ||
- for it's scripts and documentation, but it's no magical product. | ||
- Understanding and experience are necessary. | ||
- | ||
-1.6. So the DTraceToolkit *is* DTrace? | ||
- | ||
- The DTraceToolkit is one use of DTrace, but there is far more to DTrace | ||
- than just the toolkit. DTrace allows people to write their own customised | ||
- scripts to solve a wide number of problems. | ||
- | ||
- Think of the DTraceToolkit as a starting point. Maybe your problem has | ||
- a solution in the kit. Maybe changing one of the toolkit programs slightly | ||
- is what you want. Finally you may need to write your script from scratch. | ||
- | ||
- | ||
-2. Toolkit | ||
- | ||
-2.1. What is in it? | ||
- | ||
- Read the Guide file for a table of contents, and Docs/Contents for a | ||
- list of commands. | ||
- | ||
-2.2. What performance effect can the DTraceToolkit cause? | ||
- | ||
- Enabling DTrace to monitor events has little effect on the system, | ||
- especially when compared to the disruptive behaviour of truss (See | ||
- http://www.brend | ||
- | ||
- It really boils down to how often the events occur that you are monitoring. | ||
- The following numbers have been provided as an approximation: | ||
- | ||
- 1. Fixed rate scripts. For example, dispqlen.d samples at 1000 hz. | ||
- The impact will be negligible, close to 0% CPU. (in testing, 0.1% CPU). | ||
- | ||
- 2. Demand rated scripts. For example, iosnoop probes disk I/O events. | ||
- The impact depends on the rate of events, for many servers the disk | ||
- events would be slow enough for this to be less than 0.2% CPU. | ||
- Scripts such as execsnoop would expect even fewer events, their impact | ||
- would be close to 0.0% CPU. However scripts that monitor potentially | ||
- very rapid events will have a greater impact, for example running | ||
- dapptrace on Xorg (over 6000 lines of output per second) was consuming | ||
- around 10% of a CPU to do so. | ||
- | ||
- 3. Heavy voodoo scripts. A few scripts in the toolkit must probe either | ||
- a ton of different events, or very rapid events, or both. They are | ||
- going to hurt and there is no way around it. Scripts such as cputimes | ||
- and cpudists trace very frequent events, and can chew around 5% of | ||
- the CPUs; scripts such as dapptrace and dappprof trace extreamly | ||
- frequent events, and can chew over 20%. | ||
- | ||
- There is an emphasis in the DTraceToolkit to write demand rated scripts | ||
- that measure the fewest events, such that their impact is close to 0.0% | ||
- CPU usage. Some scripts are fixed rate, which are safer as their impact | ||
- has a known upper bound, and are most suitable to run in production. | ||
- | ||
- There are additional notes in Notes/ALLoverhea | ||
- overheads for running DTrace. | ||
- | ||
- | ||
-3. Contributing | ||
- | ||
-3.1. Where do I send bugs? | ||
- | ||
- The DTraceToolkit maintainer. See the Docs/Maintainer file. | ||
- | ||
- |
@@ -1,249 +0,0 @@ | ||
-History - History of the DTraceToolkit | ||
- | ||
---------------- | ||
-20-Apr-2005 Brendan Gregg Idea | ||
- For a while I had thought that a DTrace toolkit would be a nice | ||
- idea, but on this day it became clear. I was explaining DTrace to | ||
- an SSE from Sun (Canberra, Australia), who had a need for using | ||
- DTrace but didn't have the time to sit down and write all the | ||
- tools he was after. It simply made sense to have a DTrace toolkit | ||
- that people could download or carry around a copy to use. Some | ||
- people would write DTrace tools, others would use the toolkit. | ||
---------------- | ||
-15-May-2005 Brendan Gregg Version 0.30 | ||
- I had discussed the idea of a DTrace toolkit with the Sun PAE guys in | ||
- Adelaide, Australia. It was making more sense now. It would be much | ||
- like the SE Toolkit, not just due to the large number of sample | ||
- scripts provided, but also due to the role it would play: few people | ||
- wrote SE Toolkit programs, more people used it as a toolkit. While | ||
- we would like a majority of Solaris users to write DTrace scripts, | ||
- the reality is that many would want to use a prewritten toolkit. | ||
- Today I created the toolkit as version 0.30, with 11 main directories, | ||
- a dozen scripts, man pages and a structure for documentation. | ||
---------------- | ||
-16-May-2005 Brendan Gregg OneLiners | ||
- I've been using the toolkit for a day now (wow!), and have noticed | ||
- a few problems I've been fixing. One of them was the dtrace oneliners. | ||
- I have them in two files, Docs/oneliners.t | ||
- Docs/Examples/on | ||
- looking for a script, I'm looking in Docs/Commands - a list of the | ||
- seperate script files, or I'm doing an ls or find. Ok, so I've now | ||
- made each one liner a seperate script. This seems at first pretty | ||
- silly since they are oneliners and shouldn't deserve an entire script | ||
- each, but I've found having them as seperate scripts makes them far | ||
- easier to find and use. The scripts and man page for each script do | ||
- point out the fact that it's a one liner. | ||
---------------- | ||
-17-May-2005 Brendan Gregg Version 0.33 | ||
- Version 0.33 with 33 scripts. Maybe I should make the version number | ||
- equal the script count. :) I just finished dtruss, dapptrace and | ||
- dappprof. | ||
---------------- | ||
-08-Jun-2005 Brendan Gregg Name changes. | ||
- I've renamed Docs/Commands to Docs/Contents. I found myself typing | ||
- "more Docs/Contents" by mistake a lot. ok, maybe it made more sense | ||
- to call it Contents after all. I've also made a symlink to it called | ||
- Index. | ||
---------------- | ||
-08-Jun-2005 Brendan Gregg Version 0.35 | ||
- Version 0.35 with 35 scripts. Also touched up procsystime and some | ||
- man pages. Added the CDDL version 1.0. | ||
---------------- | ||
-09-Jun-2005 Brendan Gregg Version 0.42 | ||
- Added 7 more scripts. | ||
---------------- | ||
-14-Jun-2005 Brendan Gregg Version 0.57 | ||
- Added heaps of new scripts. Now at 57 scripts. | ||
---------------- | ||
-17-Jun-2005 Brendan Gregg Version 0.61 | ||
- Restyled many commands. | ||
---------------- | ||
-28-Jun-2005 Brendan Gregg Version 0.70 | ||
- Added several commands including dexplorer. Developed a few useful | ||
- variants of classic scripts while writing dexplorer, and have added | ||
- them to the toolkit (I kept wanting to run them individually but | ||
- not have to run an entire dexplorer). | ||
---------------- | ||
-25-Jul-2005 Brendan Gregg Version 0.77 | ||
- Added tcpsnoop.d, tcpsnoop, tcptop. Because of their addition I have | ||
- dropped tcpwbytes.d and tcpwlist. These are complex scripts, but they | ||
- track TCP in an accurate manner. However! also because they are | ||
- complex scripts, I expect they will require maintainence for newer | ||
- versions of [Open]Solaris, as various probes may change. They will | ||
- become much more stable once a network provider has been added to | ||
- DTrace (which may be some time away). | ||
- Also added iotop, and updated a bunch of scripts. A lot of work went | ||
- into this version, although the version change doesn't reflect that | ||
- (I'm still keeping the version number == to number of scripts). | ||
- Also added rwsnoop, rwtop, and more. | ||
---------------- | ||
-26-Jul-2005 Brendan Gregg Version 0.82 | ||
- Many new scripts added, many updates. This is a major release. | ||
---------------- | ||
-17-Sep-2005 Brendan Gregg Version 0.83 | ||
- A few scripts have been updated so that they work better. | ||
- execsnoop, iosnoop, opensnoop and rwsnoop will be more responsive | ||
- (increased switchrate). | ||
---------------- | ||
-22-Sep-2005 Brendan Gregg Version 0.84 | ||
- Some updates, fixed some bugs (cputimes, cpudists). Added cpuwalk.d. | ||
---------------- | ||
-15-Nov-2005 Brendan Gregg Sys Admin Magazine | ||
- Ryan Matteson wrote an article on the DTraceToolkit which has been | ||
- printed in Sys Admin Magazine, December 2005. It's quite good, | ||
- and made it as the feature article - which means it will be available | ||
- online for some time. Thanks Matty, and Sys Admin Magazine! | ||
- "Observing I/O Behavior with the DTraceToolkit" | ||
- http://www.samag | ||
---------------- | ||
-01-Dec-2005 Brendan Gregg Version 0.88 | ||
- Many scripts were updated. Added the Apps category. I had planned | ||
- to add some key scripts, but they haven't made it out of testing yet. | ||
---------------- | ||
-03-Dec-2005 Brendan Gregg Version 0.89 | ||
- Added nfswisard.d, fixed a minor bug with tcp* tools (see | ||
- dtrace-discuss mailing list). | ||
---------------- | ||
-12-Jan-2006 Brendan Gregg Version 0.92 | ||
- Added a few scripts including rwbytype.d. Fixed several issues. | ||
---------------- | ||
-09-Apr-2006 Brendan Gregg Solaris Internals 2nd Edition | ||
- In the past few months I have been contributing to Solaris Internals | ||
- 2nd Edition. This book (now two volumes) is really amazing. The 2nd | ||
- volume does use the DTraceToolkit where appropriate, and covers loads | ||
- of useful topics. While writing and reviewing material for Solaris | ||
- Internals, I've had numerous new ideas for DTrace scripts. Not only | ||
- that, but a few people have managed to send me well styled, carefully | ||
- tested, well considered DTrace scripts for inclusion in the toolkit. | ||
---------------- | ||
-20-Apr-2006 Brendan Gregg TCP bug fixed | ||
- Stefan Parvu sent me a bug for the tcp* scripts: on build 31+ they | ||
- error'd on the symbol SS_TCP_FAST_ACCE | ||
- renamed to SS_DIRECT (I checked the code, they are used in the | ||
- same way). Ironically, when I first wrote the scripts I had hardcoded | ||
- the value 0x00200000, then rewrote it "properly" by importing | ||
- the header files and using the symbol name. Had I been lazy and left | ||
- it hardcoded, the bug would never have eventuated. Not to worry, | ||
- it has returned to being hardcoded, so that it works on all builds | ||
- (until something else changes). | ||
---------------- | ||
-21-Apr-2006 Brendan Gregg Restyled - again! | ||
- I've been writing the "DTraceToolkit Style Guide", to document | ||
- the style that these scripts obey. It is quite strict, and sets | ||
- the bar fairly high. I've been warned that it may cause very few | ||
- people to ever contribute scripts, which is fine. At some point | ||
- I'll carefully explain the mentality behind this, but in a nutshell: | ||
- Users on critical production servers expect the tools to be | ||
- accurate, carefully tested, and cause no undocumented harm. | ||
---------------- | ||
-22-Apr-2006 Brendan Gregg Docs changes | ||
- The "Contrib" file was merged into the "Who" file. In hindsight | ||
- it is better to keep this data together than to split it up. | ||
---------------- | ||
-24-Apr-2006 Brendan Gregg Version 0.96 | ||
- The toolkit now contains 104 scripts, however I'll keep the version | ||
- number < 1.00 until the dust has settled on these new scripts. | ||
- There is some special significance with version 1.00, it would | ||
- imply that every script had been tested for some time - not that | ||
- I've just added a few. | ||
- There is a new main directory, FS for file system related scripts. | ||
- There are some interesting scripts in there, from or based on | ||
- Solaris Internals 2nd ed, vol 2. | ||
---------------- | ||
-30-Sep-2007 Brendan Gregg Version 0.99 | ||
- It's been a year and a half since the last release, and a lot has | ||
- happneed. Firstly, the DTraceToolkit has featured in the Prentice Hall | ||
- book, | ||
- Solaris Performance and Tools | ||
- DTrace and mdb techniques for Solaris 10 and OpenSolaris | ||
- | ||
- written by Richard McDougall, Jim Mauro and myself. It is a companion | ||
- book to "Solaris Internals 2nd edition" by Richard McDougall and | ||
- Jim Mauro. If you are serious about becomming a DTrace guru, | ||
- especially on Solaris, then please study both books. (Yes, I realize | ||
- that many people are using the DTraceToolkit because they don't have | ||
- the time or don't want to become DTrace gurus; well, so long as | ||
- you are using DTrace anyway :). The performance book was a great relief | ||
- to write - since we were able to put to print much performance wisdom | ||
- and knowledge that was begging to be documented. | ||
- | ||
- Then, in late 2006 I joined an advanced products engineering team | ||
- at Sun in San Francisco, a team which includes the three members of | ||
- team DTrace. It's been a great opportunity to learn from such | ||
- engineers, and to contribute more directly to DTrace. So far my work | ||
- has included writing a JavaScript provider, integrated inet_ntoa() | ||
- style functions into DTrace, and prototying DTrace IP, TCP and UDP | ||
- providers. | ||
- | ||
- Working on the network providers is good news for the DTraceToolkit, | ||
- as it will indirectly help the tcp* scripts become more stable. Yes, | ||
- those scripts have broken a few more times during the last 18 months, | ||
- sorry about that, and it will keep happening until we have stable | ||
- network providers. This is why I only ever wrote three tcp* scripts, | ||
- and not at least a dozen, which I'd really like to do. | ||
- | ||
- I did leave my pile of old SPARC and x86 development servers behind | ||
- in Australia, and brought over a couple of laptops. That has made me | ||
- more dependant on Stefan for testing the toolkit - especially on SPARC. | ||
- | ||
- So, it's been about 18 months since the last release, which is | ||
- mostly due to having less spare time due to moving countries and | ||
- learning a new job. | ||
- | ||
- Michelle from Sun docs has been asking for a newer version of the | ||
- DTraceToolkit for the OpenSolaris starter kit, which is why I'm | ||
- releasing this version now and not waiting a few more weeks as | ||
- I complete bug fixes. | ||
- | ||
- So the good and the bad news for this release, starting with the bad, | ||
- | ||
- Bad: tcpsnoop/tcptop still don't work on some Solaris 10 releases. | ||
- I've added versions that should work on Solaris Nevada and OpenSolaris | ||
- for releases from around late 2007. They are likely to break again. | ||
- The real answer, as always, is for stable nework providers to be | ||
- integrated into Solaris. | ||
- | ||
- Many of the exciting new language provider scripts in this release | ||
- currently require downloading, patching and compling of the language | ||
- interpreter to get working. See the Readme file in each directory | ||
- for pointers. | ||
- | ||
- Good: many more scripts to cover the new DTrace language providers | ||
- that are available (the DTraceToolkit is now 227 scripts). Many | ||
- updates to the Notes directory. Bug fixes. Some new categories | ||
- other than for scripts: Code - for simple programs to DTrace (and | ||
- for the example files), and Snippits - for useful lumps of DTrace | ||
- code to copy-n-paste from. The man pages are also making room | ||
- for documenting both stability and supported operating systems for | ||
- each script - now that DTrace exists for MacOS X Leopard, the | ||
- DTraceToolkit will begin supporting multiple operating systems. | ||
- | ||
- This can be thought of as a developer's release of the DTraceToolkit - | ||
- to help people start using DTrace with Perl, Python, Ruby, Php, Java, | ||
- JavaScript, Shell and Tcl. I've written about 15 scripts for each | ||
- language, to cover the basics and to show the way for deeper analysis. | ||
- The scripts are also similar from one language to another, having | ||
- devoleped a tried-and-tested | ||
- issues - it made sense to repeat these scripts for every language | ||
- possible. To see what I mean, try reading, | ||
- | ||
- Examples/j_cputi | ||
- Examples/js_cput | ||
- Examples/php_cpu | ||
- Examples/pl_cput | ||
- | ||
- You might notice that the example files are more clearly and carefully | ||
- explained. Claire (my wife), wrote close to one hundred of them for | ||
- this release while I focused on writing and testing the scripts. | ||
- Claire has worked as a SysAdmin and as an IT instructor, and is well | ||
- skilled at explaining relavent technical details. And she can spell | ||
- much better than I can. :) | ||
- | ||
- The future: I still have many new scripts and some bug fixes in mind, | ||
- as well as generally improving the Notes and Examples provided. | ||
- Hopefully it won't be too many months before you see another | ||
- release. Check here for the lastest installment, | ||
- | ||
- http://www.opens | ||
---------------- | ||
- |
@@ -1 +0,0 @@ | ||
-Contents |
@@ -1,30 +0,0 @@ | ||
-Links - DTrace links | ||
- | ||
- http://www.opens | ||
- DTraceToolkit Home | ||
- | ||
- http://www.opens | ||
- OpenSolaris DTrace site | ||
- | ||
- http://www.brend | ||
- DTraceToolkit | ||
- DTrace Tools | ||
- | ||
- http://www.sun.c | ||
- DTrace site on BigAdmin | ||
- | ||
- http://docs.sun. | ||
- DTrace Guide (answerbook) | ||
- | ||
- http://blogs.sun | ||
- Bryan Cantrill's Blog (DTrace Team) | ||
- | ||
- http://blogs.sun | ||
- Adam Leventhal's Blog (DTrace Team) | ||
- | ||
- http://blogs.sun | ||
- Mike Shapiro's Blog (DTrace Team) | ||
- | ||
- http://www.solar | ||
- DTrace scripts by Richard McDougall | ||
- |
@@ -1,6 +0,0 @@ | ||
-Maintainer - The DTraceToolkit Author and Maintainer, | ||
- | ||
- Brendan Gregg | ||
- brendan@sun.com (or see website below for emailaddr) | ||
- http://www.brend | ||
- |
@@ -1 +0,0 @@ | ||
-../Notes |
@@ -1,21 +0,0 @@ | ||
-Docs - DTraceToolkit Documentation | ||
- | ||
- Docs/Contents summary of toolkit commands | ||
- Examples examples of command usage | ||
- Notes notes on commands | ||
- | ||
-The following may be followed to learn about a DTraceToolkit command, | ||
- | ||
- 1. read "Contents" for a command name and toolkit location. | ||
- 2. run the command with "-h" to check it's usage. | ||
- 3. read the manpage from Man/man1m. | ||
- 4. read the examples from Examples. | ||
- 5. read the notes from Notes. | ||
- 6. read the script itself | ||
- | ||
-Try the following to discover all docs related to a command, eg iosnoop, | ||
- | ||
- find . | grep iosnoop | ||
- | ||
-best run from the DTraceToolkit root directory. | ||
- |
@@ -1,7 +0,0 @@ | ||
-ToDo - To Do List | ||
- | ||
- The following is a list of todo reminders for the DTraceToolkit. | ||
- | ||
-* Run PHP examples on mediawiki. | ||
- | ||
- |
@@ -1,74 +0,0 @@ | ||
-Who - Who the Contributers are | ||
- | ||
- This is a record of contributors to the DTraceToolkit whose name isn't | ||
- already mentioned (such as in the source of a script). | ||
- | ||
- | ||
-In alphabetical first-name order, | ||
- | ||
-Adam Leventhal | ||
- Location: CA, USA | ||
- Blog: http://blogs.sun | ||
- wrote DTrace itself | ||
- | ||
-Ben Rockwood | ||
- Location: CA, USA | ||
- Website: http://www.cuddl | ||
- first encouraged the idea of DTrace oneliners | ||
- | ||
-Brendan Gregg | ||
- Location: Sydney, Australia | ||
- Website: http://www.brend | ||
- Email: brendan.gregg@tp | ||
- Blog: http://bdgregg.b | ||
- Notes: Also see http://www.brend | ||
- created toolkit, tools, manpages, example docs, notes docs, testing | ||
- | ||
-Bryan Cantrill | ||
- Location: CA, USA | ||
- Blog: http://blogs.sun | ||
- wrote DTrace itself | ||
- | ||
-David Rubio | ||
- technical advice | ||
- | ||
-James Dickens | ||
- Location: WI, USA | ||
- Blog: http://uadmin.bl | ||
- tool ideas and testing | ||
- | ||
-Jonathan Adams | ||
- Blog: http://blogs.sun | ||
- wrote stacksize.d | ||
- | ||
-Mike Shapiro | ||
- Location: CA, USA | ||
- Blog: http://blogs.sun | ||
- wrote DTrace itself | ||
- | ||
-Nathan Kroenert | ||
- Location: Sydney, Australia | ||
- thoughts on how to present tools | ||
- | ||
-Richard McDougall | ||
- Location: CA, USA | ||
- Website: http://www.solar | ||
- Blog: http://blogs.sun | ||
- wrote pfilestat, vopstat | ||
- | ||
-Ryan Matteson | ||
- Location: USA | ||
- Blog: http://blogomatt | ||
- tool ideas and testing | ||
- | ||
-Stefan Parvu | ||
- Blog: http://stefanpar | ||
- suggestions, bug fixes, extensive testing | ||
- | ||
-unknown Sun people | ||
- wrote /usr/demo/dtrace | ||
- based on. See "BASED ON" in source or man page, or try the following, | ||
- cd Bin | ||
- grep 'BASED ON' * | ||
- for a list. | ||
- |
@@ -1,385 +0,0 @@ | ||
- | ||
-COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 | ||
- | ||
- | ||
- 1. Definitions. | ||
- | ||
- 1.1. �Contributor� means each individual or entity that | ||
- creates or contributes to the creation of Modifications. | ||
- | ||
- 1.2. �Contributor Version� means the combination of the | ||
- Original Software, prior Modifications used by a | ||
- Contributor (if any), and the Modifications made by that | ||
- particular Contributor. | ||
- | ||
- 1.3. �Covered Software� means (a) the Original Software, or | ||
- (b) Modifications, or (c) the combination of files | ||
- containing Original Software with files containing | ||
- Modifications, in each case including portions thereof. | ||
- | ||
- 1.4. �Executable� means the Covered Software in any form | ||
- other than Source Code. | ||
- | ||
- 1.5. �Initial Developer� means the individual or entity | ||
- that first makes Original Software available under this | ||
- License. | ||
- | ||
- 1.6. �Larger Work� means a work which combines Covered | ||
- Software or portions thereof with code not governed by the | ||
- terms of this License. | ||
- | ||
- 1.7. �License� means this document. | ||
- | ||
- 1.8. �Licensable� means having the right to grant, to the | ||
- maximum extent possible, whether at the time of the initial | ||
- grant or subsequently acquired, any and all of the rights | ||
- conveyed herein. | ||
- | ||
- 1.9. �Modifications� means the Source Code and Executable | ||
- form of any of the following: | ||
- | ||
- A. Any file that results from an addition to, | ||
- deletion from or modification of the contents of a | ||
- file containing Original Software or previous | ||
- Modifications; | ||
- | ||
- B. Any new file that contains any part of the | ||
- Original Software or previous Modification; or | ||
- | ||
- C. Any new file that is contributed or otherwise made | ||
- available under the terms of this License. | ||
- | ||
- 1.10. �Original Software� means the Source Code and | ||
- Executable form of computer software code that is | ||
- originally released under this License. | ||
- | ||
- 1.11. �Patent Claims� means any patent claim(s), now owned | ||
- or hereafter acquired, including without limitation, | ||
- method, process, and apparatus claims, in any patent | ||
- Licensable by grantor. | ||
- | ||
- 1.12. �Source Code� means (a) the common form of computer | ||
- software code in which modifications are made and (b) | ||
- associated documentation included in or with such code. | ||
- | ||
- 1.13. �You� (or �Your�) means an individual or a legal | ||
- entity exercising rights under, and complying with all of | ||
- the terms of, this License. For legal entities, �You� | ||
- includes any entity which controls, is controlled by, or is | ||
- under common control with You. For purposes of this | ||
- definition, �control� means (a) the power, direct or | ||
- indirect, to cause the direction or management of such | ||
- entity, whether by contract or otherwise, or (b) ownership | ||
- of more than fifty percent (50%) of the outstanding shares | ||
- or beneficial ownership of such entity. | ||
- | ||
- 2. License Grants. | ||
- | ||
- 2.1. The Initial Developer Grant. | ||
- | ||
- Conditioned upon Your compliance with Section 3.1 below and | ||
- subject to third party intellectual property claims, the | ||
- Initial Developer hereby grants You a world-wide, | ||
- royalty-free, non-exclusive license: | ||
- | ||
- (a) under intellectual property rights (other than | ||
- patent or trademark) Licensable by Initial Developer, | ||
- to use, reproduce, modify, display, perform, | ||
- sublicense and distribute the Original Software (or | ||
- portions thereof), with or without Modifications, | ||
- and/or as part of a Larger Work; and | ||
- | ||
- (b) under Patent Claims infringed by the making, | ||
- using or selling of Original Software, to make, have | ||
- made, use, practice, sell, and offer for sale, and/or | ||
- otherwise dispose of the Original Software (or | ||
- portions thereof). | ||
- | ||
- (c) The licenses granted in Sections 2.1(a) and (b) | ||
- are effective on the date Initial Developer first | ||
- distributes or otherwise makes the Original Software | ||
- available to a third party under the terms of this | ||
- License. | ||
- | ||
- (d) Notwithstanding Section 2.1(b) above, no patent | ||
- license is granted: (1) for code that You delete from | ||
- the Original Software, or (2) for infringements | ||
- caused by: (i) the modification of the Original | ||
- Software, or (ii) the combination of the Original | ||
- Software with other software or devices. | ||
- | ||
- 2.2. Contributor Grant. | ||
- | ||
- Conditioned upon Your compliance with Section 3.1 below and | ||
- subject to third party intellectual property claims, each | ||
- Contributor hereby grants You a world-wide, royalty-free, | ||
- non-exclusive license: | ||
- | ||
- (a) under intellectual property rights (other than | ||
- patent or trademark) Licensable by Contributor to | ||
- use, reproduce, modify, display, perform, sublicense | ||
- and distribute the Modifications created by such | ||
- Contributor (or portions thereof), either on an | ||
- unmodified basis, with other Modifications, as | ||
- Covered Software and/or as part of a Larger Work; and | ||
- | ||
- | ||
- (b) under Patent Claims infringed by the making, | ||
- using, or selling of Modifications made by that | ||
- Contributor either alone and/or in combination with | ||
- its Contributor Version (or portions of such | ||
- combination), to make, use, sell, offer for sale, | ||
- have made, and/or otherwise dispose of: (1) | ||
- Modifications made by that Contributor (or portions | ||
- thereof); and (2) the combination of Modifications | ||
- made by that Contributor with its Contributor Version | ||
- (or portions of such combination). | ||
- | ||
- (c) The licenses granted in Sections 2.2(a) and | ||
- 2.2(b) are effective on the date Contributor first | ||
- distributes or otherwise makes the Modifications | ||
- available to a third party. | ||
- | ||
- (d) Notwithstanding Section 2.2(b) above, no patent | ||
- license is granted: (1) for any code that Contributor | ||
- has deleted from the Contributor Version; (2) for | ||
- infringements caused by: (i) third party | ||
- modifications of Contributor Version, or (ii) the | ||
- combination of Modifications made by that Contributor | ||
- with other software (except as part of the | ||
- Contributor Version) or other devices; or (3) under | ||
- Patent Claims infringed by Covered Software in the | ||
- absence of Modifications made by that Contributor. | ||
- | ||
- 3. Distribution Obligations. | ||
- | ||
- 3.1. Availability of Source Code. | ||
- | ||
- Any Covered Software that You distribute or otherwise make | ||
- available in Executable form must also be made available in | ||
- Source Code form and that Source Code form must be | ||
- distributed only under the terms of this License. You must | ||
- include a copy of this License with every copy of the | ||
- Source Code form of the Covered Software You distribute or | ||
- otherwise make available. You must inform recipients of any | ||
- such Covered Software in Executable form as to how they can | ||
- obtain such Covered Software in Source Code form in a | ||
- reasonable manner on or through a medium customarily used | ||
- for software exchange. | ||
- | ||
- 3.2. Modifications. | ||
- | ||
- The Modifications that You create or to which You | ||
- contribute are governed by the terms of this License. You | ||
- represent that You believe Your Modifications are Your | ||
- original creation(s) and/or You have sufficient rights to | ||
- grant the rights conveyed by this License. | ||
- | ||
- 3.3. Required Notices. | ||
- | ||
- You must include a notice in each of Your Modifications | ||
- that identifies You as the Contributor of the Modification. | ||
- You may not remove or alter any copyright, patent or | ||
- trademark notices contained within the Covered Software, or | ||
- any notices of licensing or any descriptive text giving | ||
- attribution to any Contributor or the Initial Developer. | ||
- | ||
- 3.4. Application of Additional Terms. | ||
- | ||
- You may not offer or impose any terms on any Covered | ||
- Software in Source Code form that alters or restricts the | ||
- applicable version of this License or the recipients� | ||
- rights hereunder. You may choose to offer, and to charge a | ||
- fee for, warranty, support, indemnity or liability | ||
- obligations to one or more recipients of Covered Software. | ||
- However, you may do so only on Your own behalf, and not on | ||
- behalf of the Initial Developer or any Contributor. You | ||
- must make it absolutely clear that any such warranty, | ||
- support, indemnity or liability obligation is offered by | ||
- You alone, and You hereby agree to indemnify the Initial | ||
- Developer and every Contributor for any liability incurred | ||
- by the Initial Developer or such Contributor as a result of | ||
- warranty, support, indemnity or liability terms You offer. | ||
- | ||
- | ||
- 3.5. Distribution of Executable Versions. | ||
- | ||
- You may distribute the Executable form of the Covered | ||
- Software under the terms of this License or under the terms | ||
- of a license of Your choice, which may contain terms | ||
- different from this License, provided that You are in | ||
- compliance with the terms of this License and that the | ||
- license for the Executable form does not attempt to limit | ||
- or alter the recipient�s rights in the Source Code form | ||
- from the rights set forth in this License. If You | ||
- distribute the Covered Software in Executable form under a | ||
- different license, You must make it absolutely clear that | ||
- any terms which differ from this License are offered by You | ||
- alone, not by the Initial Developer or Contributor. You | ||
- hereby agree to indemnify the Initial Developer and every | ||
- Contributor for any liability incurred by the Initial | ||
- Developer or such Contributor as a result of any such terms | ||
- You offer. | ||
- | ||
- 3.6. Larger Works. | ||
- | ||
- You may create a Larger Work by combining Covered Software | ||
- with other code not governed by the terms of this License | ||
- and distribute the Larger Work as a single product. In such | ||
- a case, You must make sure the requirements of this License | ||
- are fulfilled for the Covered Software. | ||
- | ||
- 4. Versions of the License. | ||
- | ||
- 4.1. New Versions. | ||
- | ||
- Sun Microsystems, Inc. is the initial license steward and | ||
- may publish revised and/or new versions of this License | ||
- from time to time. Each version will be given a | ||
- distinguishing version number. Except as provided in | ||
- Section 4.3, no one other than the license steward has the | ||
- right to modify this License. | ||
- | ||
- 4.2. Effect of New Versions. | ||
- | ||
- You may always continue to use, distribute or otherwise | ||
- make the Covered Software available under the terms of the | ||
- version of the License under which You originally received | ||
- the Covered Software. If the Initial Developer includes a | ||
- notice in the Original Software prohibiting it from being | ||
- distributed or otherwise made available under any | ||
- subsequent version of the License, You must distribute and | ||
- make the Covered Software available under the terms of the | ||
- version of the License under which You originally received | ||
- the Covered Software. Otherwise, You may also choose to | ||
- use, distribute or otherwise make the Covered Software | ||
- available under the terms of any subsequent version of the | ||
- License published by the license steward. | ||
- | ||
- 4.3. Modified Versions. | ||
- | ||
- When You are an Initial Developer and You want to create a | ||
- new license for Your Original Software, You may create and | ||
- use a modified version of this License if You: (a) rename | ||
- the license and remove any references to the name of the | ||
- license steward (except to note that the license differs | ||
- from this License); and (b) otherwise make it clear that | ||
- the license contains terms which differ from this License. | ||
- | ||
- | ||
- 5. DISCLAIMER OF WARRANTY. | ||
- | ||
- COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN �AS IS� | ||
- BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, | ||
- INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED | ||
- SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR | ||
- PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND | ||
- PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY | ||
- COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE | ||
- INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF | ||
- ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF | ||
- WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF | ||
- ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS | ||
- DISCLAIMER. | ||
- | ||
- 6. TERMINATION. | ||
- | ||
- 6.1. This License and the rights granted hereunder will | ||
- terminate automatically if You fail to comply with terms | ||
- herein and fail to cure such breach within 30 days of | ||
- becoming aware of the breach. Provisions which, by their | ||
- nature, must remain in effect beyond the termination of | ||
- this License shall survive. | ||
- | ||
- 6.2. If You assert a patent infringement claim (excluding | ||
- declaratory judgment actions) against Initial Developer or | ||
- a Contributor (the Initial Developer or Contributor against | ||
- whom You assert such claim is referred to as �Participant�) | ||
- alleging that the Participant Software (meaning the | ||
- Contributor Version where the Participant is a Contributor | ||
- or the Original Software where the Participant is the | ||
- Initial Developer) directly or indirectly infringes any | ||
- patent, then any and all rights granted directly or | ||
- indirectly to You by such Participant, the Initial | ||
- Developer (if the Initial Developer is not the Participant) | ||
- and all Contributors under Sections 2.1 and/or 2.2 of this | ||
- License shall, upon 60 days notice from Participant | ||
- terminate prospectively and automatically at the expiration | ||
- of such 60 day notice period, unless if within such 60 day | ||
- period You withdraw Your claim with respect to the | ||
- Participant Software against such Participant either | ||
- unilaterally or pursuant to a written agreement with | ||
- Participant. | ||
- | ||
- 6.3. In the event of termination under Sections 6.1 or 6.2 | ||
- above, all end user licenses that have been validly granted | ||
- by You or any distributor hereunder prior to termination | ||
- (excluding licenses granted to You by any distributor) | ||
- shall survive termination. | ||
- | ||
- 7. LIMITATION OF LIABILITY. | ||
- | ||
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT | ||
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE | ||
- INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF | ||
- COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE | ||
- LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR | ||
- CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT | ||
- LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK | ||
- STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER | ||
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN | ||
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF | ||
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL | ||
- INJURY RESULTING FROM SUCH PARTY�S NEGLIGENCE TO THE EXTENT | ||
- APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO | ||
- NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR | ||
- CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT | ||
- APPLY TO YOU. | ||
- | ||
- 8. U.S. GOVERNMENT END USERS. | ||
- | ||
- The Covered Software is a �commercial item,� as that term is | ||
- defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of �commercial | ||
- computer software� (as that term is defined at 48 C.F.R. � | ||
- 252.227-7014(a)( | ||
- documentation� as such terms are used in 48 C.F.R. 12.212 (Sept. | ||
- 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 | ||
- through 227.7202-4 (June 1995), all U.S. Government End Users | ||
- acquire Covered Software with only those rights set forth herein. | ||
- This U.S. Government Rights clause is in lieu of, and supersedes, | ||
- any other FAR, DFAR, or other clause or provision that addresses | ||
- Government rights in computer software under this License. | ||
- | ||
- 9. MISCELLANEOUS. | ||
- | ||
- This License represents the complete agreement concerning subject | ||
- matter hereof. If any provision of this License is held to be | ||
- unenforceable, such provision shall be reformed only to the | ||
- extent necessary to make it enforceable. This License shall be | ||
- governed by the law of the jurisdiction specified in a notice | ||
- contained within the Original Software (except to the extent | ||
- applicable law, if any, provides otherwise), excluding such | ||
- jurisdiction�s conflict-of-law provisions. Any litigation | ||
- relating to this License shall be subject to the jurisdiction of | ||
- the courts located in the jurisdiction and venue specified in a | ||
- notice contained within the Original Software, with the losing | ||
- party responsible for costs, including, without limitation, court | ||
- costs and reasonable attorneys� fees and expenses. The | ||
- application of the United Nations Convention on Contracts for the | ||
- International Sale of Goods is expressly excluded. Any law or | ||
- regulation which provides that the language of a contract shall | ||
- be construed against the drafter shall not apply to this License. | ||
- You agree that You alone are responsible for compliance with the | ||
- United States export administration regulations (and the export | ||
- control laws and regulation of any other countries) when You use, | ||
- distribute or otherwise make available any Covered Software. | ||
- | ||
- 10. RESPONSIBILITY FOR CLAIMS. | ||
- | ||
- As between Initial Developer and the Contributors, each party is | ||
- responsible for claims and damages arising, directly or | ||
- indirectly, out of its utilization of rights under this License | ||
- and You agree to work with Initial Developer and Contributors to | ||
- distribute such responsibility on an equitable basis. Nothing | ||
- herein is intended or shall be deemed to constitute any admission | ||
- of liability. |
@@ -1,81 +0,0 @@ | ||
-# | ||
-# DTrace OneLiners | ||
-# | ||
- | ||
-DTrace One Liners, | ||
- | ||
-# New processes with arguments, | ||
-dtrace -n 'proc:::exec-suc | ||
- | ||
-# Files opened by process name, | ||
-dtrace -n 'syscall::open*: | ||
- | ||
-# Files created using creat() by process name, | ||
-dtrace -n 'syscall::creat* | ||
- | ||
-# Syscall count by process name, | ||
-dtrace -n 'syscall:::entry | ||
- | ||
-# Syscall count by syscall, | ||
-dtrace -n 'syscall:::entry | ||
- | ||
-# Syscall count by process ID, | ||
-dtrace -n 'syscall:::entry | ||
- | ||
-# Read bytes by process name, | ||
-dtrace -n 'sysinfo:::readc | ||
- | ||
-# Write bytes by process name, | ||
-dtrace -n 'sysinfo:::write | ||
- | ||
-# Read size distribution by process name, | ||
-dtrace -n 'sysinfo:::readc | ||
- | ||
-# Write size distribution by process name, | ||
-dtrace -n 'sysinfo:::write | ||
- | ||
-# Disk size by process ID, | ||
-dtrace -n 'io:::start { printf("%d %s %d",pid,execname | ||
- | ||
-# Disk size aggregation | ||
-dtrace -n 'io:::start { @size[execname] = quantize(args[0] | ||
- | ||
-# Pages paged in by process name, | ||
-dtrace -n 'vminfo:::pgpgin | ||
- | ||
-# Minor faults by process name, | ||
-dtrace -n 'vminfo:::as_fau | ||
- | ||
-# Interrupts by CPU, | ||
-dtrace -n 'sdt:::interrupt | ||
- | ||
-# CPU cross calls by process name, | ||
-dtrace -n 'sysinfo:::xcall | ||
- | ||
-# Lock time by process name, | ||
-dtrace -n 'lockstat:::adap | ||
- | ||
-# Lock distribution by process name, | ||
-dtrace -n 'lockstat:::adap | ||
- | ||
-# Kernel funtion calls by module | ||
-dtrace -n 'fbt:::entry { @calls[probemod] | ||
- | ||
-# Stack size for processes | ||
-dtrace -n 'sched:::on-cpu { @[execname] = max(curthread->t | ||
- | ||
-# Kill all top processes when they are invoked, | ||
-dtrace -wn 'syscall::exece: | ||
- | ||
- | ||
- | ||
-DTrace Longer One Liners, | ||
- | ||
-# New processes with arguments and time, | ||
-dtrace -qn 'syscall::exec*: | ||
- | ||
-# Successful signal details, | ||
-dtrace -n 'proc:::signal-s | ||
- | ||
- | ||
- |
@@ -1 +0,0 @@ | ||
-The examples in this directory are copyright to their author. |
@@ -1,21 +0,0 @@ | ||
-Examples - Script demos, screenshots, and how to read the output | ||
- | ||
- This directory contains an example file per script in the DTraceToolkit. | ||
- | ||
- When I hear of a new performance tool or what not, the first thing I want | ||
- to see are screenshots. They illustrate, | ||
- | ||
- - generally what the tool is for | ||
- - many details and features, since the output is (supposed to be) | ||
- as intuitive as possible | ||
- - how to use the tool (command line usage) | ||
- | ||
- It is a rapid way to get a handle on what a tool generally is, and how | ||
- to start using it. The files in this directory serve that purpose. | ||
- | ||
- These are especially important now that the DTraceToolkit has over 200 | ||
- scripts. Flicking through these files and seeing the screenshots may | ||
- be the quickest way to find what you are after. | ||
- | ||
- Of course, don't forget to read the man pages and notes files too :) | ||
- |
@@ -1,73 +0,0 @@ | ||
-The following is a demonstration of the anonpgpid.d script, | ||
- | ||
- | ||
-Here we run it on a system that is implementing memory caps using the | ||
-resource capping daemon, "rcapd", | ||
- | ||
- # anonpgpid.d | ||
- Tracing... Hit Ctrl-C to end. | ||
- ^C | ||
- PID CMD D BYTES | ||
- 6215 bash R 8192 | ||
- 6215 bash W 126976 | ||
- 5809 rcapd R 245760 | ||
- 6222 memleak.pl R 974848 | ||
- 6222 memleak.pl W 3055616 | ||
- | ||
-The "memleak.pl" process consumes memory, and we can see above that it has | ||
-encountered both reads and writes to the physical swap device - it is being | ||
-paged out. A bash shell was also effected (which was in the same project that | ||
-rcapd was monitoring). | ||
- | ||
- | ||
- | ||
-The following is an ordinary system that is very low on memory, | ||
- | ||
- # anonpgpid.d | ||
- Tracing... Hit Ctrl-C to end. | ||
- ^C | ||
- PID CMD D BYTES | ||
- 18885 sendmail R 4096 | ||
- 18600 automountd R 4096 | ||
- 1 init R 4096 | ||
- 2456 inetd R 8192 | ||
- 18546 nscd R 8192 | ||
- 2400 bash R 12288 | ||
- 217 utmpd R 28672 | ||
- 221 ttymon R 32768 | ||
- 210 sac R 36864 | ||
- 18777 snmpd R 49152 | ||
- 18440 init R 49152 | ||
- 89 nscd R 61440 | ||
- 318 syslogd R 73728 | ||
- 487 snmpd R 81920 | ||
- 2453 inetd R 102400 | ||
- 165 in.routed R 131072 | ||
- 294 automountd R 135168 | ||
- 215 inetd R 135168 | ||
- 187 rpcbind R 204800 | ||
- 86 kcfd R 290816 | ||
- 7 svc.startd R 1015808 | ||
- 9 svc.configd R 1478656 | ||
- 2 pageout W 23453696 | ||
- | ||
-The "pageout" process is responsible for writing all the anonymous memory | ||
-pages to the physical swap device, and we can see from the above that it | ||
-has written 23 Mb. When processes access anonymous memory that has been | ||
-swapped out, a major fault occurs and the memory is paged back in; in this | ||
-case we can trace the process that was effected, and from the above we can | ||
-see that several processes have been effected by the memory pressure. | ||
-The most is "svc.configd", which needed to page back in 1.4 Mb of anonymous | ||
-memory. | ||
- | ||
- | ||
- | ||
-Sometimes anonpgpid.d doesn't help too much. Here we only have pageouts | ||
-to the physical swap device and no pageins, | ||
- | ||
- # anonpgpid.d | ||
- ^C | ||
- PID CMD D BYTES | ||
- 2 pageout W 61083648 | ||
- | ||
-Only pageout is identified. |
@@ -1,74 +0,0 @@ | ||
-In this example, bitesize.d was run for several seconds then Ctrl-C was hit. | ||
-As bitesize.d runs it records how processes on the system are accessing the | ||
-disks - in particular the size of the I/O operation. It is usually desirable | ||
-for processes to be requesting large I/O operations rather than taking many | ||
-small "bites". | ||
- | ||
-The final report highlights how processes performed. The find command mostly | ||
-read 1K blocks while the tar command was reading large blocks - both as | ||
-expected. | ||
- | ||
- # bitesize.d | ||
- Tracing... Hit Ctrl-C to end. | ||
- ^C | ||
- | ||
- PID CMD | ||
- 7110 -bash\0 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 512 | 0 | ||
- 1024 |@@@@@@@@@@@@@@@ | ||
- 2048 | 0 | ||
- 4096 |@@@@@@@@@@@@@ 1 | ||
- 8192 | 0 | ||
- | ||
- 7110 sync\0 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 512 | 0 | ||
- 1024 |@@@@@ 1 | ||
- 2048 |@@@@@@@@@@ 2 | ||
- 4096 | 0 | ||
- 8192 |@@@@@@@@@@@@@@@ | ||
- 16384 | 0 | ||
- | ||
- 0 sched\0 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 1024 | 0 | ||
- 2048 |@@@ 1 | ||
- 4096 | 0 | ||
- 8192 |@@@@@@@@@@@@@@@ | ||
- 16384 | 0 | ||
- | ||
- 7109 find /\0 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 512 | 0 | ||
- 1024 |@@@@@@@@@@@@@@@ | ||
- 2048 |@@ 91 | ||
- 4096 | 33 | ||
- 8192 |@@ 97 | ||
- 16384 | 0 | ||
- | ||
- 3 fsflush\0 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 4096 | 0 | ||
- 8192 |@@@@@@@@@@@@@@@ | ||
- 16384 | 0 | ||
- | ||
- 7108 tar cf /dev/null /\0 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 256 | 0 | ||
- 512 | 70 | ||
- 1024 |@@@@@@@@@@ 1306 | ||
- 2048 |@@@@ 569 | ||
- 4096 |@@@@@@@@@ 1286 | ||
- 8192 |@@@@@@@@@@ 1403 | ||
- 16384 |@ 190 | ||
- 32768 |@@@ 396 | ||
- 65536 | 0 | ||
- | ||
- |
@@ -1,23 +0,0 @@ | ||
-The following is an example of connections. As inbound TCP connections are | ||
-established their details are printed out. This includes the UID, PID and | ||
-CMD of the server process that is listening on that port, | ||
- | ||
- # connections | ||
- UID PID CMD TYPE PORT IP_SOURCE | ||
- 0 242 inetd tcp 79 192.168.1.1 | ||
- 0 359 sshd tcp 22 192.168.1.1 | ||
- 100 1532 Xorg tcp 6000 192.168.1.1 | ||
- ^C | ||
- | ||
- | ||
-In another window snoop was running for comparison, | ||
- | ||
- # snoop 'tcp[13:1] = 0x02' | ||
- Using device /dev/rtls0 (promiscuous mode) | ||
- mars -> jupiter FINGER C port=56760 | ||
- mars -> jupiter TCP D=22 S=56761 Syn Seq=3264782212 Len=0 ... | ||
- mars -> jupiter XWIN C port=56763 | ||
- | ||
-snoop can already tell me that these connections are happening - but does not | ||
-print out details of the server that accepted the connection. | ||
- |
@@ -1,276 +0,0 @@ | ||
-The following demonstrates the cpudists program. It prints distributions | ||
-of CPU time consumed by the Kernel, Idle thread, or Processes. | ||
- | ||
-Here we run cpudists for 5 seconds once, | ||
- | ||
-# ./cpudists 5 1 | ||
-2005 Apr 28 00:08:42, | ||
- KERNEL | ||
- value ------------- Distribution ------------- count | ||
- 4096 | 0 | ||
- 8192 |@@@@@@@@@@@@@@@ | ||
- 16384 |@@@@@@@@@ 344 | ||
- 32768 |@@@ 104 | ||
- 65536 | 3 | ||
- 131072 | 0 | ||
- 262144 | 1 | ||
- 524288 | 0 | ||
- 1048576 | 11 | ||
- 2097152 | 0 | ||
- | ||
- PROCESS | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@ 170 | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 |@@@@@@@@ 152 | ||
- 131072 |@ 17 | ||
- 262144 |@ 25 | ||
- 524288 |@ 13 | ||
- 1048576 | 4 | ||
- 2097152 | 9 | ||
- 4194304 | 0 | ||
- | ||
- IDLE | ||
- value ------------- Distribution ------------- count | ||
- 2097152 | 0 | ||
- 4194304 |@ 9 | ||
- 8388608 |@@@@@@@@@@@@@@@ | ||
- 16777216 |@@@ 31 | ||
- 33554432 | 0 | ||
- | ||
-The value indicates the time in nanoseconds, the count the number of | ||
-runs for this length. | ||
- | ||
-From the above, we can see the kernel has run many times - but for short | ||
-intervals each time. Processes have taken fom 10 to 60 microseconds; | ||
-and when the idle thread runs it runs for some time - around 8 milliseconds | ||
-for each. | ||
- | ||
- | ||
- | ||
- | ||
-cpudists has a "-a" option for all processes, | ||
- | ||
-# ./cpudists -a 5 1 | ||
-2005 Apr 28 00:17:34, | ||
- mapping-daemon | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 |@@@@@@@@@@@@@ 1 | ||
- 65536 | 0 | ||
- | ||
- sendmail | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 |@@@@@@@@@@@@@ 1 | ||
- 131072 | 0 | ||
- | ||
- nautilus | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 |@@@@@@@@@@@@@ 1 | ||
- 131072 | 0 | ||
- | ||
- fmd | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 |@@@@@@@@@@@@@ 1 | ||
- 131072 | 0 | ||
- | ||
- in.routed | ||
- value ------------- Distribution ------------- count | ||
- 65536 | 0 | ||
- 131072 |@@@@@@@@@@@@@@@ | ||
- 262144 | 0 | ||
- | ||
- miniserv.pl | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 | 0 | ||
- 131072 |@@@@@@@@@@@@@ 1 | ||
- 262144 | 0 | ||
- | ||
- xscreensaver | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 |@@@@@@@@@@@@@@@ | ||
- 131072 | 0 | ||
- | ||
-gnome-vfs-daemo | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 |@@@@@@@@@@@@@@@ | ||
- 131072 | 0 | ||
- | ||
- gnome-panel | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@ 1 | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 | 0 | ||
- 131072 |@@@@@@@@@@@@@@@ | ||
- 262144 | 0 | ||
- | ||
- svc.startd | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 |@@@@@@@@@@@ 4 | ||
- 65536 |@@@ 1 | ||
- 131072 | 0 | ||
- | ||
- nscd | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 |@ 1 | ||
- 65536 | 0 | ||
- 131072 |@ 1 | ||
- 262144 | 0 | ||
- | ||
-gnome-netstatus | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 | 0 | ||
- 131072 | 0 | ||
- 262144 | 0 | ||
- 524288 | 0 | ||
- 1048576 |@@@@@@@@@@@@@ 1 | ||
- 2097152 | 0 | ||
- | ||
- mixer_applet2 | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@ 10 | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 |@@@@@@@@@@@@@@ 16 | ||
- 131072 | 0 | ||
- | ||
- soffice.bin | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@ 7 | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 |@@@@@@@@ 6 | ||
- 131072 | 0 | ||
- 262144 |@@@ 2 | ||
- 524288 | 0 | ||
- 1048576 | 0 | ||
- 2097152 |@ 1 | ||
- 4194304 | 0 | ||
- | ||
- dtrace | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 | 0 | ||
- 65536 | 0 | ||
- 131072 | 0 | ||
- 262144 |@@@ 1 | ||
- 524288 |@@@@@@@@@ 3 | ||
- 1048576 | 0 | ||
- 2097152 |@@@ 1 | ||
- 4194304 | 0 | ||
- | ||
- Xorg | ||
- value ------------- Distribution ------------- count | ||
- 32768 | 0 | ||
- 65536 |@@@@@@@@@@@@@@@ | ||
- 131072 |@@@@@@@@ 6 | ||
- 262144 |@@@@@@@@@@@@ 9 | ||
- 524288 | 0 | ||
- | ||
- java_vm | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@@@@@@@@ | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 |@@@@ 20 | ||
- 131072 | 0 | ||
- | ||
- gnome-terminal | ||
- value ------------- Distribution ------------- count | ||
- 16384 | 0 | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 |@@@@@@@@@@@ 8 | ||
- 131072 |@ 1 | ||
- 262144 | 0 | ||
- 524288 |@@@@@@@@@@@@ 9 | ||
- 1048576 | 0 | ||
- | ||
- acroread | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 | 1 | ||
- 32768 |@@@@@@@@@@@@@@@ | ||
- 65536 |@@@@@@@@ 47 | ||
- 131072 |@@ 10 | ||
- 262144 | 0 | ||
- | ||
- mozilla-bin | ||
- value ------------- Distribution ------------- count | ||
- 8192 | 0 | ||
- 16384 |@@@@@@@@ 21 | ||
- 32768 |@@@@@ 13 | ||
- 65536 |@@@@@@@@@@@@@ 36 | ||
- 131072 |@@@@@@@ 19 | ||
- 262144 |@@@ 9 | ||
- 524288 |@@ 5 | ||
- 1048576 |@ 2 | ||
- 2097152 |@@ 5 | ||
- 4194304 | 0 | ||
- | ||
- KERNEL | ||
- value ------------- Distribution ------------- count | ||
- 4096 | 0 | ||
- 8192 |@@@@@@@@@@@@@@@ | ||
- 16384 |@@@@@@@@@@@ 443 | ||
- 32768 |@@ 98 | ||
- 65536 | 5 | ||
- 131072 | 1 | ||
- 262144 | 1 | ||
- 524288 | 0 | ||
- 1048576 | 11 | ||
- 2097152 | 0 | ||
- | ||
- fsflush | ||
- value ------------- Distribution ------------- count | ||
- 131072 | 0 | ||
- 262144 |@@@@@@@ 1 | ||
- 524288 | 0 | ||
- 1048576 |@@@@@@@@@@@@@@@ | ||
- 2097152 | 0 | ||
- 4194304 | 0 | ||
- 8388608 | 0 | ||
- 16777216 | 0 | ||
- 33554432 |@@@@@@@ 1 | ||
- 67108864 | 0 | ||
- | ||
- IDLE | ||
- value ------------- Distribution ------------- count | ||
- 524288 | 0 | ||
- 1048576 | 1 | ||
- 2097152 | 0 | ||
- 4194304 |@ 13 | ||
- 8388608 |@@@@@@@@@@@@@@@ | ||
- 16777216 |@@@ 31 | ||
- 33554432 | 0 | ||
- | ||
- | ||
- |
@@ -1,210 +0,0 @@ | ||
-The following demonstrates running the cputimes program on an idle system. | ||
-We use an interval of 1 second and a count of 3, | ||
- | ||
- # ./cputimes 1 3 | ||
- 2005 Apr 27 23:37:58, | ||
- THREADS TIME (ns) | ||
- KERNEL 10795499 | ||
- PROCESS 20941091 | ||
- IDLE 970707443 | ||
- 2005 Apr 27 23:37:59, | ||
- THREADS TIME (ns) | ||
- KERNEL 8919418 | ||
- PROCESS 77446789 | ||
- IDLE 910555040 | ||
- 2005 Apr 27 23:38:00, | ||
- THREADS TIME (ns) | ||
- KERNEL 8615123 | ||
- PROCESS 78314246 | ||
- IDLE 810100417 | ||
- | ||
-In the above output, we can see a breakdown of CPU time into the catagories | ||
-KERNEL, PROCESS and IDLE. The time is measured in nanoseconds. Most of the | ||
-time is in the IDLE category, as the system is idle. Very little time | ||
-was spent serving the kernel. | ||
- | ||
- | ||
- | ||
- | ||
-In the following example, several programs are run to hog the CPUs, | ||
- | ||
- # ./cputimes 1 3 | ||
- 2005 Apr 27 23:40:58, | ||
- THREADS TIME (ns) | ||
- KERNEL 11398807 | ||
- PROCESS 992254664 | ||
- 2005 Apr 27 23:40:59, | ||
- THREADS TIME (ns) | ||
- KERNEL 9205260 | ||
- PROCESS 987561182 | ||
- 2005 Apr 27 23:41:00, | ||
- THREADS TIME (ns) | ||
- KERNEL 9196669 | ||
- PROCESS 877850474 | ||
- | ||
-Now there is no IDLE category, as the system is 100% utilised. | ||
-The programs were the following, | ||
- | ||
- while :; do :; done & | ||
- | ||
-which keeps the CPU busy. | ||
- | ||
- | ||
- | ||
- | ||
-In the following example a different style of program is run to hog the CPUs, | ||
- | ||
- while :; do date; done | ||
- | ||
-This causes many processes to be created and destroyed in a hurry, and can | ||
-be difficult to troubleshoot (tools like prstat cannot sample quick enough | ||
-to easily identify what is going on). The following is the cputimes output, | ||
- | ||
- # ./cputimes 1 3 | ||
- 2005 Apr 27 23:45:30, | ||
- THREADS TIME (ns) | ||
- KERNEL 192647392 | ||
- PROCESS 835397568 | ||
- 2005 Apr 27 23:45:31, | ||
- THREADS TIME (ns) | ||
- KERNEL 168773713 | ||
- PROCESS 810825730 | ||
- 2005 Apr 27 23:45:32, | ||
- THREADS TIME (ns) | ||
- KERNEL 151676122 | ||
- PROCESS 728477272 | ||
- | ||
-Now the kernel is doing a substantial amount of work to create and destroy | ||
-these processes. | ||
- | ||
- | ||
- | ||
- | ||
-In the following example, a large amount of network activity occurs while | ||
-cputimes is running, | ||
- | ||
- # ./cputimes 1 6 | ||
- 2005 Apr 27 23:49:29, | ||
- THREADS TIME (ns) | ||
- KERNEL 10596399 | ||
- PROCESS 21793920 | ||
- IDLE 974395713 | ||
- 2005 Apr 27 23:49:30, | ||
- THREADS TIME (ns) | ||
- KERNEL 251465759 | ||
- IDLE 357436576 | ||
- PROCESS 508986422 | ||
- 2005 Apr 27 23:49:31, | ||
- THREADS TIME (ns) | ||
- IDLE 9758227 | ||
- KERNEL 367645318 | ||
- PROCESS 385427847 | ||
- 2005 Apr 27 23:49:32, | ||
- THREADS TIME (ns) | ||
- IDLE 28351679 | ||
- KERNEL 436022725 | ||
- PROCESS 451304688 | ||
- 2005 Apr 27 23:49:33, | ||
- THREADS TIME (ns) | ||
- KERNEL 262586158 | ||
- PROCESS 325238896 | ||
- IDLE 358243503 | ||
- 2005 Apr 27 23:49:34, | ||
- THREADS TIME (ns) | ||
- KERNEL 10075578 | ||
- PROCESS 238170506 | ||
- IDLE 647956998 | ||
- | ||
-Initially the system is idle. A command is run to cause heavy network | ||
-activity, which peaks during the fourth sample - during which the kernel | ||
-is using around 40% of the CPU. The Solaris 10 command "intrstat" can | ||
-help to analyse this activity further. | ||
- | ||
- | ||
- | ||
- | ||
-Longer samples are possible. The following is a 60 second sample, | ||
- | ||
- # ./cputimes 60 1 | ||
- 2005 Apr 27 23:53:02, | ||
- THREADS TIME (ns) | ||
- KERNEL 689808449 | ||
- PROCESS 8529562214 | ||
- IDLE 50406951876 | ||
- # | ||
- | ||
- | ||
- | ||
- | ||
-cputimes has a "-a" option to print all processes. The following is a | ||
-single 1 second sample with -a, | ||
- | ||
- # ./cputimes -a 1 1 | ||
- 2005 Apr 28 00:00:32, | ||
- THREADS TIME (ns) | ||
- svc.startd 51042 | ||
- nautilus 130645 | ||
- in.routed 131823 | ||
- fmd 152822 | ||
- nscd 307042 | ||
- dsdm 415799 | ||
- mixer_applet2 551066 | ||
- gnome-smproxy 587234 | ||
- xscreensaver 672270 | ||
- fsflush 1060196 | ||
- java_vm 1552988 | ||
- wnck-applet 2060870 | ||
- dtrace 2398658 | ||
- acroread 2614687 | ||
- soffice.bin 2825117 | ||
- mozilla-bin 5497488 | ||
- KERNEL 13541120 | ||
- metacity 28924204 | ||
- gnome-terminal 74304348 | ||
- Xorg 289631407 | ||
- IDLE 465054209 | ||
- | ||
-The times are in nanoseconds, and multiple processes with the same name | ||
-have their times aggregated. The above output is at an amazing resolution - | ||
-svc.startd ran for 51 microseconds, and soffice.bin ran for 28 milliseconds. | ||
- | ||
- | ||
- | ||
- | ||
-The following is a 10 second sample on an idle desktop, | ||
- | ||
- # ./cputimes -a 10 1 | ||
- 2005 Apr 28 00:03:57, | ||
- THREADS TIME (ns) | ||
- snmpd 127859 | ||
- fmd 171897 | ||
- inetd 177134 | ||
- svc.configd 185006 | ||
- mapping-daemon 197674 | ||
- miniserv.pl 305603 | ||
- gconfd-2 330511 | ||
- xscreensaver 443207 | ||
- sendmail 473434 | ||
- nautilus 506799 | ||
- gnome-vfs-daemon | ||
- gnome-panel 770631 | ||
- nscd 885353 | ||
- svc.startd 1181286 | ||
- gnome-netstatus- | ||
- mixer_applet2 4833519 | ||
- dtrace 6244366 | ||
- in.routed 6556075 | ||
- fsflush 9553155 | ||
- soffice.bin 13954327 | ||
- java_vm 16285243 | ||
- acroread 32126193 | ||
- gnome-terminal 34891991 | ||
- Xorg 35553412 | ||
- mozilla-bin 67855629 | ||
- KERNEL 94834997 | ||
- IDLE 9540941846 | ||
- | ||
-Wow, maybe not as idle as I thought! | ||
- | ||
- | ||
- |
@@ -1,40 +0,0 @@ | ||
-The following are demonstrations of the cputypes.d script, | ||
- | ||
- | ||
-This is running cputypes.d on a desktop, | ||
- | ||
- # cputypes.d | ||
- CPU CHIP PSET LGRP CLOCK TYPE FPU | ||
- 0 0 0 0 867 i386 i387 compatible | ||
- | ||
-fairly boring. | ||
- | ||
- | ||
- | ||
-The following is a multi CPU x86 server, | ||
- | ||
- # cputypes.d | ||
- CPU CHIP PSET LGRP CLOCK TYPE FPU | ||
- 0 0 0 0 2791 i386 i387 compatible | ||
- 1 3 1 0 2791 i386 i387 compatible | ||
- 2 0 0 0 2791 i386 i387 compatible | ||
- 3 3 0 0 2791 i386 i387 compatible | ||
- | ||
-Much more interesting! We can see from the CHIP field that there is actually | ||
-two CPUs, each with two cores. There is also two processor sets (0, 1). | ||
- | ||
-The CPUs were printed in CPU id order by mere chance. | ||
- | ||
- | ||
- | ||
-Here is a multi CPU SPARC server, | ||
- | ||
- # cputypes.d | ||
- CPU CHIP PSET LGRP CLOCK TYPE FPU | ||
- 0 0 0 0 400 sparcv9 sparcv9 | ||
- 1 1 0 0 400 sparcv9 sparcv9 | ||
- 4 4 0 0 400 sparcv9 sparcv9 | ||
- 5 5 0 0 400 sparcv9 sparcv9 | ||
- | ||
- | ||
- |
@@ -1,85 +0,0 @@ | ||
-The following is a demonstration of the cpuwalk.d script, | ||
- | ||
- | ||
-cpuwalk.d is not that useful on a single CPU server, | ||
- | ||
- # cpuwalk.d | ||
- Sampling... Hit Ctrl-C to end. | ||
- ^C | ||
- | ||
- PID: 18843 CMD: bash | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- 1 | 0 | ||
- | ||
- PID: 8079 CMD: mozilla-bin | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- 1 | 0 | ||
- | ||
-The output above shows that PID 18843, "bash", was sampled on CPU 0 a total | ||
-of 30 times (we sample at 1000 hz). | ||
- | ||
- | ||
- | ||
-The following is a demonstration of running cpuwalk.d with a 5 second | ||
-duration. This is on a 4 CPU server running a multithreaded CPU bound | ||
-application called "cputhread", | ||
- | ||
- # cpuwalk.d 5 | ||
- Sampling... | ||
- | ||
- PID: 3 CMD: fsflush | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 1 | 0 | ||
- 2 |@@@@@@@@@@@@@@@ | ||
- 3 | 0 | ||
- | ||
- PID: 12186 CMD: cputhread | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@ 4900 | ||
- 1 |@@@@@@@@@@ 4900 | ||
- 2 |@@@@@@@@@@ 4860 | ||
- 3 |@@@@@@@@@@ 4890 | ||
- 4 | 0 | ||
- | ||
-As we are sampling at 1000 hz, the application cputhread is indeed running | ||
-concurrently across all available CPUs. We measured the applicaiton on | ||
-CPU 0 a total of 4900 times, on CPU 1 a total of 4900 times, etc. As there | ||
-are around 5000 samples per CPU available in this 5 second 1000 hz sample, | ||
-the application is using almost all the CPU capacity in this server well. | ||
- | ||
- | ||
- | ||
-The following is a similar demonstration, this time running a multithreaded | ||
-CPU bound application called "cpuserial" that has a poor use of locking | ||
-such that the threads "serialise", | ||
- | ||
- | ||
- # cpuwalk.d 5 | ||
- Sampling... | ||
- | ||
- PID: 12194 CMD: cpuserial | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@ 470 | ||
- 1 |@@@@@@ 920 | ||
- 2 |@@@@@@@@@@@@@@@ | ||
- 3 |@@@@@@ 850 | ||
- 4 | 0 | ||
- | ||
-In the above, we can see that this CPU bound application is not making | ||
-efficient use of the CPU resources available, only reaching 3840 samples | ||
-on CPU 2 out of a potential 5000. This problem was caused by a poor use | ||
-of locks. | ||
- | ||
- | ||
- |
@@ -1,68 +0,0 @@ | ||
-The following is an example of the crashed application script, crash.d | ||
-This demonstration is for version 0.80 of crash.d, newer versions may | ||
-produce enhanced output. | ||
- | ||
-Here is the report generated as crash.d catches a crashing procmail process, | ||
- | ||
-# ./crash.d | ||
-Waiting for crashing applications... | ||
- | ||
---------------- | ||
-CRASH DETECTED at 2005 May 30 19:41:34 | ||
---------------- | ||
-Type: SIGSEGV | ||
-Program: procmail | ||
-Args: procmail -m\0 | ||
-PID: 2877 | ||
-TID: 1 | ||
-LWPs: 1 | ||
-PPID: 1778 | ||
-UID: 100 | ||
-GID: 1 | ||
-TaskID: 76 | ||
-ProjID: 3 | ||
-PoolID: 0 | ||
-ZoneID: 0 | ||
-zone: global | ||
-CWD: /usr/include/sys | ||
-errno: 0 | ||
- | ||
-User Stack Backtrace, | ||
- procmail`sendcom | ||
- procmail`Termina | ||
- procmail`0x805a2 | ||
- procmail`0x805a4 | ||
- libc.so.1`__sigh | ||
- libc.so.1`call_u | ||
- libc.so.1`sigact | ||
- 0xffffffff | ||
- procmail`rread+0 | ||
- procmail`0x805bc | ||
- procmail`read2bl | ||
- procmail`readdyn | ||
- procmail`readmai | ||
- procmail`main+0x | ||
- procmail`_start+ | ||
- | ||
-Kernel Stack Backtrace, | ||
- genunix`sigaddqa | ||
- genunix`trapsig+ | ||
- unix`trap+0xc2b | ||
- unix`_cmntrap+0x | ||
- | ||
-Ansestors, | ||
- 2877 procmail -m\0 | ||
- 1778 bash\0 | ||
- 1777 xterm -bg black -fg grey70 -sl 500 -vb\0 | ||
- 1 /sbin/init\0 | ||
- 0 sched\0 | ||
- | ||
-Times, | ||
- User: 0 ticks | ||
- Sys: 1 ticks | ||
- Elapsed: 3307 ms | ||
- | ||
-Sizes, | ||
- Heap: 16388 bytes | ||
- Stack: 8192 bytes | ||
- |
@@ -1,23 +0,0 @@ | ||
-The following is an example of the creatbyproc.d script, | ||
- | ||
- | ||
-Here we run creatbyproc.d for several seconds, | ||
- | ||
- # ./creatbyproc.d | ||
- dtrace: script './creatbyproc.d | ||
- CPU ID FUNCTION:NAME | ||
- 0 5438 creat64:entry touch /tmp/newfile | ||
- 0 5438 creat64:entry sh /tmp/mpLaaOik | ||
- 0 5438 creat64:entry sh /dev/null | ||
- ^C | ||
- | ||
-In another window, the following commands were run, | ||
- | ||
- touch /tmp/newfile | ||
- man ls | ||
- | ||
-The file creation activity caused by these commands can be seen in the | ||
-output by creatbyproc.d | ||
- | ||
- | ||
- |
@@ -1,25 +0,0 @@ | ||
-The following is an example of the cswstat.d script, | ||
- | ||
- # cswstat.d | ||
- TIME NUM CSWTIME AVGTIME | ||
- 2005 May 17 01:57:21 276 2407 8 | ||
- 2005 May 17 01:57:22 283 2251 7 | ||
- 2005 May 17 01:57:23 259 2098 8 | ||
- 2005 May 17 01:57:24 268 2169 8 | ||
- 2005 May 17 01:57:25 1248 10864 8 | ||
- 2005 May 17 01:57:26 2421 21263 8 | ||
- 2005 May 17 01:57:27 2183 19804 9 | ||
- 2005 May 17 01:57:28 1980 18640 9 | ||
- 2005 May 17 01:57:29 794 7422 9 | ||
- 2005 May 17 01:57:30 275 2233 8 | ||
- 2005 May 17 01:57:31 288 2338 8 | ||
- 2005 May 17 01:57:32 545 4154 7 | ||
- 2005 May 17 01:57:33 264 2149 8 | ||
- ^C | ||
- | ||
-In the above output, the average context switch time is 8 microseconds. | ||
-During the sample there was a burst of activity, increasing the number | ||
-of context switches per second from around 270 to over 2000. The time | ||
-consumed by all of these context switches in total is printed, peaking | ||
-at 21 ms. | ||
- |
@@ -1,71 +0,0 @@ | ||
-The following is a demonstration of the dappprof command, | ||
- | ||
-This is the usage for version 0.60, | ||
- | ||
- # dappprof -h | ||
- USAGE: dappprof [-cehoTU] [-u lib] { -p PID | command } | ||
- | ||
- -p PID # examine this PID | ||
- -a # print all details | ||
- -c # print syscall counts | ||
- -e # print elapsed times (us) | ||
- -o # print on cpu times | ||
- -T # print totals | ||
- -u lib # trace this library instead | ||
- -U # trace all libraries + user funcs | ||
- -b bufsize # dynamic variable buf size | ||
- eg, | ||
- dappprof df -h # run and examine "df -h" | ||
- dappprof -p 1871 # examine PID 1871 | ||
- dappprof -ap 1871 # print all data | ||
- | ||
- | ||
- | ||
-The following shows running dappprof with the "banner hello" command. | ||
-Elapsed and on-cpu times are printed (-eo), as well as counts (-c) and | ||
-totals (-T), | ||
- | ||
- # dappprof -eocT banner hello | ||
- | ||
- # # ###### # # #### | ||
- # # # # # # # | ||
- ###### ##### # # # # | ||
- # # # # # # # | ||
- # # # # # # # | ||
- # # ###### ###### ###### #### | ||
- | ||
- | ||
- CALL COUNT | ||
- __fsr 1 | ||
- main 1 | ||
- banprt 1 | ||
- banner 1 | ||
- banset 1 | ||
- convert 5 | ||
- banfil 5 | ||
- TOTAL: 15 | ||
- | ||
- CALL ELAPSED | ||
- banset 37363 | ||
- banfil 147407 | ||
- convert 149606 | ||
- banprt 423507 | ||
- banner 891088 | ||
- __fsr 1694349 | ||
- TOTAL: 3343320 | ||
- | ||
- CALL CPU | ||
- banset 7532 | ||
- convert 8805 | ||
- banfil 11092 | ||
- __fsr 15708 | ||
- banner 48696 | ||
- banprt 388853 | ||
- TOTAL: 480686 | ||
- | ||
-The above output has analysed user functions (the default). It makes it | ||
-easy to identify which function is being called the most (COUNT), which | ||
-is taking the most time (ELAPSED), and which is consuming the most CPU (CPU). | ||
-These times are totals for all the functions called. | ||
- | ||
- |
@@ -1,215 +0,0 @@ | ||
-The following is a demonstration of the dapptrace command, | ||
- | ||
-This is the usage for version 0.60, | ||
- | ||
- # dapptrace -h | ||
- USAGE: dapptrace [-acdeholFLU] [-u lib] { -p PID | command } | ||
- | ||
- -p PID # examine this PID | ||
- -a # print all details | ||
- -c # print syscall counts | ||
- -d # print relative times (us) | ||
- -e # print elapsed times (us) | ||
- -F # print flow indentation | ||
- -l # print pid/lwpid | ||
- -o # print CPU on cpu times | ||
- -u lib # trace this library instead | ||
- -U # trace all libraries + user funcs | ||
- -b bufsize # dynamic variable buf size | ||
- eg, | ||
- dapptrace df -h # run and examine "df -h" | ||
- dapptrace -p 1871 # examine PID 1871 | ||
- dapptrace -Fp 1871 # print using flow indents | ||
- dapptrace -eop 1871 # print elapsed and CPU times | ||
- | ||
- | ||
- | ||
-The following is an example of the default output. We run dapptrace with | ||
-the "banner hello" command, | ||
- | ||
- # dapptrace banner hi | ||
- | ||
- # # # | ||
- # # # | ||
- ###### # | ||
- # # # | ||
- # # # | ||
- # # # | ||
- | ||
- CALL(args) = return | ||
- -> __fsr(0x2, 0x8047D7C, 0x8047D88) | ||
- <- __fsr = 122 | ||
- -> main(0x2, 0x8047D7C, 0x8047D88) | ||
- -> banner(0x8047E3B | ||
- -> banset(0x20, 0x80614C2, 0x8047DCC) | ||
- <- banset = 36 | ||
- -> convert(0x68, 0x8047DCC, 0x2) | ||
- <- convert = 319 | ||
- -> banfil(0x8061412 | ||
- <- banfil = 57 | ||
- -> convert(0x69, 0x8047DCC, 0x2) | ||
- <- convert = 319 | ||
- -> banfil(0x8061419 | ||
- <- banfil = 57 | ||
- <- banner = 118 | ||
- -> banprt(0x80614C2 | ||
- <- banprt = 74 | ||
- | ||
-The default output shows user function calls. An entry is prefixed | ||
-with a "->", and the return has a "<-". | ||
- | ||
- | ||
- | ||
-Here we run dapptrace with the -F for flow indent option, | ||
- | ||
- # dapptrace -F banner hi | ||
- | ||
- # # # | ||
- # # # | ||
- ###### # | ||
- # # # | ||
- # # # | ||
- # # # | ||
- | ||
- CALL(args) = return | ||
- -> __fsr(0x2, 0x8047D7C, 0x8047D88) | ||
- <- __fsr = 122 | ||
- -> main(0x2, 0x8047D7C, 0x8047D88) | ||
- -> banner(0x8047E3B | ||
- -> banset(0x20, 0x80614C2, 0x8047DCC) | ||
- <- banset = 36 | ||
- -> convert(0x68, 0x8047DCC, 0x2) | ||
- <- convert = 319 | ||
- -> banfil(0x8061412 | ||
- <- banfil = 57 | ||
- -> convert(0x69, 0x8047DCC, 0x2) | ||
- <- convert = 319 | ||
- -> banfil(0x8061419 | ||
- <- banfil = 57 | ||
- <- banner = 118 | ||
- -> banprt(0x80614C2 | ||
- <- banprt = 74 | ||
- | ||
-The above output illustrates the flow of the program, which functions | ||
-call which other functions. | ||
- | ||
- | ||
- | ||
-Now the same command is run with -d to display relative timestamps, | ||
- | ||
- # dapptrace -dF banner hi | ||
- | ||
- # # # | ||
- # # # | ||
- ###### # | ||
- # # # | ||
- # # # | ||
- # # # | ||
- | ||
- RELATIVE CALL(args) = return | ||
- 2512 -> __fsr(0x2, 0x8047D7C, 0x8047D88) | ||
- 2516 <- __fsr = 122 | ||
- 2518 -> main(0x2, 0x8047D7C, 0x8047D88) | ||
- 2863 -> banner(0x8047E3B | ||
- 2865 -> banset(0x20, 0x80614C2, 0x8047DCC) | ||
- 2872 <- banset = 36 | ||
- 2874 -> convert(0x68, 0x8047DCC, 0x2) | ||
- 2877 <- convert = 319 | ||
- 2879 -> banfil(0x8061412 | ||
- 2882 <- banfil = 57 | ||
- 2883 -> convert(0x69, 0x8047DCC, 0x2) | ||
- 2885 <- convert = 319 | ||
- 2886 -> banfil(0x8061419 | ||
- 2888 <- banfil = 57 | ||
- 2890 <- banner = 118 | ||
- 2892 -> banprt(0x80614C2 | ||
- 3214 <- banprt = 74 | ||
- | ||
-The relative times are in microseconds since the program's invocation. Great! | ||
- | ||
- | ||
- | ||
-Even better is if we use the -eo options, to print elapsed times and on-cpu | ||
-times, | ||
- | ||
- # dapptrace -eoF banner hi | ||
- | ||
- # # # | ||
- # # # | ||
- ###### # | ||
- # # # | ||
- # # # | ||
- # # # | ||
- | ||
- ELAPSD CPU CALL(args) = return | ||
- . . -> __fsr(0x2, 0x8047D7C, 0x8047D88) | ||
- 41 4 <- __fsr = 122 | ||
- . . -> main(0x2, 0x8047D7C, 0x8047D88) | ||
- . . -> banner(0x8047E3B | ||
- . . -> banset(0x20, 0x80614C2, 0x8047DCC) | ||
- 29 6 <- banset = 36 | ||
- . . -> convert(0x68, 0x8047DCC, 0x2) | ||
- 26 3 <- convert = 319 | ||
- . . -> banfil(0x8061412 | ||
- 25 2 <- banfil = 57 | ||
- . . -> convert(0x69, 0x8047DCC, 0x2) | ||
- 23 1 <- convert = 319 | ||
- . . -> banfil(0x8061419 | ||
- 23 1 <- banfil = 57 | ||
- 309 28 <- banner = 118 | ||
- . . -> banprt(0x80614C2 | ||
- 349 322 <- banprt = 74 | ||
- | ||
-Now it is easy to see which functions take the longest (elapsed), and | ||
-which consume the most CPU cycles. | ||
- | ||
- | ||
- | ||
-The following demonstrates the -U option, to trace all libraries, | ||
- | ||
- # dapptrace -U banner hi | ||
- | ||
- # # # | ||
- # # # | ||
- ###### # | ||
- # # # | ||
- # # # | ||
- # # # | ||
- | ||
- CALL(args) = return | ||
- -> ld.so.1:_rt_boot | ||
- -> ld.so.1:_setup(0 | ||
- -> ld.so.1:setup(0x | ||
- -> ld.so.1:fmap_set | ||
- <- ld.so.1:fmap_set | ||
- -> ld.so.1:addfree( | ||
- <- ld.so.1:addfree = 65 | ||
- -> ld.so.1:security | ||
- <- ld.so.1:security | ||
- -> ld.so.1:readenv_ | ||
- -> ld.so.1:ld_str_e | ||
- <- ld.so.1:ld_str_e | ||
- -> ld.so.1:ld_str_e | ||
- <- ld.so.1:ld_str_e | ||
- -> ld.so.1:ld_str_e | ||
- <- ld.so.1:ld_str_e | ||
- -> ld.so.1:ld_str_e | ||
- -> ld.so.1:strncmp( | ||
- <- ld.so.1:strncmp = 113 | ||
- -> ld.so.1:rd_event | ||
- [...4486 lines deleted...] | ||
- -> ld.so.1:_lwp_mut | ||
- <- ld.so.1:_lwp_mut | ||
- <- ld.so.1:rt_mutex | ||
- -> ld.so.1:rt_bind_ | ||
- <- ld.so.1:rt_bind_ | ||
- <- ld.so.1:leave = 210 | ||
- <- ld.so.1:elf_bndr | ||
- <- ld.so.1:elf_rtbn | ||
- | ||
-The output was huge, around 4500 lines long. Function names are prefixed | ||
-with their library name, eg "ld.so.1". | ||
- | ||
-This full output should be used with caution, as it enables so many probes | ||
-it could well be a burden on the system. | ||
- |
@@ -1,95 +0,0 @@ | ||
-The following is a demonstration of the dexplorer program. | ||
- | ||
- | ||
-Here we run dexplorer with no arguments. By default it will sample various | ||
-system activities using DTrace at 5 seconds per sample. It creates an | ||
-output tar.gz file containing all the DTrace output, | ||
- | ||
- # dexplorer | ||
- Output dir will be the current dir (/export/home/ro | ||
- Hit enter for yes, or type path: | ||
- Starting dexplorer ver 0.70. | ||
- Sample interval is 5 seconds. Total run is > 100 seconds. | ||
- 0% Interrupts by CPU... | ||
- 5% Interrupt counts... | ||
- 10% Dispatcher queue length by CPU... | ||
- 15% Sdt counts... | ||
- 20% Pages paged in by process name... | ||
- 25% Files opened count... | ||
- 30% Disk I/O size distribution by process name... | ||
- 35% Minor faults by process name... | ||
- 40% Vminfo data by process name... | ||
- 45% Mib data by mib statistic... | ||
- 50% TCP write bytes by process... | ||
- 55% Sample process @ 1000 Hz... | ||
- 60% Syscall count by process name... | ||
- 65% Syscall count by syscall... | ||
- 70% Read bytes by process name... | ||
- 75% Write bytes by process name... | ||
- 80% Sysinfo counts by process name... | ||
- 85% New process counts with arguments... | ||
- 90% Signal counts... | ||
- 95% Syscall error counts... | ||
- 100% Done. | ||
- File is de_jupiter_20050 | ||
- | ||
-As each sample is taken, a line of output is printed above. The above example | ||
-is for version 0.70, newer versions of dexplorer are likely to print more | ||
-lines as they take more samples. | ||
- | ||
-The final line states which file all the output is now in. | ||
- | ||
- | ||
- | ||
- | ||
-The following displays the contents of a dexplorer file, | ||
- | ||
- # gunzip de_jupiter_20050 | ||
- # tar xf de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- de_jupiter_20050 | ||
- | ||
- | ||
- | ||
-The following demonstrates running dexplorer in full quiet mode, | ||
- | ||
- # dexplorer -qy -d /var/tmp | ||
- # | ||
- | ||
-No text is written to the screen (-qy). The output file will have been | ||
-put in /var/tmp (-d). | ||
- | ||
- |
@@ -1,107 +0,0 @@ | ||
-The following is a demonstration of the diskhits command. | ||
- | ||
- | ||
-Here we run diskhits on a large file, /extra1/contents | ||
-currently hasn't been accessed (so isn't in any cache). | ||
- | ||
-While diskhits is running, the file is grep'd in another window. This causes | ||
-the entire file to be read, | ||
- | ||
- # ./diskhits /extra1/contents | ||
- Tracing... Hit Ctrl-C to end. | ||
- ^C | ||
- Location (KB), | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@ 47 | ||
- 2303 |@@ 41 | ||
- 4606 |@@ 41 | ||
- 6909 |@@ 42 | ||
- 9212 |@@ 41 | ||
- 11515 |@@ 41 | ||
- 13818 |@@ 42 | ||
- 16121 |@@ 43 | ||
- 18424 |@@ 42 | ||
- 20727 |@@ 41 | ||
- 23030 |@@ 41 | ||
- 25333 |@@ 41 | ||
- 27636 |@@ 41 | ||
- 29939 |@@ 42 | ||
- 32242 |@@ 44 | ||
- 34545 |@@ 41 | ||
- 36848 |@@ 41 | ||
- 39151 |@@ 41 | ||
- 41454 |@@ 41 | ||
- 43757 |@@ 40 | ||
- >= 46060 | 0 | ||
- | ||
- Size (KB), | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 4 | 0 | ||
- 8 | 6 | ||
- 16 | 10 | ||
- 32 |@@@@@@@@@@@@@@@ | ||
- 64 | 0 | ||
- | ||
- Total RW: 46064 KB | ||
- | ||
-Ok, so the file was read evently with each access around 32 to 63 Kb in size, | ||
-and a total of 46 Mb read. This all makes sense, as it is reading the file | ||
-for the first time. | ||
- | ||
- | ||
- | ||
-Now the same file is grep'd with diskhits running, this time we can see what | ||
-effect caching the file has made, | ||
- | ||
- # ./diskhits /extra1/contents | ||
- Tracing... Hit Ctrl-C to end. | ||
- ^C | ||
- Location (KB), | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 2303 | 0 | ||
- 4606 | 5 | ||
- 6909 |@ 67 | ||
- 9212 |@@@@ 170 | ||
- 11515 |@@@@@ 216 | ||
- 13818 |@@@@@ 224 | ||
- 16121 |@@@@@@ 287 | ||
- 18424 |@@@@@ 227 | ||
- 20727 |@@@ 144 | ||
- 23030 |@@ 75 | ||
- 25333 |@ 59 | ||
- 27636 |@ 42 | ||
- 29939 |@ 41 | ||
- 32242 |@ 44 | ||
- 34545 |@ 41 | ||
- 36848 |@ 41 | ||
- 39151 |@ 41 | ||
- 41454 |@ 41 | ||
- 43757 |@ 39 | ||
- >= 46060 | 0 | ||
- | ||
- Size (KB), | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 2 | 0 | ||
- 4 |@@@@@@@@@@@@@@@ | ||
- 8 |@@@@@ 211 | ||
- 16 |@@ 111 | ||
- 32 |@@@@@@@@ 345 | ||
- 64 | 0 | ||
- | ||
- Total RW: 29392 KB | ||
- | ||
-The difference is dramatic. This time only 29 Mb is read, leaving around | ||
-17 Mb that was read from the cache. The way the file is read differs - | ||
-in the later half of the file it looks the same, but in the first half there | ||
-are many more events; oddly enough, this is because the early part of the | ||
-file is cached more, the extra events are likely to be much smaller in size - | ||
-as indicated in the difference in the size distribution. | ||
- | ||
-It appears that everything less that 4606 Kb has remained in the cache, with | ||
-zero hits for that range. | ||
- |
@@ -1,62 +0,0 @@ | ||
-This is a demonstration of the dispqlen.d script, | ||
- | ||
- | ||
-Here we run it on a single CPU desktop, | ||
- | ||
- # dispqlen.d | ||
- Sampling... Hit Ctrl-C to end. | ||
- ^C | ||
- CPU 0 | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- 1 |@@@ 160 | ||
- 2 | 10 | ||
- 3 | 0 | ||
- | ||
-The output shows the length of the dispatcher queue is mostly 0. This is | ||
-evidence that the CPU is not very saturated. It does not indicate that the | ||
-CPU is idle - as we are measuring the length of the queue, not what is | ||
-on the CPU. | ||
- | ||
- | ||
- | ||
-Here it is run on a multi CPU server, | ||
- | ||
- # dispqlen.d | ||
- Sampling... Hit Ctrl-C to end. | ||
- ^C | ||
- CPU 1 | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- 1 |@@@@@@@@@ 436 | ||
- 2 | 4 | ||
- 3 | 0 | ||
- | ||
- CPU 4 | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- 1 |@@@@@@@@@@@@@@@ | ||
- 2 | 1 | ||
- 3 | 0 | ||
- | ||
- CPU 0 | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- 1 |@@@@@@@@@@@@@@@ | ||
- 2 | 0 | ||
- | ||
- CPU 5 | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@ 397 | ||
- 1 |@@@@@@@@@@@@@@@ | ||
- 2 |@@ 79 | ||
- 3 | 0 | ||
- | ||
-The above output shows that threads are queueing up on CPU 5 much more than | ||
-CPU 0. | ||
- |
@@ -1,47 +0,0 @@ | ||
-The following is a demonstration of the dnlcps.d script. | ||
- | ||
- | ||
-Here we run dnlcps.d for o few seconds, then hit Ctrl-C, | ||
- | ||
- # dnlcps.d | ||
- Tracing... Hit Ctrl-C to end. | ||
- ^C | ||
- CMD: bash PID: 12508 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@@ | ||
- >= 1 |@@@@@@@@@@@@@@@ | ||
- | ||
- CMD: nscd PID: 109 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 0 | 0 | ||
- >= 1 |@@@@@@@@@@@@@@@ | ||
- | ||
- CMD: in.routed PID: 143 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- 0 | 0 | ||
- >= 1 |@@@@@@@@@@@@@@@ | ||
- | ||
- CMD: ls PID: 12508 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@ 2 | ||
- >= 1 |@@@@@@@@@@@@@@@ | ||
- | ||
- CMD: find PID: 12507 | ||
- | ||
- value ------------- Distribution ------------- count | ||
- < 0 | 0 | ||
- 0 |@@@@@@@@@@@@@@ 5768 | ||
- >= 1 |@@@@@@@@@@@@@@@ | ||
- | ||
-A "find" command was running at the time, which had 11,263 hits on the DNLC | ||
-and 5768 misses. An "ls" command scored 22 hits. | ||
- | ||
-The above distribution output can help us identify if procesess | ||
-are both using the DNLC a lot, and what hit rate they are scoring. | ||
- |
@@ -1,88 +0,0 @@ | ||
-The following is a demonstration of the dnlcsnoop.d script. | ||
- | ||
- | ||
-Here we run dnlcsnoop.d, while in another window a "find /etc/default" | ||
-command is executed, | ||
- | ||
- # dnlcsnoop.d | ||
- PID CMD TIME HIT PATH | ||
- 9185 bash 9 Y /etc | ||
- 9185 bash 3 Y /etc | ||
- 12293 bash 9 Y /usr | ||
- 12293 bash 3 Y /usr/bin | ||
- 12293 bash 4 Y /usr/bin/find | ||
- 12293 bash 7 Y /lib | ||
- 12293 bash 3 Y /lib/ld.so.1 | ||
- 12293 find 6 Y /usr | ||
- 12293 find 3 Y /usr/bin | ||
- 12293 find 3 Y /usr/bin/find | ||
- 12293 find 3 Y /usr | ||
- 12293 find 3 Y /usr/lib | ||
- 12293 find 3 Y /usr/lib/ld.so.1 | ||
- 12293 find 3 Y /usr/lib/.. | ||
- 12293 find 3 Y /usr/.. | ||
- 12293 find 3 Y /lib | ||
- 12293 find 3 Y /lib/ld.so.1 | ||
- 12293 find 3 Y /usr | ||
- 12293 find 3 Y /usr/bin | ||
- 12293 find 2 Y /usr/bin/find | ||
- 12293 find 4 Y /var | ||
- 12293 find 3 Y /var/ld | ||
- 12293 find 3 Y /var/ld/ld.confi | ||
- 12293 find 3 Y /lib | ||
- 12293 find 3 Y /lib/libc.so.1 | ||
- 12293 find 3 Y /lib | ||
- 12293 find 3 Y /lib/libc.so.1 | ||
- 12293 find 3 Y /lib | ||
- 12293 find 3 Y /lib/libc.so.1 | ||
- 12293 find 8 Y /export | ||
- 12293 find 4 Y /export/home | ||
- 12293 find 3 Y /export/home/roo | ||
- 12293 find 4 Y /export/home/roo | ||
- 12293 find 3 Y /export | ||
- 12293 find 3 Y /export/home | ||
- 12293 find 3 Y /export/home/roo | ||
- 12293 find 3 Y /export/home/roo | ||
- 12293 find 3 Y /etc | ||
- 12293 find 3 Y /etc/default | ||
- 12293 find 3 Y /etc | ||
- 12293 find 3 Y /etc/default | ||
- 12293 find 5 N /etc/default/cro | ||
- 12293 find 3 N /etc/default/dev | ||
- 12293 find 4 N /etc/default/fs | ||
- 12293 find 4 N /etc/default/kbd | ||
- 12293 find 3 N /etc/default/key | ||
- 12293 find 4 N /etc/default/nss | ||
- 12293 find 3 N /etc/default/sys | ||
- 12293 find 3 N /etc/default/tar | ||
- 12293 find 4 N /etc/default/utm | ||
- 12293 find 5 N /etc/default/ini | ||
- 12293 find 4 Y /etc/default/log | ||
- 12293 find 4 Y /etc/default/su | ||
- 12293 find 3 N /etc/default/pas | ||
- 12293 find 3 N /etc/default/dhc | ||
- 12293 find 4 N /etc/default/ine | ||
- 12293 find 3 N /etc/default/ips | ||
- 12293 find 3 N /etc/default/mpa | ||
- 12293 find 3 N /etc/default/tel | ||
- 12293 find 3 Y /etc/default/nfs | ||
- 12293 find 3 N /etc/default/aut | ||
- 12293 find 9 Y /etc/default/ftp | ||
- 12293 find 5 N /etc/default/rpc | ||
- 12293 find 5 N /etc/default/nfs | ||
- 12293 find 4 N /etc/default/lu | ||
- 12293 find 6 N /etc/default/pow | ||
- 12293 find 5 N /etc/default/sys | ||
- 12293 find 6 N /etc/default/met | ||
- 12293 find 5 N /etc/default/ypp | ||
- 12293 find 4 N /etc/default/web | ||
- 12293 find 5 Y /export | ||
- 12293 find 4 Y /export/home | ||
- 12293 find 4 Y /export/home/roo | ||
- 12293 find 4 Y /export/home/roo | ||
- | ||
-The DNLC is the Directory Name Lookup Cache. Here we can see name lookups, | ||
-and whether the cache returned a hit. "/export/home/ro | ||
-looked up a few times - this was the current directory that the find | ||
-command was executed from. | ||
- |
@@ -1,40 +0,0 @@ | ||
-The following is a demonstration of the dnlcstat command. | ||
- | ||
- | ||
-Here we run dnlcstat with no options. It prints a line every second, | ||
- | ||
- # dnlcstat | ||
- dnlc %hit hit miss | ||
- 0 0 0 | ||
- 0 0 0 | ||
- 93 95 7 | ||
- 89 1920 231 | ||
- 89 2130 243 | ||
- 91 2358 232 | ||
- 92 1476 124 | ||
- 92 1953 159 | ||
- 94 2416 134 | ||
- 94 1962 114 | ||
- 95 2113 101 | ||
- 97 1969 54 | ||
- 98 1489 26 | ||
- 41 564 786 | ||
- 40 622 913 | ||
- 35 520 952 | ||
- 27 937 2503 | ||
- 22 1696 5806 | ||
- 22 955 3281 | ||
- 21 1377 5059 | ||
- 31 2043 4516 | ||
- 22 1423 4968 | ||
- 13 550 3438 | ||
- 2 95 3810 | ||
- 0 58 6410 | ||
- 4 223 4433 | ||
- 4 198 4491 | ||
- 7 339 4383 | ||
- | ||
-In another window, a "find /" was run. We can see the DNLC activity above, | ||
-initially there are high hit rates in the DNLC - over 90%. Eventually | ||
-the find command exhausts the DNLC, and the hit rate drops to below 10%. | ||
- |
@@ -1,120 +0,0 @@ | ||
-The following demonstrates the dtruss command - a DTrace version of truss. | ||
-This version is designed to be less intrusive and safer than running truss. | ||
- | ||
-dtruss has many options. Here is the help for version 0.70, | ||
- | ||
- USAGE: dtruss [-acdefholL] [-t syscall] { -p PID | -n name | command } | ||
- | ||
- -p PID # examine this PID | ||
- -n name # examine this process name | ||
- -t syscall # examine this syscall only | ||
- -a # print all details | ||
- -c # print syscall counts | ||
- -d # print relative times (us) | ||
- -e # print elapsed times (us) | ||
- -f # follow children | ||
- -l # force printing pid/lwpid | ||
- -o # print on cpu times | ||
- -L # don't print pid/lwpid | ||
- -b bufsize # dynamic variable buf size | ||
- eg, | ||
- dtruss df -h # run and examine "df -h" | ||
- dtruss -p 1871 # examine PID 1871 | ||
- dtruss -n tar # examine all processes called "tar" | ||
- dtruss -f test.sh # run test.sh and follow children | ||
- | ||
- | ||
- | ||
-For example, here we dtruss any process with the name "ksh" - the Korn shell, | ||
- | ||
- # dtruss -n ksh | ||
- PID/LWP SYSCALL(args) = return | ||
- 27547/1: llseek(0x3F, 0xE4E, 0x0) = 3662 0 | ||
- 27547/1: read(0x3F, "\0", 0x400) = 0 0 | ||
- 27547/1: llseek(0x3F, 0x0, 0x0) = 3662 0 | ||
- 27547/1: write(0x3F, "ls -l\n\0", 0x8) = 8 0 | ||
- 27547/1: fdsync(0x3F, 0x10, 0xFEC1D444) = 0 0 | ||
- 27547/1: lwp_sigmask(0x3, | ||
- 27547/1: stat64("/usr/bin | ||
- 27547/1: lwp_sigmask(0x3, | ||
- [...] | ||
- | ||
-The output for each system call does not yet evaluate as much as truss does. | ||
- | ||
- | ||
- | ||
-In the following example, syscall elapsed and overhead times are measured. | ||
-Elapsed times represent the time from syscall start to finish; overhead | ||
-times measure the time spent on the CPU, | ||
- | ||
- # dtruss -eon bash | ||
- PID/LWP ELAPSD CPU SYSCALL(args) = return | ||
- 3911/1: 41 26 write(0x2, "l\0", 0x1) = 1 0 | ||
- 3911/1: 1001579 43 read(0x0, "s\0", 0x1) = 1 0 | ||
- 3911/1: 38 26 write(0x2, "s\0", 0x1) = 1 0 | ||
- 3911/1: 1019129 43 read(0x0, " \001\0", 0x1) = 1 0 | ||
- 3911/1: 38 26 write(0x2, " \0", 0x1) = 1 0 | ||
- 3911/1: 998533 43 read(0x0, "-\0", 0x1) = 1 0 | ||
- 3911/1: 38 26 write(0x2, "-\001\0", 0x1) = 1 0 | ||
- 3911/1: 1094323 42 read(0x0, "l\0", 0x1) = 1 0 | ||
- 3911/1: 39 27 write(0x2, "l\001\0", 0x1) = 1 0 | ||
- 3911/1: 1210496 44 read(0x0, "\r\0", 0x1) = 1 0 | ||
- 3911/1: 40 28 write(0x2, "\n\001\0", 0x1) = 1 0 | ||
- 3911/1: 9 1 lwp_sigmask(0x3, | ||
- 3911/1: 70 63 ioctl(0x0, 0x540F, 0x80F6D00) = 0 0 | ||
- | ||
-A bash command was in another window, where the "ls -l" command was being | ||
-typed. The keystrokes can be seen above, along with the long elapsed times | ||
-(keystroke delays), and short overhead times (as the bash process blocks | ||
-on the read and leaves the CPU). | ||
- | ||
- | ||
- | ||
-Now dtruss is put to the test. Here we truss a test program that runs several | ||
-hundred smaller programs, which in turn generate thousands of system calls. | ||
- | ||
-First, as a "control" we run the program without a truss or dtruss running, | ||
- | ||
- # time ./test | ||
- real 0m38.508s | ||
- user 0m5.299s | ||
- sys 0m25.668s | ||
- | ||
-Now we try truss, | ||
- | ||
- # time truss ./test 2> /dev/null | ||
- real 0m41.281s | ||
- user 0m0.558s | ||
- sys 0m1.351s | ||
- | ||
-Now we try dtruss, | ||
- | ||
- # time dtruss ./test 2> /dev/null | ||
- real 0m46.226s | ||
- user 0m6.771s | ||
- sys 0m31.703s | ||
- | ||
-In the above test, truss slowed the program from 38 seconds to 41. dtruss | ||
-slowed the program from 38 seconds to 46, slightly slower that truss... | ||
- | ||
-Now we try follow mode "-f". The test program does run several hundred | ||
-smaller programs, so now there are plenty more system calls to track, | ||
- | ||
- # time truss -f ./test 2> /dev/null | ||
- real 2m28.317s | ||
- user 0m0.893s | ||
- sys 0m3.527s | ||
- | ||
-Now we try dtruss, | ||
- | ||
- # time dtruss -f ./test 2> /dev/null | ||
- real 0m56.179s | ||
- user 0m10.040s | ||
- sys 0m38.185s | ||
- | ||
-Wow, the difference is huge! truss slows the program from 38 to 148 seconds; | ||
-but dtruss has only slowed the program from 38 to 56 seconds. | ||
- | ||
- | ||
- | ||
- |
@@ -1,91 +0,0 @@ | ||
-The following is a demonstration of the dvmstat program, | ||
- | ||
- | ||
-Here we run dvmstat to monitor all processes called "find". In another | ||
-window, a "find /" command is run, | ||
- | ||
- # dvmstat -n find | ||
- re maj mf fr epi epo api apo fpi fpo sy | ||
- 0 0 0 0 0 0 0 0 0 0 0 | ||
- 0 0 0 0 0 0 0 0 0 0 0 | ||
- 6336 0 372 0 0 0 0 0 0 0 22255 | ||
- 1624 0 0 0 0 0 0 0 0 0 5497 | ||
- 2292 0 0 0 0 0 0 0 0 0 7715 | ||
- 13064 0 0 0 0 0 0 0 0 0 43998 | ||
- 7972 168 0 0 0 0 0 0 168 0 38361 | ||
- 468 636 0 0 0 0 0 0 636 0 13774 | ||
- 376 588 0 0 0 0 0 0 588 0 10723 | ||
- 80 636 0 0 0 0 0 0 656 0 11078 | ||
- 48 772 0 0 0 0 0 0 812 0 9841 | ||
- 16 1028 0 0 0 0 0 0 1056 0 10752 | ||
- 0 1712 0 0 0 0 0 0 1740 0 12176 | ||
- 4 1224 0 0 0 0 0 0 1236 0 9024 | ||
- | ||
-The output above is spectacular! When the find command is first run, | ||
-it begins be reading data from the file cache, as indicated by the "re" | ||
-reclaims, and a lack of "fpi" filesystem page ins. | ||
- | ||
-Eventually the find command travels to places which are not cached, we can | ||
-see the "re" value drops, and both the "maj" major faults and "fpi" values | ||
-increase. This transition from cache hits to file system activity is | ||
-very clear from the above output. | ||
- | ||
- | ||
- | ||
-Here we run a dvmstat to examine the PID 3778, | ||
- | ||
- # dvmstat -p 3778 | ||
- re maj mf fr epi epo api apo fpi fpo sy | ||
- 0 0 0 0 0 0 0 0 0 0 0 | ||
- 0 0 0 0 0 0 0 0 0 0 0 | ||
- 24 28 0 0 0 0 0 0 28 0 109 | ||
- 4 148 16 0 0 0 0 0 148 0 1883 | ||
- 16 412 384 0 0 0 0 0 412 0 21019 | ||
- 0 0 0 0 0 0 0 0 0 0 3 | ||
- 0 0 0 0 0 0 0 0 0 0 221 | ||
- 0 0 0 0 0 0 0 0 0 0 0 | ||
- 0 0 0 0 0 0 0 0 0 0 84 | ||
- 0 0 0 0 0 0 0 0 0 0 0 | ||
- | ||
-Here we can see the statistics for that process only. | ||
- | ||
- | ||
- | ||
-The following runs the date command through dvmstat, | ||
- | ||
- # dvmstat date | ||
- Sun Jun 12 17:44:24 EST 2005 | ||
- re maj mf fr epi epo api apo fpi fpo sy | ||
- 16 0 208 0 0 0 0 0 0 0 38 | ||
- | ||
-The values above are for the date command only. | ||
- | ||
- | ||
- | ||
-Now we run dvmstat on a tar command. Here we tar around 50Mb of files, | ||
-so the command takes around 20 seconds to complete, | ||
- | ||
- # dvmstat tar cf backup.tar DTrace | ||
- re maj mf fr epi epo api apo fpi fpo sy | ||
- 20 256 304 0 8 0 0 0 352 0 621 | ||
- 4540 56 896 0 0 0 0 0 4636 0 1005 | ||
- 4432 12 644 0 0 0 0 0 4384 0 906 | ||
- 680 180 136 0 8 0 0 0 1056 0 502 | ||
- 2328 60 468 0 0 0 0 0 2296 0 592 | ||
- 1300 380 272 0 0 0 0 0 1704 0 1095 | ||
- 2816 72 560 0 0 0 0 0 2940 0 709 | ||
- 4084 40 416 0 0 0 0 0 4220 0 894 | ||
- 2764 4 276 0 0 0 0 0 2700 0 566 | ||
- 1824 96 328 0 0 0 0 0 2072 0 556 | ||
- 3408 80 392 0 20 0 0 0 3496 0 857 | ||
- 2804 92 552 0 4 0 0 0 2924 0 741 | ||
- 1344 16 272 0 0 0 0 0 1376 0 289 | ||
- 3284 52 520 0 12 0 0 0 3260 0 743 | ||
- 4832 200 812 0 0 0 0 0 5292 0 1276 | ||
- 11052 56 2200 0 0 0 0 0 8676 0 2326 | ||
- 5256 328 1020 0 8 0 0 0 4404 0 1725 | ||
- re maj mf fr epi epo api apo fpi fpo sy | ||
- 404 340 72 0 64 0 0 0 536 0 1135 | ||
- | ||
-Great! Activity from the tar command such as "fpi"s can be clearly seen. | ||
- |
@@ -1,90 +0,0 @@ | ||
-This is an example of the errinfo program, which prints details on syscall | ||
-failures. | ||
- | ||
-By default it "snoops" syscall failures and prints their details, | ||
- | ||
- # ./errinfo | ||
- EXEC SYSCALL ERR DESC | ||
- wnck-applet read 11 Resource temporarily unavailable | ||
- Xorg read 11 Resource temporarily unavailable | ||
- nautilus read 11 Resource temporarily unavailable | ||
- Xorg read 11 Resource temporarily unavailable | ||
- dsdm read 11 Resource temporarily unavailable | ||
- Xorg read 11 Resource temporarily unavailable | ||
- Xorg pollsys 4 interrupted system call | ||
- mozilla-bin lwp_park 62 timer expired | ||
- gnome-netstatus- | ||
- mozilla-bin lwp_park 62 timer expired | ||
- Xorg read 11 Resource temporarily unavailable | ||
[diff truncated] |