Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 2008 19:40:36 +0000 (UTC)
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184700 - in head/sys: kern modules/zfs
Message-ID:  <200811051940.mA5JeapQ035688@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rodrigc
Date: Wed Nov  5 19:40:36 2008
New Revision: 184700
URL: http://svn.freebsd.org/changeset/base/184700

Log:
  Merge latest DTrace changes from Perforce.
  
  Approved by:	jb

Modified:
  head/sys/kern/kern_exec.c
  head/sys/kern/vfs_syscalls.c
  head/sys/modules/zfs/Makefile

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Wed Nov  5 19:39:37 2008	(r184699)
+++ head/sys/kern/kern_exec.c	Wed Nov  5 19:40:36 2008	(r184700)
@@ -388,8 +388,6 @@ do_execve(td, args, mac_p)
 
 	imgp->image_header = NULL;
 
-	SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 );
-
 	/*
 	 * Translate the file name. namei() returns a vnode pointer
 	 *	in ni_vp amoung other things.
@@ -403,6 +401,8 @@ do_execve(td, args, mac_p)
 		    | MPSAFE | AUDITVNODE1, UIO_SYSSPACE, args->fname, td);
 	}
 
+	SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 );
+
 interpret:
 	if (args->fname != NULL) {
 		error = namei(ndp);
@@ -800,8 +800,9 @@ interpret:
 
 	vfs_mark_atime(imgp->vp, td->td_ucred);
 
-done1:
+	SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0);
 
+done1:
 	/*
 	 * Free any resources malloc'd earlier that we didn't use.
 	 */
@@ -812,8 +813,6 @@ done1:
 		crfree(newcred);
 	VOP_UNLOCK(imgp->vp, 0);
 
-	SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0);
-
 	/*
 	 * Handle deferred decrement of ref counts.
 	 */

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Wed Nov  5 19:39:37 2008	(r184699)
+++ head/sys/kern/vfs_syscalls.c	Wed Nov  5 19:40:36 2008	(r184700)
@@ -38,6 +38,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_compat.h"
+#include "opt_kdtrace.h"
 #include "opt_ktrace.h"
 #include "opt_mac.h"
 
@@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/filio.h>
 #include <sys/limits.h>
 #include <sys/linker.h>
+#include <sys/sdt.h>
 #include <sys/stat.h>
 #include <sys/sx.h>
 #include <sys/unistd.h>
@@ -82,6 +84,14 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_page.h>
 #include <vm/uma.h>
 
+SDT_PROVIDER_DEFINE(vfs);
+SDT_PROBE_DEFINE(vfs, , stat, mode);
+SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *");
+SDT_PROBE_ARGTYPE(vfs, , stat, mode, 1, "int");
+SDT_PROBE_DEFINE(vfs, , stat, reg);
+SDT_PROBE_ARGTYPE(vfs, , stat, reg, 0, "char *");
+SDT_PROBE_ARGTYPE(vfs, , stat, reg, 1, "int");
+
 static int chroot_refuse_vdir_fds(struct filedesc *fdp);
 static int getutimes(const struct timeval *, enum uio_seg, struct timespec *);
 static int setfown(struct thread *td, struct vnode *, uid_t, gid_t);
@@ -2334,6 +2344,11 @@ kern_statat(struct thread *td, int flag,
 		return (error);
 	vfslocked = NDHASGIANT(&nd);
 	error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
+	if (!error) {
+		SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0);
+		if (S_ISREG(sb.st_mode))
+			SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0);
+	}
 	NDFREE(&nd, NDF_ONLY_PNBUF);
 	vput(nd.ni_vp);
 	VFS_UNLOCK_GIANT(vfslocked);

Modified: head/sys/modules/zfs/Makefile
==============================================================================
--- head/sys/modules/zfs/Makefile	Wed Nov  5 19:39:37 2008	(r184699)
+++ head/sys/modules/zfs/Makefile	Wed Nov  5 19:40:36 2008	(r184700)
@@ -78,6 +78,7 @@ CFLAGS+=-I${.CURDIR}/../..
 CFLAGS+=-I${SUNW}/common/zfs
 CFLAGS+=-I${SUNW}/common
 CFLAGS+=-I${.CURDIR}/../../../include
+CFLAGS+=-DBUILDING_ZFS
 
 #CFLAGS+=-DDEBUG=1
 #DEBUG_FLAGS=-g



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811051940.mA5JeapQ035688>