+ dtrace_probe(prof->prof_id, 0x0, regs->eip, late, 0, 0);
+ }
+ }
+#elif defined(__arm__)
+ {
+ arm_saved_state_t *arm_kern_regs = (arm_saved_state_t *) find_kern_regs(current_thread());
+
+ // We should only come in here from interrupt context, so we should always have valid kernel regs
+ assert(NULL != arm_kern_regs);
+
+ if (arm_kern_regs->cpsr & 0xF) {
+ /* Kernel was interrupted. */
+ dtrace_probe(prof->prof_id, arm_kern_regs->pc, 0x0, late, 0, 0);
+ } else {
+ /* Possibly a user interrupt */
+ arm_saved_state_t *arm_user_regs = (arm_saved_state_t *)find_user_regs(current_thread());
+
+ if (NULL == arm_user_regs) {
+ /* Too bad, so sad, no useful interrupt state. */
+ dtrace_probe(prof->prof_id, 0xcafebabe, 0x0, late, 0, 0); /* XXX_BOGUS also see profile_usermode() below. */
+ } else {
+ dtrace_probe(prof->prof_id, 0x0, arm_user_regs->pc, late, 0, 0);
+ }
+ }
+ }
+#elif defined(__arm64__)
+ {
+ arm_saved_state_t *arm_kern_regs = (arm_saved_state_t *) find_kern_regs(current_thread());
+
+ // We should only come in here from interrupt context, so we should always have valid kernel regs
+ assert(NULL != arm_kern_regs);
+
+ if (saved_state64(arm_kern_regs)->cpsr & 0xF) {
+ /* Kernel was interrupted. */
+ dtrace_probe(prof->prof_id, saved_state64(arm_kern_regs)->pc, 0x0, late, 0, 0);
+ } else {
+ /* Possibly a user interrupt */
+ arm_saved_state_t *arm_user_regs = (arm_saved_state_t *)find_user_regs(current_thread());
+
+ if (NULL == arm_user_regs) {
+ /* Too bad, so sad, no useful interrupt state. */
+ dtrace_probe(prof->prof_id, 0xcafebabe, 0x0, late, 0, 0); /* XXX_BOGUS also see profile_usermode() below. */
+ } else {
+ dtrace_probe(prof->prof_id, 0x0, get_saved_state_pc(arm_user_regs), late, 0, 0);
+ }