提交 45c455ee 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

print progress in mapbench

上级 090cb072
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
static struct uspinlock l; static struct uspinlock l;
static volatile int tcount; static volatile int tcount;
enum { readaccess = 0 }; enum { readaccess = 0 };
enum { verbose = 1 };
void void
thr(void *arg) thr(void *arg)
...@@ -15,6 +16,9 @@ thr(void *arg) ...@@ -15,6 +16,9 @@ thr(void *arg)
u64 tid = (u64)arg; u64 tid = (u64)arg;
for (int i = 0; i < 10000; i++) { for (int i = 0; i < 10000; i++) {
if (verbose && ((i % 100) == 0))
printf(1, "%d: %d ops\n", tid, i);
volatile char *p = (char*) (0x40000UL + tid * 8 * 4096); volatile char *p = (char*) (0x40000UL + tid * 8 * 4096);
if (map((void *) p, 8 * 4096) < 0) { if (map((void *) p, 8 * 4096) < 0) {
printf(1, "%d: map failed\n", tid); printf(1, "%d: map failed\n", tid);
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论