svn commit: r297157 - in head: share/man/man4 sys/dev/filemon
Bryan Drewery
bdrewery at FreeBSD.org
Mon Mar 21 20:29:43 UTC 2016
Author: bdrewery
Date: Mon Mar 21 20:29:39 2016
New Revision: 297157
URL: https://svnweb.freebsd.org/changeset/base/297157
Log:
Stop tracking stat(2).
None of lstat(2), fstat(2), fstatat(2) were tracked either.
The other filemon implementations also do not track stat(2), nor
does bmake utilize it. The act of opening a file for read should
be enough to decide that a file is a dependency. There could be
rare cases where just having a file would cause a dependency but it
is unlikely.
MFC after: 2 weeks
Also noted by: sjg
Sponsored by: EMC / Isilon Storage Division
Modified:
head/share/man/man4/filemon.4
head/sys/dev/filemon/filemon_wrapper.c
Modified: head/share/man/man4/filemon.4
==============================================================================
--- head/share/man/man4/filemon.4 Mon Mar 21 20:29:27 2016 (r297156)
+++ head/share/man/man4/filemon.4 Mon Mar 21 20:29:39 2016 (r297157)
@@ -83,8 +83,6 @@ System calls are denoted using the follo
.It Ql R
.Xr open 2
for read
-.It Ql S
-.Xr stat 2
.It Ql W
.Xr open 2
for write
Modified: head/sys/dev/filemon/filemon_wrapper.c
==============================================================================
--- head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:27 2016 (r297156)
+++ head/sys/dev/filemon/filemon_wrapper.c Mon Mar 21 20:29:39 2016 (r297157)
@@ -321,61 +321,6 @@ filemon_wrapper_linkat(struct thread *td
return (ret);
}
-static int
-filemon_wrapper_stat(struct thread *td, struct stat_args *uap)
-{
- int ret;
- size_t done;
- size_t len;
- struct filemon *filemon;
-
- if ((ret = sys_stat(td, uap)) == 0) {
- if ((filemon = filemon_proc_get(curproc)) != NULL) {
- copyinstr(uap->path, filemon->fname1,
- sizeof(filemon->fname1), &done);
-
- len = snprintf(filemon->msgbufr,
- sizeof(filemon->msgbufr), "S %d %s\n",
- curproc->p_pid, filemon->fname1);
-
- filemon_output(filemon, filemon->msgbufr, len);
-
- filemon_drop(filemon);
- }
- }
-
- return (ret);
-}
-
-#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32)
-static int
-filemon_wrapper_freebsd32_stat(struct thread *td,
- struct freebsd32_stat_args *uap)
-{
- int ret;
- size_t done;
- size_t len;
- struct filemon *filemon;
-
- if ((ret = freebsd32_stat(td, uap)) == 0) {
- if ((filemon = filemon_proc_get(curproc)) != NULL) {
- copyinstr(uap->path, filemon->fname1,
- sizeof(filemon->fname1), &done);
-
- len = snprintf(filemon->msgbufr,
- sizeof(filemon->msgbufr), "S %d %s\n",
- curproc->p_pid, filemon->fname1);
-
- filemon_output(filemon, filemon->msgbufr, len);
-
- filemon_drop(filemon);
- }
- }
-
- return (ret);
-}
-#endif
-
static void
filemon_event_process_exit(void *arg __unused, struct proc *p)
{
@@ -480,7 +425,6 @@ filemon_wrapper_install(void)
sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open;
sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat;
sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename;
- sv_table[SYS_stat].sy_call = (sy_call_t *) filemon_wrapper_stat;
sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink;
sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link;
sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink;
@@ -493,7 +437,6 @@ filemon_wrapper_install(void)
sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open;
sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat;
sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename;
- sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_stat;
sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink;
sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link;
sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink;
@@ -521,7 +464,6 @@ filemon_wrapper_deinstall(void)
sv_table[SYS_open].sy_call = (sy_call_t *)sys_open;
sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat;
sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename;
- sv_table[SYS_stat].sy_call = (sy_call_t *)sys_stat;
sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink;
sv_table[SYS_link].sy_call = (sy_call_t *)sys_link;
sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink;
@@ -534,7 +476,6 @@ filemon_wrapper_deinstall(void)
sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *)sys_open;
sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *)sys_openat;
sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *)sys_rename;
- sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *)freebsd32_stat;
sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *)sys_unlink;
sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *)sys_link;
sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *)sys_symlink;
More information about the svn-src-head
mailing list