PERFORCE change 145532 for review

John Birrell jb at FreeBSD.org
Mon Jul 21 04:53:15 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=145532

Change 145532 by jb at freebsd3 on 2008/07/21 04:52:32

	Add a couple of probes for convenient stat() access when the call
	returns no error. One fires for all modes, if enabled. The other is
	more restrictive and only fires for regular files, if enabled.

Affected files ...

.. //depot/projects/dtrace/src/sys/kern/vfs_syscalls.c#25 edit

Differences ...

==== //depot/projects/dtrace/src/sys/kern/vfs_syscalls.c#25 (text+ko) ====

@@ -38,6 +38,7 @@
 __FBSDID("$FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.454 2008/06/22 21:51:32 rwatson Exp $");
 
 #include "opt_compat.h"
+#include "opt_kdtrace.h"
 #include "opt_ktrace.h"
 #include "opt_mac.h"
 
@@ -58,6 +59,7 @@
 #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,13 @@
 #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 *");
+
 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);
@@ -2344,6 +2353,10 @@
 	if (KTRPOINT(td, KTR_STRUCT))
 		ktrstat(&sb);
 #endif
+	SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0);
+	if (S_ISREG(sb.st_mode)) {
+		SDT_PROBE(vfs, , stat, reg, path, 0, 0, 0, 0);
+	}
 	return (0);
 }
 


More information about the p4-projects mailing list