preadtest command-line option to enable syscall hacks

上级 a2ab32e5
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#define BSIZE 4096 #define BSIZE 4096
#define PSIZE (4*BSIZE) #define PSIZE (4*BSIZE)
static int usekernlet;
static char buf[BSIZE]; static char buf[BSIZE];
struct ipcctl *ipcctl = (struct ipcctl*)KSHARED; struct ipcctl *ipcctl = (struct ipcctl*)KSHARED;
...@@ -56,6 +58,9 @@ main(int ac, char **av) ...@@ -56,6 +58,9 @@ main(int ac, char **av)
u64 t0, t1; u64 t0, t1;
int i, k; int i, k;
int fd; int fd;
if (ac > 1)
usekernlet = av[1][0] == 'k';
fd = open("preadtest.x", O_CREATE|O_RDWR); fd = open("preadtest.x", O_CREATE|O_RDWR);
if (fd < 0) if (fd < 0)
...@@ -74,7 +79,8 @@ main(int ac, char **av) ...@@ -74,7 +79,8 @@ main(int ac, char **av)
die("pread failed"); die("pread failed");
} }
t1 = rdtsc(); t1 = rdtsc();
printf(1, "usekernlet %u\n", usekernlet);
printf(1, "cycles %lu\n", t1 - t0); printf(1, "cycles %lu\n", t1 - t0);
exit(); exit();
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论