提交 c366d4db 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Merge 'flicts

......@@ -162,10 +162,10 @@ kerneltrap(struct trapframe *tf)
kstack = myproc()->kstack;
}
__cprintf("kernel trap %u cpu %u\n"
" tf: rip %p rsp %p cr2 %p\n"
" tf: rip %p rsp %p rbp %p cr2 %p cs %p\n"
" proc: name %s pid %u kstack %p\n",
tf->trapno, mycpu()->id,
tf->rip, tf->rsp, rcr2(),
tf->rip, tf->rsp, tf->rbp, rcr2(), tf->cs,
name, pid, kstack);
printtrace(tf->rbp);
......@@ -235,6 +235,10 @@ consoleintr(int (*getc)(void))
case C('P'): // Process listing.
procdumpall();
break;
case C('E'): // Print user-space PCs.
for (u32 i = 0; i < NCPU; i++)
cpus[i].timer_printpc = 1;
break;
case C('U'): // Kill line.
while(input.e != input.w &&
input.buf[(input.e-1) % INPUT_BUF] != '\n'){
......
......@@ -11,6 +11,7 @@ struct cpu {
struct taskstate ts; // Used by x86 to find stack for interrupt
struct context *scheduler; // swtch() here to enter scheduler
struct cilkframe *cilkframe;
int timer_printpc;
// Cpu-local storage variables; see below
struct cpu *cpu;
......
......@@ -51,7 +51,7 @@ main(int ac, char **av)
int nthread = atoi(av[1]);
acquire(&l);
printf(1, "mapbench[%d]: start esp %x, nthread=%d\n", getpid(), rrsp(), nthread);
// printf(1, "mapbench[%d]: start esp %x, nthread=%d\n", getpid(), rrsp(), nthread);
for(int i = 0; i < nthread; i++) {
sbrk(8192);
......@@ -72,7 +72,7 @@ main(int ac, char **av)
acquire(&l);
}
release(&l);
printf(1, "mapbench[%d]: done\n", getpid());
// printf(1, "mapbench[%d]: done\n", getpid());
for(int i = 0; i < nthread; i++)
wait();
......
......@@ -71,8 +71,15 @@ trap(struct trapframe *tf)
switch(tf->trapno){
case T_IRQ0 + IRQ_TIMER:
if (mycpu()->timer_printpc) {
cprintf("cpu%d: proc %s rip %lx rsp %lx cs %x\n",
mycpu()->id,
myproc() ? myproc()->name : "(none)",
tf->rip, tf->rsp, tf->cs);
mycpu()->timer_printpc = 0;
}
if (mycpu()->id == 0)
cv_tick();
cv_tick();
lapiceoi();
break;
case T_IRQ0 + IRQ_IDE:
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论