aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_trace.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-04-21 15:29:31 +0200
committerRaimo Niskanen <[email protected]>2010-06-03 14:54:20 +0200
commit78d5145d68783dca4aa43bfd38fb9afecc59c416 (patch)
tree8f340d1e3250a383d1fc67a5fdadf360eaf1c979 /erts/emulator/beam/erl_bif_trace.c
parentcfa905aece83e5a07f67fa169fe8f44c1c163bde (diff)
downloadotp-78d5145d68783dca4aa43bfd38fb9afecc59c416.tar.gz
otp-78d5145d68783dca4aa43bfd38fb9afecc59c416.tar.bz2
otp-78d5145d68783dca4aa43bfd38fb9afecc59c416.zip
Add processes hashes for call time breakpoints
Call time breakpoint tracing traces per call trace per process. - Add hashes to support the extra dimension. - Teach trace_info/2 to handle the extra information dimension.
Diffstat (limited to 'erts/emulator/beam/erl_bif_trace.c')
-rw-r--r--erts/emulator/beam/erl_bif_trace.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/erts/emulator/beam/erl_bif_trace.c b/erts/emulator/beam/erl_bif_trace.c
index 20a58e5ed9..26390d397c 100644
--- a/erts/emulator/beam/erl_bif_trace.c
+++ b/erts/emulator/beam/erl_bif_trace.c
@@ -959,13 +959,13 @@ trace_info_pid(Process* p, Eterm pid_spec, Eterm key)
*
* If the return value contains FUNC_TRACE_COUNT_TRACE, *count is set.
*/
-static int function_is_traced(Eterm mfa[3],
+static int function_is_traced(Process *p,
+ Eterm mfa[3],
Binary **ms, /* out */
Binary **ms_meta, /* out */
Eterm *tracer_pid_meta, /* out */
Sint *count, /* out */
- Uint *s_time, /* out */
- Uint *us_time) /* out */
+ Eterm *call_time) /* out */
{
Export e;
Export* ep;
@@ -1018,7 +1018,7 @@ static int function_is_traced(Eterm mfa[3],
? FUNC_TRACE_META_TRACE : 0)
| (erts_is_count_break(code, count)
? FUNC_TRACE_COUNT_TRACE : 0)
- | (erts_is_time_break(code, count, s_time, us_time)
+ | (erts_is_time_break(p, code, call_time)
? FUNC_TRACE_TIME_TRACE : 0);
return r ? r : FUNC_TRACE_UNTRACED;
@@ -1034,11 +1034,11 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
DeclareTmpHeap(mfa,3,p); /* Not really heap here, but might be when setting pattern */
Binary *ms = NULL, *ms_meta = NULL;
Sint count = 0;
- Uint s_time = 0, us_time = 0;
Eterm traced = am_false;
Eterm match_spec = am_false;
Eterm retval = am_false;
Eterm meta = am_false;
+ Eterm call_time;
int r;
@@ -1058,7 +1058,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
mfa[1] = tp[2];
mfa[2] = signed_val(tp[3]);
- r = function_is_traced(mfa, &ms, &ms_meta, &meta, &count, &s_time, &us_time);
+ r = function_is_traced(p, mfa, &ms, &ms_meta, &meta, &count, &call_time);
switch (r) {
case FUNC_TRACE_NOEXIST:
UnUseTmpHeap(3,p);
@@ -1113,15 +1113,11 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
break;
case am_call_time:
if (r & FUNC_TRACE_TIME_TRACE) {
- hp = HAlloc(p, 4);
- retval = TUPLE3(hp,
- erts_make_integer(count, p),
- erts_make_integer(s_time, p),
- erts_make_integer(us_time,p)); hp += 4;
+ retval = call_time;
}
break;
case am_all: {
- Eterm match_spec_meta = am_false, c = am_false, t, ct;
+ Eterm match_spec_meta = am_false, c = am_false, t, ct = am_false;
if (ms) {
match_spec = MatchSetGetSource(ms);
@@ -1140,8 +1136,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
erts_make_integer(count, p);
}
if (r & FUNC_TRACE_TIME_TRACE) {
- hp = HAlloc(p, 4);
- ct = TUPLE3(hp, erts_make_integer(count, p), erts_make_integer(s_time, p), erts_make_integer(us_time,p)); hp += 4;
+ ct = call_time;
}
hp = HAlloc(p, (3+2)*6);
retval = NIL;