Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jun 2018 21:17:31 +0000 (UTC)
From:      Matt Macy <mmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334637 - head/sys/dev/hwpmc
Message-ID:  <201806042117.w54LHV3i084296@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmacy
Date: Mon Jun  4 21:17:30 2018
New Revision: 334637
URL: https://svnweb.freebsd.org/changeset/base/334637

Log:
  hwpmc: don't defer user callchain capture completion to ast

Modified:
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_mod.c	Mon Jun  4 21:05:56 2018	(r334636)
+++ head/sys/dev/hwpmc/hwpmc_mod.c	Mon Jun  4 21:17:30 2018	(r334637)
@@ -1715,11 +1715,9 @@ pmc_process_thread_delete(struct thread *td)
 static void
 pmc_process_thread_userret(struct thread *td)
 {
-
-	thread_lock(td);
-	curthread->td_flags |= TDF_ASTPENDING;
-	thread_unlock(td);
-	pmc_post_callchain_callback();
+	sched_pin();
+	pmc_capture_user_callchain(curcpu, PMC_UR, td->td_frame);
+	sched_unpin();
 }
 
 /*
@@ -2253,8 +2251,6 @@ pmc_hook_handler(struct thread *td, int function, void
 
 		cpu = PCPU_GET(cpuid);
 		pmc_capture_user_callchain(cpu, PMC_SR,
-		    (struct trapframe *) arg);
-		pmc_capture_user_callchain(cpu, PMC_UR,
 		    (struct trapframe *) arg);
 
 		KASSERT(td->td_pinned == 1,



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