forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcall_stack.bt
More file actions
29 lines (25 loc) · 845 Bytes
/
call_stack.bt
File metadata and controls
29 lines (25 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@seq = 0;
usdt:@TARGET@:python:function__entry /str(args->arg1) == "start"/ {
@trace[tid] = 1;
@indent[tid] = 0;
}
usdt:@TARGET@:python:function__entry /@trace[tid]/ {
@seq += 1;
printf("%d\t%15s:", (int)@seq, "function-entry");
printf("%*s", @indent[tid], "");
printf("%s:%s:%d:%s\n", str(args->arg0), str(args->arg1), args->arg2,
str(args->arg3));
@indent[tid] = @indent[tid] + 1;
}
usdt:@TARGET@:python:function__return /@trace[tid]/ {
@indent[tid] = @indent[tid] - 1;
@seq += 1;
printf("%d\t%15s:", (int)@seq, "function-return");
printf("%*s", @indent[tid], "");
printf("%s:%s:%d:%s\n", str(args->arg0), str(args->arg1), args->arg2,
str(args->arg3));
}
usdt:@TARGET@:python:function__return /str(args->arg1) == "start"/ {
@trace[tid] = 0;
@indent[tid] = 0;
}