diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index bb9fbb5c728..cb808804c0f 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include "opt_ddb.h" +#include "opt_hwpmc_hooks.h" #include "opt_platform.h" #include @@ -53,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif + #include #include #include @@ -311,6 +316,10 @@ intr_irq_handler(struct trapframe *tf) irq_root_filter(irq_root_arg); td->td_intr_frame = oldframe; critical_exit(); +#ifdef HWPMC_HOOKS + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); +#endif } /*