Skip to content

Commit

Permalink
Prepare for use of ptab functionality also for ports
Browse files Browse the repository at this point in the history
  • Loading branch information
rickard-green committed Dec 3, 2012
1 parent 3b523c2 commit b434a3a
Show file tree
Hide file tree
Showing 38 changed files with 1,015 additions and 992 deletions.
10 changes: 5 additions & 5 deletions erts/emulator/beam/beam_bp.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void erts_schedule_time_break(Process *p, Uint schedule) {
if (pbdt) {
get_sys_now(&ms,&s,&us);
bp_time_diff(&sitem, pbt, ms, s, us);
sitem.pid = p->id;
sitem.pid = p->common.id;
sitem.count = 0;

h = &(pbdt->hash[bp_sched2ix_proc(p)]);
Expand Down Expand Up @@ -735,7 +735,7 @@ void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type
ASSERT(pbt->pc);
/* add time to previous code */
bp_time_diff(&sitem, pbt, ms, s, us);
sitem.pid = p->id;
sitem.pid = p->common.id;
sitem.count = 0;

/* previous breakpoint */
Expand All @@ -762,7 +762,7 @@ void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type
(void *) ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCK_MAIN, pbt);
}
/* add count to this code */
sitem.pid = p->id;
sitem.pid = p->common.id;
sitem.count = 1;
sitem.s_time = 0;
sitem.us_time = 0;
Expand Down Expand Up @@ -792,7 +792,7 @@ void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type
* lookup bdt from code
* timestamp = t1
* get ts0 from pbt
* get item from bdt->hash[bp_hash(p->id)]
* get item from bdt->hash[bp_hash(p->common.id)]
* ack diff (t1, t0) to item
*/

Expand All @@ -803,7 +803,7 @@ void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type
ASSERT(pbt->pc);

bp_time_diff(&sitem, pbt, ms, s, us);
sitem.pid = p->id;
sitem.pid = p->common.id;
sitem.count = 0;

/* previous breakpoint */
Expand Down
20 changes: 10 additions & 10 deletions erts/emulator/beam/beam_emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ extern int count_instructions;
# define Dispatchfun() DispatchMacroFun()
#endif

#define Self(R) R = c_p->id
#define Self(R) R = c_p->common.id
#define Node(R) R = erts_this_node->sysname

#define Arg(N) I[(N)+1]
Expand Down Expand Up @@ -1138,8 +1138,8 @@ dtrace_drvport_str(ErlDrvPort drvport, char *port_buf)
Port *port = erts_drvport2port(drvport);

erts_snprintf(port_buf, DTRACE_TERM_BUF_SIZE, "#Port<%lu.%lu>",
port_channel_no(port->id),
port_number(port->id));
port_channel_no(port->common.id),
port_number(port->common.id));
}
#endif
/*
Expand Down Expand Up @@ -1264,7 +1264,7 @@ void process_main(void)
c_p = schedule(c_p, reds_used);
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
#ifdef DEBUG
pid = c_p->id; /* Save for debugging purpouses */
pid = c_p->common.id; /* Save for debugging purpouses */
#endif
ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
PROCESS_MAIN_CHK_LOCKS(c_p);
Expand Down Expand Up @@ -1935,14 +1935,14 @@ void process_main(void)
erts_fprintf(stderr,
"Dtrace -> (%T) stop spreading "
"tag %T with message %T\r\n",
c_p->id,DT_UTAG(c_p),ERL_MESSAGE_TERM(msgp));
c_p->common.id,DT_UTAG(c_p),ERL_MESSAGE_TERM(msgp));
#endif
} else {
#ifdef DTRACE_TAG_HARDDEBUG
erts_fprintf(stderr,
"Dtrace -> (%T) kill tag %T with "
"message %T\r\n",
c_p->id,DT_UTAG(c_p),ERL_MESSAGE_TERM(msgp));
c_p->common.id,DT_UTAG(c_p),ERL_MESSAGE_TERM(msgp));
#endif
DT_UTAG(c_p) = NIL;
SEQ_TRACE_TOKEN(c_p) = NIL;
Expand All @@ -1967,7 +1967,7 @@ void process_main(void)
erts_fprintf(stderr,
"Dtrace -> (%T) receive tag (%T) "
"with message %T\r\n",
c_p->id, DT_UTAG(c_p), ERL_MESSAGE_TERM(msgp));
c_p->common.id, DT_UTAG(c_p), ERL_MESSAGE_TERM(msgp));
#endif
} else {
#endif
Expand All @@ -1983,7 +1983,7 @@ void process_main(void)
}
msg = ERL_MESSAGE_TERM(msgp);
seq_trace_output(SEQ_TRACE_TOKEN(c_p), msg, SEQ_TRACE_RECEIVE,
c_p->id, c_p);
c_p->common.id, c_p);
#ifdef USE_VM_PROBES
}
#endif
Expand Down Expand Up @@ -5551,7 +5551,7 @@ terminate_proc(Process* c_p, Eterm Value)
/* EXF_LOG is a primary exception flag */
if (c_p->freason & EXF_LOG) {
erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
erts_dsprintf(dsbufp, "Error in process %T ", c_p->id);
erts_dsprintf(dsbufp, "Error in process %T ", c_p->common.id);
if (erts_is_alive)
erts_dsprintf(dsbufp, "on node %T ", erts_this_node->sysname);
erts_dsprintf(dsbufp,"with exit value: %0.*T\n", display_items, Value);
Expand Down Expand Up @@ -6539,7 +6539,7 @@ new_fun(Process* p, Eterm* reg, ErlFunEntry* fe, int num_free)
#endif
funp->fe = fe;
funp->num_free = num_free;
funp->creator = p->id;
funp->creator = p->common.id;
#ifdef HIPE
funp->native_address = fe->native_address;
#endif
Expand Down
Loading

0 comments on commit b434a3a

Please sign in to comment.