aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bp.h
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-04-30 15:03:56 +0200
committerRaimo Niskanen <[email protected]>2010-06-03 14:54:20 +0200
commit5bd5aa849475b505a5b0798295511a6a0b4885a4 (patch)
tree9e14f1cdc0872ca07d586973e06bc15a27ac6ff9 /erts/emulator/beam/beam_bp.h
parent891682094bf1db038cdf9addffe0b107f40ab6ec (diff)
downloadotp-5bd5aa849475b505a5b0798295511a6a0b4885a4.tar.gz
otp-5bd5aa849475b505a5b0798295511a6a0b4885a4.tar.bz2
otp-5bd5aa849475b505a5b0798295511a6a0b4885a4.zip
Teach call_time trace to use intruction pointers
call_time trace will use instruction pointers instead of breakpoint data pointers. More costly lookup but the bdt structure might be deallocated, we do not want that. Remove unnecessary pattern lock.
Diffstat (limited to 'erts/emulator/beam/beam_bp.h')
-rw-r--r--erts/emulator/beam/beam_bp.h29
1 files changed, 4 insertions, 25 deletions
diff --git a/erts/emulator/beam/beam_bp.h b/erts/emulator/beam/beam_bp.h
index 515a06e220..249cb707fd 100644
--- a/erts/emulator/beam/beam_bp.h
+++ b/erts/emulator/beam/beam_bp.h
@@ -101,7 +101,7 @@ typedef struct {
Uint ms;
Uint s;
Uint us;
- BpDataTime *bdt;
+ Uint *pc;
} process_breakpoint_time_t; /* used within psd */
extern erts_smp_spinlock_t erts_bp_lock;
@@ -137,27 +137,6 @@ do { \
*(instr_result) = bdc->orig_instr; \
} while (0)
-#define ErtsTimeBreak(pc,instr_result) \
-do { \
- BpDataTime *bdt = (BpDataTime *) (pc)[-4]; \
- Uint ms,s,u; \
- \
- ASSERT((pc)[-5] == (Uint) BeamOp(op_i_func_info_IaaI)); \
- ASSERT(bdt); \
- bdt = (BpDataTime *) bdt->next; \
- ASSERT(bdc); \
- (pc)[-4] = (Uint) bdt; \
- get_now(&ms,&s,&u); \
- ErtsSmpBPLock(bdt); \
- if (bdt->count >= 0) \
- bdt->count++; \
- bdt->s_time = 1; \
- bdt->us_time = 1; \
- ErtsSmpBPUnlock(bdt); \
- *(instr_result) = bdt->orig_instr; \
-} while (0)
-
-
#define ErtsBreakSkip(pc,instr_result) \
do { \
BpData *bd = (BpData *) (pc)[-4]; \
@@ -198,8 +177,6 @@ int erts_set_debug_break(Eterm mfa[3], int specified);
int erts_clear_debug_break(Eterm mfa[3], int specified);
int erts_set_count_break(Eterm mfa[3], int specified, enum erts_break_op);
int erts_clear_count_break(Eterm mfa[3], int specified);
-int erts_set_time_break(Eterm mfa[3], int specified, enum erts_break_op);
-int erts_clear_time_break(Eterm mfa[3], int specified);
int erts_clear_break(Eterm mfa[3], int specified);
@@ -221,8 +198,10 @@ int erts_is_native_break(BeamInstr *pc);
int erts_is_count_break(BeamInstr *pc, Sint *count_ret);
int erts_is_time_break(Process *p, BeamInstr *pc, Eterm *call_time);
-void erts_do_time_break(Process *p, BpDataTime *bdt, Uint type);
+void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type);
void erts_schedule_time_break(Process *p, Uint out);
+int erts_set_time_break(Eterm mfa[3], int specified, enum erts_break_op);
+int erts_clear_time_break(Eterm mfa[3], int specified);
BeamInstr *erts_find_local_func(Eterm mfa[3]);