addq $8,%rsp /* turn into trapframe */
incl PCPU(cnt) + V_TIMER
+ movq TF_RIP(%rsp),%rbx /* sample addr before checking crit */
+ movq %rbx,PCPU(sample_pc)
movq PCPU(curthread),%rbx
testl $-1,TD_CRITCOUNT(%rbx)
jne 1f
ASSYM(GD_CNT, offsetof(struct mdglobaldata, mi.gd_cnt));
ASSYM(GD_CPUID, offsetof(struct mdglobaldata, mi.gd_cpuid));
ASSYM(GD_CPUMASK, offsetof(struct mdglobaldata, mi.gd_cpumask));
+ASSYM(GD_SAMPLE_PC, offsetof(struct mdglobaldata, mi.gd_sample_pc));
ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3));
ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15));
.globl gd_cnt, gd_private_tss
.globl gd_scratch_rsp
.globl gd_user_fs, gd_user_gs
+ .globl gd_sample_pc
.set gd_cpuid,globaldata + GD_CPUID
.set gd_cpumask,globaldata + GD_CPUMASK
.set gd_scratch_rsp,globaldata + GD_SCRATCH_RSP
.set gd_user_fs,globaldata + GD_USER_FS
.set gd_user_gs,globaldata + GD_USER_GS
+ .set gd_sample_pc,globaldata + GD_SAMPLE_PC
const char *gd_infomsg; /* debugging */
struct lwkt_tokref gd_handoff; /* hand-off tokref */
void *gd_delayed_wakeup[2];
- void *gd_preserved[6]; /* future fields */
+ void *gd_sample_pc; /* sample program ctr/tr */
+ void *gd_preserved[5]; /* future fields */
/* extended by <machine/globaldata.h> */
};