提交 a8abd2eb 创建 作者: Austin Clements's avatar Austin Clements

Use ascope record mode to record all unique accesses in each ascope

上级 2bd97a93
...@@ -52,17 +52,13 @@ fssharing(void* arg) ...@@ -52,17 +52,13 @@ fssharing(void* arg)
char filename[32]; char filename[32];
snprintf(filename, sizeof(filename), "f%d", i); snprintf(filename, sizeof(filename), "f%d", i);
mtenable("xv6-fssharing");
open(filename, O_CREATE|O_RDWR); open(filename, O_CREATE|O_RDWR);
mtdisable("xv6-fssharing");
pthread_barrier_wait(&bar); pthread_barrier_wait(&bar);
for (u64 j = 0; j < ncore; j++) { for (u64 j = 0; j < ncore; j++) {
snprintf(filename, sizeof(filename), "f%d", j); snprintf(filename, sizeof(filename), "f%d", j);
mtenable("xv6-fssharing");
open(filename, O_RDWR); open(filename, O_RDWR);
mtdisable("xv6-fssharing");
} }
return 0; return 0;
} }
...@@ -79,11 +75,13 @@ main(int ac, char **av) ...@@ -79,11 +75,13 @@ main(int ac, char **av)
fprintf(1, "usage: %s vm|fs\n", av[0]); fprintf(1, "usage: %s vm|fs\n", av[0]);
if (op) { if (op) {
mtenable_type(mtrace_record_ascope, "xv6-asharing");
pthread_barrier_init(&bar, 0, ncore); pthread_barrier_init(&bar, 0, ncore);
for (u64 i = 0; i < ncore; i++) { for (u64 i = 0; i < ncore; i++) {
next(); next();
pthread_t tid; pthread_t tid;
pthread_create(&tid, 0, op, (void*) i); pthread_create(&tid, 0, op, (void*) i);
} }
mtdisable("xv6-asharing");
} }
} }
...@@ -34,6 +34,7 @@ char* strncpy(char *s, const char *t, size_t n); ...@@ -34,6 +34,7 @@ char* strncpy(char *s, const char *t, size_t n);
// Enable/disable all mtrace logging // Enable/disable all mtrace logging
#define mtenable(name) mtrace_enable_set(mtrace_record_movement, name) #define mtenable(name) mtrace_enable_set(mtrace_record_movement, name)
#define mtenable_type(type, name) mtrace_enable_set(type, name)
#define mtdisable(name) mtrace_enable_set(mtrace_record_disable, name) #define mtdisable(name) mtrace_enable_set(mtrace_record_disable, name)
// Log the number of operations // Log the number of operations
...@@ -54,6 +55,7 @@ static inline void mtops(u64 n) ...@@ -54,6 +55,7 @@ static inline void mtops(u64 n)
#define mtrec(cpu) do { } while (0) #define mtrec(cpu) do { } while (0)
#define mtign(cpu) do { } while (0) #define mtign(cpu) do { } while (0)
#define mtenable(name) do { } while (0) #define mtenable(name) do { } while (0)
#define mtenable_type(type, name) do { } while (0)
#define mtdisable(name) do { } while (0) #define mtdisable(name) do { } while (0)
#define mtops(n) do { } while (0) #define mtops(n) do { } while (0)
#endif #endif
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论