Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 2015 09:54:33 +0000 (UTC)
From:      Fabien Thomas <fabient@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289024 - head/sys/kern
Message-ID:  <201510080954.t989sXAx095653@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fabient
Date: Thu Oct  8 09:54:33 2015
New Revision: 289024
URL: https://svnweb.freebsd.org/changeset/base/289024

Log:
  Fix r283998 that broke mapin events for hwpmc.
  
  Reviewed by:	jhb
  Sponsored by:	Stormshield

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Thu Oct  8 09:46:35 2015	(r289023)
+++ head/sys/kern/vfs_vnops.c	Thu Oct  8 09:54:33 2015	(r289024)
@@ -43,6 +43,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_hwpmc_hooks.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/disk.h>
@@ -84,6 +86,10 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_page.h>
 #include <vm/vnode_pager.h>
 
+#ifdef HWPMC_HOOKS
+#include <sys/pmckern.h>
+#endif
+
 static fo_rdwr_t	vn_read;
 static fo_rdwr_t	vn_write;
 static fo_rdwr_t	vn_io_fault;
@@ -2461,7 +2467,7 @@ vn_mmap(struct file *fp, vm_map_t map, v
 	/* Inform hwpmc(4) if an executable is being mapped. */
 	if (error == 0 && (prot & VM_PROT_EXECUTE) != 0) {
 		pkm.pm_file = vp;
-		pkm.pm_address = (uintptr_t) addr;
+		pkm.pm_address = (uintptr_t) *addr;
 		PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
 	}
 #endif



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