aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hwpmc/hwpmc_mips.c
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2018-06-08 04:58:03 +0000
committerMatt Macy <mmacy@FreeBSD.org>2018-06-08 04:58:03 +0000
commiteb7c901995d407fa177d99270a2684f844db3921 (patch)
treec79e0ccbd28364293728029537d164a76ebddd86 /sys/dev/hwpmc/hwpmc_mips.c
parentdfa5753e0937b7b5b249ce129036d10dbad78496 (diff)
downloadsrc-eb7c901995d407fa177d99270a2684f844db3921.tar.gz
src-eb7c901995d407fa177d99270a2684f844db3921.zip
hwpmc: simplify calling convention for hwpmc interrupt handling
pmc_process_interrupt takes 5 arguments when only 3 are needed. cpu is always available in curcpu and inuserspace can always be derived from the passed trapframe. While facially a reasonable cleanup this change was motivated by the need to workaround a compiler bug. core2_intr(cpu, tf) -> pmc_process_interrupt(cpu, ring, pmc, tf, inuserspace) -> pmc_add_sample(cpu, ring, pm, tf, inuserspace) In the process of optimizing the tail call the tf pointer was getting clobbered: (kgdb) up at /storage/mmacy/devel/freebsd/sys/dev/hwpmc/hwpmc_mod.c:4709 4709 pmc_save_kernel_callchain(ps->ps_pc, (kgdb) up 1205 error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, resulting in a crash in pmc_save_kernel_callchain.
Notes
Notes: svn path=/head/; revision=334827
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_mips.c')
-rw-r--r--sys/dev/hwpmc/hwpmc_mips.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mips.c b/sys/dev/hwpmc/hwpmc_mips.c
index 7a27777d7578..99b8defff981 100644
--- a/sys/dev/hwpmc/hwpmc_mips.c
+++ b/sys/dev/hwpmc/hwpmc_mips.c
@@ -289,8 +289,7 @@ mips_pmc_intr(int cpu, struct trapframe *tf)
retval = 1;
if (pm->pm_state != PMC_STATE_RUNNING)
continue;
- error = pmc_process_interrupt(cpu, PMC_HR, pm, tf,
- TRAPF_USERMODE(tf));
+ error = pmc_process_interrupt(PMC_HR, pm, tf);
if (error) {
/* Clear/disable the relevant counter */
if (ri == 0)