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

Control-w dumps work queue stats.

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