-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtiw.in
98 lines (88 loc) · 2.27 KB
/
tiw.in
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
define tiw-slot
set $p = tiw[$arg0]
while ($p != 0 && $arg0 == $p->slot)
printf "%d\n%d\n", $p->slot, $p->count
if (etp_smp_compiled)
tiw-timeout-symbol-smp
else
tiw-timeout-symbol-nosmp
end
printf "\n"
set $p = $p->next
end
end
define tiw-timeout-symbol-nosmp
if $p->timeout == &timeout_proc
tiw-timeout-proc
else
if $p->timeout == &schedule_port_timeout
tiw-timeout-port
else
if $p->timeout == &bif_timer_timeout
tiw-timeout-bif_timer
else
if $p->timeout == &aux_work_timeout
tiw-timeout-aux_work
end
end
end
end
end
define tiw-timeout-symbol-smp
if $p->timeout == &ptimer_timeout
tiw-timeout-ptimer
else
if $p->timeout == &bif_timer_timeout
tiw-timeout-bif_timer
else
if $p->timeout == &aux_work_timeout
tiw-timeout-aux_work
end
end
end
end
## auxiliary work
define tiw-timeout-aux_work
printf "aux_work_timeout\nNULL\n"
end
## timers initiated by erlang:send_after/3 and erlang:start_timer/3 bifs
define tiw-timeout-bif_timer
printf "bif_timer_timeout\n"
etp-pid-1 ((ErtsBifTimer*)($p->arg))->receiver.proc->ess->common.id
printf " ! "
etp ((ErtsBifTimer*)($p->arg))->message
end
## process timeout ('receive ... after' block, so also timer:sleep/1) for smp
define tiw-timeout-ptimer
printf "ptimer_timeout\n"
etp-pid-1 ((ErtsSmpPTimer*)($p->arg))->timer->id
printf " | "
etp-port-1 ((ErtsSmpPTimer*)($p->arg))->timer->id
printf "\n"
end
## process timeout but without smp
define tiw-timeout-proc
printf "timeout_proc\n"
etp-pid-1 ((Process*)($p->arg))->common.id
printf "\n"
end
## port timeout
define tiw-timeout-port
printf "schedule_port_timeout\n"
etp-port-1 ((Port*)($p->arg))->common.id
printf "\n"
end
define tiw
printf "=== tiw start\n"
printf "%d\n", tiw_pos
set $TIW_SIZE = 65536
set $i = tiw_pos
tiw-slot $i
set $i = ($i+1) % $TIW_SIZE
while ($i != tiw_pos)
tiw-slot $i
set $i = ($i+1) % $TIW_SIZE
end
printf "=== tiw end\n"
end
# vi: ft=gdb