Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
1be8db63
提交
1be8db63
10月 28, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Return of the Mtrace.
上级
781658d0
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
146 行增加
和
145 行删除
+146
-145
.gitignore
.gitignore
+1
-1
Makefile
Makefile
+23
-11
dirbench.c
dirbench.c
+1
-1
forkexectree.c
forkexectree.c
+1
-1
forktest.c
forktest.c
+1
-1
forktree.c
forktree.c
+1
-1
kalloc.c
kalloc.c
+5
-25
kmtrace.h
kmtrace.h
+16
-11
mapbench.c
mapbench.c
+1
-1
maptest.c
maptest.c
+1
-1
mtrace.h
mtrace.h
+48
-0
proc.c
proc.c
+17
-14
rcu.c
rcu.c
+2
-2
spinlock.c
spinlock.c
+4
-30
spinlock.h
spinlock.h
+8
-0
syscall.c
syscall.c
+5
-5
thrtest.c
thrtest.c
+1
-1
trap.c
trap.c
+9
-9
usertests.c
usertests.c
+1
-1
xv6-mtrace.h
xv6-mtrace.h
+0
-29
没有找到文件。
.gitignore
浏览文件 @
1be8db63
...
...
@@ -19,5 +19,5 @@ mkfs
/mscan.out
/mscan.sorted
/mscan.syms
/mscan.kern
/mscan.kern
el
config.mk
Makefile
浏览文件 @
1be8db63
...
...
@@ -2,22 +2,23 @@
# XXX compiling user progs with -mcmodel=kernel
#
# Custom config file?
Set the default below.
.
# Custom config file?
Otherwise use defaults
.
-include
config.mk
TOOLPREFIX
?=
x86_64-jos-elf-
QEMU
?=
qemu-system-x86_64
CPUS
?=
4
QEMUSMP
?=
4
QEMUSRC
?=
../mtrace
MTRACE
?=
$(QEMU)
NM
=
$(TOOLPREFIX)
nm
#CC = $(TOOLPREFIX)clang
CC
=
$(TOOLPREFIX)
clang
CC
=
$(TOOLPREFIX)
gcc
AS
=
$(TOOLPREFIX)
gas
LD
=
$(TOOLPREFIX)
ld
NM
=
$(TOOLPREFIX)
nm
OBJCOPY
=
$(TOOLPREFIX)
objcopy
OBJDUMP
=
$(TOOLPREFIX)
objdump
CFLAGS
=
-fno-pic
-static
-fno-builtin
-fno-strict-aliasing
-O2
-Wall
-MD
-ggdb
-m64
\
-Werror
-std
=
c99
-fms-extensions
-mno-sse
-mcmodel
=
kernel
CFLAGS
=
-fno-pic
-static
-fno-builtin
-fno-strict-aliasing
-O2
-Wall
-MD
-ggdb
\
-m64
-Werror
-std
=
c99
-fms-extensions
-mno-sse
-mcmodel
=
kernel
-I
$(QEMUSRC)
CFLAGS
+=
$(
shell
$(CC)
-fno-stack-protector
-E
-x
c /dev/null
>
/dev/null 2>&1
&&
echo
-fno-stack-protector
)
ASFLAGS
=
-m64
-gdwarf-2
LDFLAGS
+=
-m
elf_x86_64
...
...
@@ -91,18 +92,29 @@ mkfs: mkfs.c fs.h
fs.img
:
mkfs README $(UPROGS)
./mkfs fs.img README
$(UPROGS)
mscan.syms
:
kernel
$(NM)
-S
$<
>
$@
mscan.kernel
:
kernel
cp
$<
$@
-include
*.d
.PHONY
:
clean qemu gdb ud0
clean
:
rm
-f
*
.o
*
.d
*
.asm
*
.sym initcode kernel bootother mkfs fs.img
QEMUOPTS
=
-smp
$(QEMUSMP)
-m
512
-serial
mon:stdio
-nographic
MTRACEOPTS
=
-rtc
clock
=
vm
-mtrace-enable
-mtrace-file
mtrace.out
\
-mtrace-quantum
100
QEMUOPTS
=
-smp
$(CPUS)
-m
512
-serial
mon:stdio
-nographic
qemu
:
kernel
$(QEMU)
$(QEMUOPTS)
-kernel
kernel
gdb
:
kernel
$(QEMU)
$(QEMUOPTS)
-kernel
kernel
-S
-s
mtrace
:
mscan.kernel mscan.syms
$(MTRACE)
$(QEMUOPTS)
$(MTRACEOPTS)
-kernel
kernel
ud0
:
kernel
rsync
-avP
kernel amsterdam.csail.mit.edu:/tftpboot/ud0/kernel.xv6
clean
:
rm
-f
*
.o
*
.d
*
.asm
*
.sym initcode kernel bootother mkfs fs.img
dirbench.c
浏览文件 @
1be8db63
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#include "amd64.h"
#include "param.h"
#include "fcntl.h"
...
...
forkexectree.c
浏览文件 @
1be8db63
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#define NCHILD 2
#define NDEPTH 7
...
...
forktest.c
浏览文件 @
1be8db63
...
...
@@ -4,7 +4,7 @@
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#define N 100
#define DEBUG 0
...
...
forktree.c
浏览文件 @
1be8db63
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#define NCHILD 2
#define NDEPTH 5
...
...
kalloc.c
浏览文件 @
1be8db63
...
...
@@ -8,7 +8,7 @@
#include "kernel.h"
#include "spinlock.h"
#include "kalloc.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#include "cpu.h"
struct
kmem
kmems
[
NCPU
];
...
...
@@ -55,12 +55,7 @@ kfree_pool(struct kmem *m, char *v)
m
->
freelist
=
r
;
m
->
nfree
++
;
if
(
kinited
)
mtrace_label_register
(
mtrace_label_block
,
r
,
0
,
0
,
0
,
RET_EIP
());
mtunlabel
(
mtrace_label_block
,
r
);
release
(
&
m
->
lock
);
}
...
...
@@ -101,12 +96,7 @@ kmemalloc(struct kmem *km)
return
0
;
}
mtrace_label_register
(
mtrace_label_block
,
r
,
m
->
size
,
"kalloc"
,
sizeof
(
"kalloc"
),
RET_EIP
());
mtlabel
(
mtrace_label_block
,
r
,
m
->
size
,
"kalloc"
,
sizeof
(
"kalloc"
));
if
(
kalloc_memset
)
memset
(
r
,
2
,
m
->
size
);
...
...
@@ -224,12 +214,7 @@ kmfree(void *ap)
{
acquire
(
&
freelists
[
mycpu
()
->
id
].
lock
);
domfree
(
ap
);
mtrace_label_register
(
mtrace_label_heap
,
ap
,
0
,
0
,
0
,
RET_EIP
());
mtunlabel
(
mtrace_label_heap
,
ap
);
release
(
&
freelists
[
mycpu
()
->
id
].
lock
);
}
...
...
@@ -289,12 +274,7 @@ kmalloc(u64 nbytes)
release
(
&
freelists
[
mycpu
()
->
id
].
lock
);
if
(
r
)
mtrace_label_register
(
mtrace_label_heap
,
r
,
nbytes
,
"kmalloc'ed"
,
sizeof
(
"kmalloc'ed"
),
RET_EIP
());
mtlabel
(
mtrace_label_heap
,
r
,
nbytes
,
"kmalloc'ed"
,
sizeof
(
"kmalloc'ed"
));
return
r
;
}
...
...
xv6-
kmtrace.h
→
kmtrace.h
浏览文件 @
1be8db63
#include "xv6-mtrace.h"
#include "mtrace.h"
#if MTRACE
// Tell mtrace about switching threads
struct
kstack_tag
{
int
val
__attribute__
((
aligned
(
CACHELINE
)))
;
int
val
__mpalign__
;
};
extern
struct
kstack_tag
kstack_tag
[
NCPU
];
static
inline
void
mtrace_kstack_start
(
void
*
eip
,
struct
proc
*
p
)
static
inline
void
mtstart
(
void
*
ip
,
struct
proc
*
p
)
{
unsigned
long
new_tag
;
int
i
;
pushcli
();
xchg
((
uint
*
)
&
i
,
0
);
new_tag
=
++
(
kstack_tag
[
cpu
->
id
].
val
)
|
(
cpu
->
id
<<
MTRACE_TAGSHIFT
);
new_tag
=
++
(
kstack_tag
[
mycpu
()
->
id
].
val
)
|
(
mycpu
()
->
id
<<
MTRACE_TAGSHIFT
);
i
=
++
p
->
mtrace_stacks
.
curr
;
if
(
i
>=
MTRACE_NSTACKS
)
panic
(
"mtrace_kstack_start: ran out of slots"
);
p
->
mtrace_stacks
.
tag
[
i
]
=
new_tag
;
mtrace_fcall_register
(
p
->
pid
,
(
unsigned
long
)
e
ip
,
mtrace_fcall_register
(
p
->
pid
,
(
unsigned
long
)
ip
,
p
->
mtrace_stacks
.
tag
[
i
],
i
,
mtrace_start
);
popcli
();
}
static
inline
void
mt
race_kstack_
stop
(
struct
proc
*
p
)
static
inline
void
mtstop
(
struct
proc
*
p
)
{
int
i
;
pushcli
();
...
...
@@ -36,7 +35,7 @@ static inline void mtrace_kstack_stop(struct proc *p)
popcli
();
}
static
inline
void
mt
race_kstack_
pause
(
struct
proc
*
p
)
static
inline
void
mtpause
(
struct
proc
*
p
)
{
int
i
;
...
...
@@ -46,7 +45,7 @@ static inline void mtrace_kstack_pause(struct proc *p)
mtrace_fcall_register
(
p
->
pid
,
0
,
p
->
mtrace_stacks
.
tag
[
i
],
i
,
mtrace_pause
);
}
static
inline
void
mtr
ace_kstack_r
esume
(
struct
proc
*
p
)
static
inline
void
mtresume
(
struct
proc
*
p
)
{
int
i
;
...
...
@@ -55,3 +54,9 @@ static inline void mtrace_kstack_resume(struct proc *p)
panic
(
"mtrace_kstack_resume: bad stack"
);
mtrace_fcall_register
(
p
->
pid
,
0
,
p
->
mtrace_stacks
.
tag
[
i
],
i
,
mtrace_resume
);
}
#else
#define mtstart(ip, p) do { } while (0)
#define mtstop(p) do { } while (0)
#define mtpause(p) do { } while (0)
#define mtresume(p) do { } while (0)
#endif
mapbench.c
浏览文件 @
1be8db63
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#include "amd64.h"
#include "uspinlock.h"
...
...
maptest.c
浏览文件 @
1be8db63
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#include "amd64.h"
#include "uspinlock.h"
...
...
mtrace.h
0 → 100644
浏览文件 @
1be8db63
#if MTRACE
typedef
__signed
char
int8_t
;
typedef
unsigned
char
uint8_t
;
typedef
short
int16_t
;
typedef
unsigned
short
uint16_t
;
typedef
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
long
long
int64_t
;
typedef
unsigned
long
long
uint64_t
;
typedef
__PTRDIFF_TYPE__
intptr_t
;
typedef
unsigned
__PTRDIFF_TYPE__
uintptr_t
;
void
*
memcpy
(
void
*
dst
,
const
void
*
src
,
u32
n
);
char
*
strncpy
(
char
*
s
,
const
char
*
t
,
int
n
);
#define RET_IP() ((unsigned long)__builtin_return_address(0))
#include <mtrace-magic.h>
// Tell mtrace about memory allocation
#define mtlabel(type, addr, bytes, str, n) \
mtrace_label_register(type, addr, bytes, str, n, RET_IP())
#define mtunlabel(type, addr) \
mtrace_label_register(type, addr, 0, NULL, 0, RET_IP())
// Tell mtrace about locking
#define mtlock(ptr) \
mtrace_lock_register(RET_IP(), ptr, lockname(ptr), mtrace_lockop_acquire, 0)
#define mtacquired(ptr) \
mtrace_lock_register(RET_IP(), ptr, lockname(ptr), mtrace_lockop_acquired, 0)
#define mtunlock(ptr) \
mtrace_lock_register(RET_IP(), ptr, lockname(ptr), mtrace_lockop_release, 0)
// Tell mtrace to start/stop recording call and ret
#define mtrec(cpu) mtrace_call_set(1, cpu)
#define mtign(cpu) mtrace_call_set(0, cpu)
#include "mtrace-magic.h"
#else
#define mtlabel(type, addr, bytes, str, n) do { } while (0)
#define mtunlabel(type, addr) do { } while (0)
#define mtlock(ptr) do { } while (0)
#define mtacquired(ptr) do { } while (0)
#define mtunlock(ptr) do { } while (0)
#define mtrec(cpu) do { } while (0)
#define mtign(cpu) do { } while (0)
#endif
proc.c
浏览文件 @
1be8db63
...
...
@@ -9,16 +9,18 @@
#include "proc.h"
#include "cpu.h"
#include "bits.h"
#include "
xv6-
mtrace.h"
#include "
k
mtrace.h"
#include "vm.h"
extern
void
trapret
(
void
);
int
__mpalign__
idle
[
NCPU
];
struct
ns
*
nspid
__mpalign__
;
struct
ns
*
nsrunq
__mpalign__
;
static
struct
proc
*
bootproc
__mpalign__
;
#if MTRACE
struct
kstack_tag
kstack_tag
[
NCPU
];
#endif
enum
{
sched_debug
=
0
};
void
...
...
@@ -39,10 +41,10 @@ sched(void)
intena
=
mycpu
()
->
intena
;
myproc
()
->
curcycles
+=
rdtsc
()
-
myproc
()
->
tsc
;
if
(
myproc
()
->
state
==
ZOMBIE
)
mt
race_kstack_
stop
(
myproc
());
mtstop
(
myproc
());
else
mt
race_kstack_
pause
(
myproc
());
mt
race_call_set
(
0
,
mycpu
()
->
id
);
mtpause
(
myproc
());
mt
ign
(
mycpu
()
->
id
);
swtch
(
&
myproc
()
->
context
,
mycpu
()
->
scheduler
);
mycpu
()
->
intena
=
intena
;
...
...
@@ -141,9 +143,9 @@ forkret(void)
// b/c file system code needs a process context
// in which to call cv_sleep().
if
(
myproc
()
->
cwd
==
0
)
{
mt
race_kstack_
start
(
forkret
,
myproc
());
mtstart
(
forkret
,
myproc
());
myproc
()
->
cwd
=
namei
(
"/"
);
mt
race_kstack_
stop
(
myproc
());
mtstop
(
myproc
());
}
// Return to "caller", actually trapret (see allocproc).
...
...
@@ -209,6 +211,7 @@ exit(void)
static
struct
proc
*
allocproc
(
void
)
{
extern
void
trapret
(
void
);
struct
proc
*
p
;
char
*
sp
;
...
...
@@ -394,7 +397,7 @@ scheduler(void)
// Enabling mtrace calls in scheduler generates many mtrace_call_entrys.
// mtrace_call_set(1, cpu->id);
mt
race_kstack_
start
(
scheduler
,
schedp
);
mtstart
(
scheduler
,
schedp
);
for
(;;){
// Enable interrupts on this processor.
...
...
@@ -417,17 +420,17 @@ scheduler(void)
p
->
state
=
RUNNING
;
p
->
tsc
=
rdtsc
();
mt
race_kstack_
pause
(
schedp
);
mtpause
(
schedp
);
if
(
p
->
context
->
rip
!=
(
uptr
)
forkret
&&
p
->
context
->
rip
!=
(
uptr
)
rcu_gc_worker
)
{
mtr
ace_kstack_resume
(
proc
);
mtr
esume
(
p
);
}
mtr
ace_call_set
(
1
,
mycpu
()
->
id
);
mtr
ec
(
mycpu
()
->
id
);
swtch
(
&
mycpu
()
->
scheduler
,
myproc
()
->
context
);
mtr
ace_kstack_r
esume
(
schedp
);
mt
race_call_set
(
0
,
mycpu
()
->
id
);
mtresume
(
schedp
);
mt
ign
(
mycpu
()
->
id
);
switchkvm
();
// Process is done running for now.
...
...
rcu.c
浏览文件 @
1be8db63
...
...
@@ -8,7 +8,7 @@
#include "queue.h"
#include "proc.h"
#include "cpu.h"
#include "
xv6-
mtrace.h"
#include "
k
mtrace.h"
struct
rcu
{
unsigned
long
epoch
;
...
...
@@ -107,7 +107,7 @@ rcu_gc_worker(void)
{
release
(
&
myproc
()
->
lock
);
// initially held by scheduler
mt
race_kstack_
start
(
rcu_gc_worker
,
myproc
());
mtstart
(
rcu_gc_worker
,
myproc
());
struct
spinlock
wl
;
initlock
(
&
wl
,
"rcu_gc_worker"
);
// dummy lock
...
...
spinlock.c
浏览文件 @
1be8db63
...
...
@@ -7,7 +7,7 @@
#include "cpu.h"
#include "bits.h"
#include "spinlock.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
void
initlock
(
struct
spinlock
*
lk
,
char
*
name
)
...
...
@@ -35,31 +35,13 @@ acquire(struct spinlock *lk)
}
#endif
mtrace_lock_register
(
RET_EIP
(),
lk
,
#if SPINLOCK_DEBUG
lk
->
name
?:
"null"
,
#else
"unknown"
,
#endif
mtrace_lockop_acquire
,
0
);
mtlock
(
lk
);
// The xchg is atomic.
// It also serializes, so that reads after acquire are not
// reordered before it.
while
(
xchg32
(
&
lk
->
locked
,
1
)
!=
0
)
;
mtrace_lock_register
(
RET_EIP
(),
lk
,
#if SPINLOCK_DEBUG
lk
->
name
?:
"null"
,
#else
"unknown"
,
#endif
mtrace_lockop_acquired
,
0
);
mtacquired
(
lk
);
#if SPINLOCK_DEBUG
// Record info about lock acquisition for debugging.
...
...
@@ -79,15 +61,7 @@ release(struct spinlock *lk)
}
#endif
mtrace_lock_register
(
RET_EIP
(),
lk
,
#if SPINLOCK_DEBUG
lk
->
name
?:
"null"
,
#else
"unknown"
,
#endif
mtrace_lockop_release
,
0
);
mtunlock
(
lk
);
#if SPINLOCK_DEBUG
lk
->
pcs
[
0
]
=
0
;
...
...
spinlock.h
浏览文件 @
1be8db63
...
...
@@ -15,3 +15,11 @@ struct spinlock {
#endif
};
static
inline
const
char
*
lockname
(
struct
spinlock
*
s
)
{
#if SPINLOCK_DEBUG
return
s
->
name
?:
"null"
;
#else
return
"unknown"
;
#endif
}
syscall.c
浏览文件 @
1be8db63
...
...
@@ -8,8 +8,8 @@
#include "proc.h"
#include "amd64.h"
#include "syscall.h"
#include "xv6-mtrace.h"
#include "cpu.h"
#include "kmtrace.h"
// User code makes a system call with INT T_SYSCALL.
// System call number in %eax.
...
...
@@ -169,11 +169,11 @@ syscall(void)
num
=
myproc
()
->
tf
->
rax
;
if
(
num
>=
0
&&
num
<
NELEM
(
syscalls
)
&&
syscalls
[
num
])
{
mt
race_kstack_start
(
syscalls
[
num
],
proc
);
mtr
ace_call_set
(
1
,
cpunum
());
mt
start
(
syscalls
[
num
],
myproc
()
);
mtr
ec
(
cpunum
());
myproc
()
->
tf
->
rax
=
syscalls
[
num
]();
mt
race_kstack_
stop
(
myproc
());
mt
race_call_set
(
0
,
cpunum
());
mtstop
(
myproc
());
mt
ign
(
cpunum
());
}
else
{
cprintf
(
"%d %s: unknown sys call %d
\n
"
,
myproc
()
->
pid
,
myproc
()
->
name
,
num
);
...
...
thrtest.c
浏览文件 @
1be8db63
#include "types.h"
#include "stat.h"
#include "user.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
#include "amd64.h"
#include "uspinlock.h"
...
...
trap.c
浏览文件 @
1be8db63
...
...
@@ -9,7 +9,7 @@
#include "spinlock.h"
#include "condvar.h"
#include "proc.h"
#include "
xv6-
mtrace.h"
#include "
k
mtrace.h"
#include "bits.h"
u64
ticks
__mpalign__
;
...
...
@@ -51,13 +51,13 @@ trap(struct trapframe *tf)
// XXX(sbw) sysenter/sysexit
if
(
tf
->
trapno
==
T_SYSCALL
){
if
(
myproc
()
->
killed
)
{
mt
race_kstack_start
(
trap
,
proc
);
mt
start
(
trap
,
myproc
()
);
exit
();
}
myproc
()
->
tf
=
tf
;
syscall
();
if
(
myproc
()
->
killed
)
{
mt
race_kstack_
start
(
trap
,
myproc
());
mtstart
(
trap
,
myproc
());
exit
();
}
return
;
...
...
@@ -65,8 +65,8 @@ trap(struct trapframe *tf)
#if MTRACE
if
(
myproc
()
->
mtrace_stacks
.
curr
>=
0
)
mt
race_kstack_
pause
(
myproc
());
mt
race_kstack_
start
(
trap
,
myproc
());
mtpause
(
myproc
());
mtstart
(
trap
,
myproc
());
#endif
switch
(
tf
->
trapno
){
...
...
@@ -119,9 +119,9 @@ trap(struct trapframe *tf)
if
(
tf
->
trapno
==
T_PGFLT
){
if
(
pagefault
(
myproc
()
->
vmap
,
rcr2
(),
tf
->
err
)
>=
0
){
#if MTRACE
mt
race_kstack_
stop
(
myproc
());
mtstop
(
myproc
());
if
(
myproc
()
->
mtrace_stacks
.
curr
>=
0
)
mtr
ace_kstack_r
esume
(
myproc
());
mtresume
(
myproc
());
#endif
return
;
}
...
...
@@ -151,9 +151,9 @@ trap(struct trapframe *tf)
exit
();
#if MTRACE
mt
race_kstack_
stop
(
myproc
());
mtstop
(
myproc
());
if
(
myproc
()
->
mtrace_stacks
.
curr
>=
0
)
mtr
ace_kstack_r
esume
(
myproc
());
mtresume
(
myproc
());
#endif
}
...
...
usertests.c
浏览文件 @
1be8db63
...
...
@@ -5,7 +5,7 @@
#include "fcntl.h"
#include "syscall.h"
#include "traps.h"
#include "
xv6-
mtrace.h"
#include "mtrace.h"
char
buf
[
2048
];
char
name
[
3
];
...
...
xv6-mtrace.h
deleted
100644 → 0
浏览文件 @
781658d0
#if MTRACE
typedef
__signed
char
int8_t
;
typedef
unsigned
char
uint8_t
;
typedef
short
int16_t
;
typedef
unsigned
short
uint16_t
;
typedef
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
long
long
int64_t
;
typedef
unsigned
long
long
uint64_t
;
typedef
__PTRDIFF_TYPE__
intptr_t
;
typedef
unsigned
__PTRDIFF_TYPE__
uintptr_t
;
void
*
memcpy
(
void
*
dst
,
const
void
*
src
,
u32
n
);
char
*
strncpy
(
char
*
s
,
const
char
*
t
,
int
n
);
#define RET_EIP() ((unsigned long)__builtin_return_address(0))
#include "mtrace-magic.h"
#else
#define mtrace_lock_register(ip, x, name, op, y) do { } while (0)
#define mtrace_label_register(t, r, x, y, z, ip) do { } while (0)
#define mtrace_kstack_start(x, y) do { } while (0)
#define mtrace_kstack_stop(x) do { } while (0)
#define mtrace_kstack_pause(x) do { } while (0)
#define mtrace_kstack_resume(x) do { } while (0)
#define mtrace_call_set(x, y) do { } while (0)
#define RET_EIP() 0
#endif
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论