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

Control-w dumps work queue stats.

上级 c7d9a2ad
......@@ -296,6 +296,9 @@ consoleintr(int (*getc)(void))
consputc(BACKSPACE);
}
break;
case C('W'): // Work queue stats
wq_dump();
break;
default:
if(c != 0 && input.e-input.r < INPUT_BUF){
c = (c == '\r') ? '\n' : c;
......
......@@ -277,4 +277,5 @@ struct vmap * vmap_copy(struct vmap *, int);
void wq_push(void *rip, u64 arg0, u64 arg1);
void wq_start(void);
void wq_end(void);
void wq_dump(void);
void initwqframe(struct wqframe *wq);
......@@ -204,6 +204,15 @@ wq_end(void)
popcli();
}
void
wq_dump(void)
{
int i;
for (i = 0; i < NCPU; i++)
cprintf("push %lu full %lu pop %lu steal %lu\n",
stat[i].push, stat[i].full, stat[i].pop, stat[i].steal);
}
static void
__test_stub(uptr a0, uptr a1)
{
......@@ -228,9 +237,7 @@ testwq(void)
wq_end();
e = rdtsc();
cprintf("testwq: %lu\n", (e-s)/iters);
for (i = 0; i < NCPU; i++)
cprintf("push %lu full %lu pop %lu steal %lu\n",
stat[i].push, stat[i].full, stat[i].pop, stat[i].steal);
wq_dump();
running = 0;
} else {
while (running)
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论