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

Make every ascope depend on the thread's kstack, instead of depending on the thread everywhere

上级 febb2ae4
......@@ -64,6 +64,9 @@ static inline void mtresume(struct proc *p)
#define mtrec() mtrace_call_set(1, ~0ull)
#define mtign() mtrace_call_set(0, ~0ull)
static inline void mtreadavar(const char *fmt, ...);
static inline void mtwriteavar(const char *fmt, ...);
class mt_ascope
{
char name[64];
......@@ -96,6 +99,7 @@ public:
{
vsnprintf(name, sizeof(name) - 1, fmt, ap);
mtrace_ascope_register(0, name);
mtwriteavar("kstack:%p", myproc()->kstack);
active = true;
}
......
......@@ -299,7 +299,6 @@ sys_openat(int dirfd, const char *path, int omode)
// Reads the dirfd FD, dirfd's inode, the inodes of all files in
// path; writes the returned FD
mt_ascope ascope("%s(%d,%s,%d)", __func__, dirfd, path, omode);
mtwriteavar("thread:%x", myproc()->pid);
mtreadavar("inode:%x.%x", cwd->dev, cwd->inum);
if(omode & O_CREATE){
......
......@@ -105,7 +105,6 @@ sys_map(userptr<void> addr, size_t len)
#if MTRACE
mt_ascope ascope("%s(%p,%lx)", __func__, addr, len);
mtwriteavar("thread:%x", myproc()->pid);
for (uptr i = PGROUNDDOWN(addr); i < PGROUNDUP(addr + len); i += PGSIZE)
mtwriteavar("page:%016x", i);
#endif
......@@ -131,7 +130,6 @@ sys_unmap(userptr<void> addr, size_t len)
#if MTRACE
mt_ascope ascope("%s(%p,%lx)", __func__, addr, len);
mtwriteavar("thread:%x", myproc()->pid);
for (uptr i = PGROUNDDOWN(addr); i < PGROUNDUP(addr + len); i += PGSIZE)
mtwriteavar("page:%016x", i);
#endif
......@@ -179,7 +177,6 @@ sys_futex(const u64* addr, int op, u64 val, u64 timer)
return -1;
mt_ascope ascope("%s(%p,%d,%lu,%lu)", __func__, addr, op, val, timer);
mtwriteavar("thread:%x", myproc()->pid);
switch(op) {
case FUTEX_WAIT:
......
......@@ -637,7 +637,6 @@ pagefault(vmap *vmap, uptr va, u32 err)
{
#if MTRACE
mt_ascope ascope("%s(%p)", __func__, va);
mtwriteavar("thread:%x", myproc()->pid);
mtwriteavar("page:%p.%016x", vmap, PGROUNDDOWN(va));
#endif
......@@ -688,7 +687,6 @@ pagelookup(vmap* vmap, uptr va)
{
#if MTRACE
mt_ascope ascope("%s(%p)", __func__, va);
mtwriteavar("thread:%x", myproc()->pid);
mtwriteavar("page:%p.%016x", vmap, PGROUNDDOWN(va));
#endif
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论