Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2016 23:27:08 +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: r300809 - head/sys/dev/filemon
Message-ID:  <201605262327.u4QNR84u073919@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu May 26 23:27:08 2016
New Revision: 300809
URL: https://svnweb.freebsd.org/changeset/base/300809

Log:
  filemon exec: Use imgp->execpath rather than vn_fullpath(9).
  
  This will be more accurate as the actual name is provided if ran
  from an absolute path in do_execve().
  
  MFC after:	2 weeks
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/dev/filemon/filemon_wrapper.c

Modified: head/sys/dev/filemon/filemon_wrapper.c
==============================================================================
--- head/sys/dev/filemon/filemon_wrapper.c	Thu May 26 23:20:44 2016	(r300808)
+++ head/sys/dev/filemon/filemon_wrapper.c	Thu May 26 23:27:08 2016	(r300809)
@@ -102,24 +102,17 @@ filemon_event_process_exec(void *arg __u
     struct image_params *imgp)
 {
 	struct filemon *filemon;
-	char *fullpath, *freepath;
 	size_t len;
 
 	if ((filemon = filemon_proc_get(p)) != NULL) {
-		fullpath = "<unknown>";
-		freepath = NULL;
-
-		vn_fullpath(curthread, imgp->vp, &fullpath, &freepath);
-
 		len = snprintf(filemon->msgbufr,
 		    sizeof(filemon->msgbufr), "E %d %s\n",
-		    p->p_pid, fullpath);
+		    p->p_pid,
+		    imgp->execpath != NULL ? imgp->execpath : "<unknown>");
 
 		filemon_output(filemon, filemon->msgbufr, len);
 
 		filemon_drop(filemon);
-
-		free(freepath, M_TEMP);
 	}
 }
 



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