aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_trace.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-02-21 08:48:42 +0100
committerBjörn Gustavsson <[email protected]>2012-06-25 14:31:19 +0200
commitaa340f8d8a13b86f2938a4ce0b3c7d5807dec716 (patch)
tree50fd1280fd85ea9ab2766d584f94739b6acbd554 /erts/emulator/beam/erl_bif_trace.c
parent17263978bd05535251aba8ec37cbd0a6756f57f7 (diff)
downloadotp-aa340f8d8a13b86f2938a4ce0b3c7d5807dec716.tar.gz
otp-aa340f8d8a13b86f2938a4ce0b3c7d5807dec716.tar.bz2
otp-aa340f8d8a13b86f2938a4ce0b3c7d5807dec716.zip
Change the data structures for breakpoints
Change the data structures for breakpoints to make it possible (in a future commit) to manage breakpoints without taking down the system to single-scheduling mode. The current "breakpoint wheel" data structure (a circular, double-linked list of breakpoints) was invented before the SMP emulator. To support it in the SMP emulator, there is essentially one breakpoint wheel per scheduler. As more breakpoint types have been added, the implementation has become messy and hard to understand and maintain. Therefore, the time for a rewrite has come. Use one struct to hold all breakpoint data for a breakpoint in a function. Use a flag field to indicate what different type of break actions that are enabled.
Diffstat (limited to 'erts/emulator/beam/erl_bif_trace.c')
-rw-r--r--erts/emulator/beam/erl_bif_trace.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_bif_trace.c b/erts/emulator/beam/erl_bif_trace.c
index 7f1b02b9b4..23dbdf7d6d 100644
--- a/erts/emulator/beam/erl_bif_trace.c
+++ b/erts/emulator/beam/erl_bif_trace.c
@@ -978,7 +978,7 @@ static int function_is_traced(Process *p,
Binary **ms, /* out */
Binary **ms_meta, /* out */
Eterm *tracer_pid_meta, /* out */
- Sint *count, /* out */
+ Uint *count, /* out */
Eterm *call_time) /* out */
{
Export e;
@@ -1029,7 +1029,7 @@ static int function_is_traced(Process *p,
/* OK, now look for breakpoint tracing */
if ((code = erts_find_local_func(mfa)) != NULL) {
int r =
- (erts_is_trace_break(code, ms, NULL)
+ (erts_is_trace_break(code, ms)
? FUNC_TRACE_LOCAL_TRACE : 0)
| (erts_is_mtrace_break(code, ms_meta, tracer_pid_meta)
? FUNC_TRACE_META_TRACE : 0)
@@ -1050,7 +1050,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
Eterm* hp;
DeclareTmpHeap(mfa,3,p); /* Not really heap here, but might be when setting pattern */
Binary *ms = NULL, *ms_meta = NULL;
- Sint count = 0;
+ Uint count = 0;
Eterm traced = am_false;
Eterm match_spec = am_false;
Eterm retval = am_false;
@@ -1138,9 +1138,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
break;
case am_call_count:
if (r & FUNC_TRACE_COUNT_TRACE) {
- retval = count < 0 ?
- erts_make_integer(-count-1, p) :
- erts_make_integer(count, p);
+ retval = erts_make_integer(count, p);
}
break;
case am_call_time:
@@ -1477,8 +1475,7 @@ erts_set_trace_pattern(Eterm* mfa, int specified,
} else {
int m = 0;
if (flags.local) {
- m = erts_set_trace_break(mfa, specified, match_prog_set,
- am_true);
+ m = erts_set_trace_break(mfa, specified, match_prog_set);
}
if (flags.meta) {
m = erts_set_mtrace_break(mfa, specified, meta_match_prog_set,