mtenable/mtdisable for filebench

上级 4d59fb8a
......@@ -69,7 +69,7 @@ main(int ac, char** av)
mkdir("/dbx");
mtenable("xv6-schedbench");
mtenable("xv6-dirbench");
u64 t0 = rdtsc();
for(u32 i = 0; i < nthread; i++) {
int pid = fork(0);
......@@ -82,7 +82,7 @@ main(int ac, char** av)
for (u32 i = 0; i < nthread; i++)
wait();
u64 t1 = rdtsc();
mtdisable("xv6-schedbench");
mtdisable("xv6-dirbench");
printf("dirbench: %lu\n", t1-t0);
return 0;
......
......@@ -7,12 +7,15 @@
#define xfork() fork()
#define xexit() exit(EXIT_SUCCESS)
#define xcreat(name) open((name), O_CREATE|O_WRONLY, S_IRUSR|S_IWUSR)
#define mtenable(x) do { } while(0)
#define mtdisable(x) do { } while(0)
typedef uint64_t u64;
#else
#include "types.h"
#include "user.h"
#include "fcntl.h"
#include "amd64.h"
#include "mtrace.h"
#define xfork() fork(0)
#define xexit() exit()
#define xcreat(name) open((name), O_CREATE|O_WRONLY)
......@@ -78,6 +81,7 @@ main(int ac, char **av)
}
close(fd);
mtenable("xv6-filebench");
u64 t0 = rdtsc();
for (int i = 0; i < nthread; i++) {
int pid = xfork();
......@@ -90,6 +94,7 @@ main(int ac, char **av)
for (int i = 0; i < nthread; i++)
wait();
u64 t1 = rdtsc();
mtdisable("xv6-filebench");
printf("filebench: %lu\n", t1-t0);
return 0;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论