Date: Wed, 27 Jan 2016 21:17:44 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294953 - head/sys/dev/filemon Message-ID: <201601272117.u0RLHiE6098846@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Wed Jan 27 21:17:43 2016 New Revision: 294953 URL: https://svnweb.freebsd.org/changeset/base/294953 Log: filemon_comment has nothing to do with wrappers so move it out of filemon_wrapper.c. It only prints the header from filemon_ioctl. Keep the name though to stay closer to other implementations. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Wed Jan 27 21:14:09 2016 (r294952) +++ head/sys/dev/filemon/filemon.c Wed Jan 27 21:17:43 2016 (r294953) @@ -105,6 +105,22 @@ static struct cdev *filemon_dev; #include "filemon_wrapper.c" static void +filemon_comment(struct filemon *filemon) +{ + int len; + struct timeval now; + + getmicrotime(&now); + + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), + "# filemon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", + FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, + (uintmax_t)now.tv_usec, FILEMON_VERSION); + + filemon_output(filemon, filemon->msgbufr, len); +} + +static void filemon_dtr(void *data) { struct filemon *filemon = data; Modified: head/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- head/sys/dev/filemon/filemon_wrapper.c Wed Jan 27 21:14:09 2016 (r294952) +++ head/sys/dev/filemon/filemon_wrapper.c Wed Jan 27 21:17:43 2016 (r294953) @@ -109,22 +109,6 @@ filemon_pid_check(struct proc *p) return (NULL); } -static void -filemon_comment(struct filemon *filemon) -{ - int len; - struct timeval now; - - getmicrotime(&now); - - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), - "# filemon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", - FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, - (uintmax_t)now.tv_usec, FILEMON_VERSION); - - filemon_output(filemon, filemon->msgbufr, len); -} - static int filemon_wrapper_chdir(struct thread *td, struct chdir_args *uap) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601272117.u0RLHiE6098846>