aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r--erts/emulator/beam/bif.c60
1 files changed, 41 insertions, 19 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index 6478e54996..2adc713959 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -564,7 +564,7 @@ erts_queue_monitor_message(Process *p,
tup = TUPLE5(hp, am_DOWN, ref_copy, type, item_copy, reason_copy);
erts_queue_message(p, p_locksp, bp, tup, NIL
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
, NIL
#endif
);
@@ -1949,7 +1949,7 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
save_calls(p, &exp_send);
if (SEQ_TRACE_TOKEN(p) != NIL
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
&& SEQ_TRACE_TOKEN(p) != am_have_dt_utag
#endif
) {
@@ -4234,7 +4234,7 @@ BIF_RETTYPE system_flag_2(BIF_ALIST_2)
for (i = 0; i < erts_max_processes; i++) {
if (process_tab[i] != (Process*) 0) {
Process* p = process_tab[i];
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
p->seq_trace_token = (p->dt_utag != NIL) ? am_have_dt_utag : NIL;
#else
p->seq_trace_token = NIL;
@@ -4244,7 +4244,7 @@ BIF_RETTYPE system_flag_2(BIF_ALIST_2)
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(p);
mp = p->msg.first;
while(mp != NULL) {
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
ERL_MESSAGE_TOKEN(mp) = (ERL_MESSAGE_DT_UTAG(mp) != NIL) ? am_have_dt_utag : NIL;
#else
ERL_MESSAGE_TOKEN(mp) = NIL;
@@ -4649,7 +4649,7 @@ BIF_RETTYPE get_module_info_2(BIF_ALIST_2)
BIF_RETTYPE put_utag_1(BIF_ALIST_1)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
Eterm otag;
if (BIF_ARG_1 == am_undefined) {
otag = (DT_UTAG(BIF_P) == NIL) ? am_undefined : DT_UTAG(BIF_P);
@@ -4677,7 +4677,7 @@ BIF_RETTYPE put_utag_1(BIF_ALIST_1)
BIF_RETTYPE get_utag_0(BIF_ALIST_0)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
BIF_RET((DT_UTAG(BIF_P) == NIL || !(DT_UTAG_FLAGS(BIF_P) & DT_UTAG_PERMANENT)) ? am_undefined : DT_UTAG(BIF_P));
#else
BIF_RET(am_undefined);
@@ -4685,7 +4685,7 @@ BIF_RETTYPE get_utag_0(BIF_ALIST_0)
}
BIF_RETTYPE get_utag_data_0(BIF_ALIST_0)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
BIF_RET((DT_UTAG(BIF_P) == NIL) ? am_undefined : DT_UTAG(BIF_P));
#else
BIF_RET(am_undefined);
@@ -4693,7 +4693,7 @@ BIF_RETTYPE get_utag_data_0(BIF_ALIST_0)
}
BIF_RETTYPE prepend_vm_utag_data_1(BIF_ALIST_1)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
Eterm b;
Eterm *hp;
hp = HAlloc(BIF_P,2);
@@ -4720,7 +4720,7 @@ BIF_RETTYPE prepend_vm_utag_data_1(BIF_ALIST_1)
}
BIF_RETTYPE append_vm_utag_data_1(BIF_ALIST_1)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
Eterm b;
Eterm *hp;
hp = HAlloc(BIF_P,2);
@@ -4747,23 +4747,31 @@ BIF_RETTYPE append_vm_utag_data_1(BIF_ALIST_1)
}
BIF_RETTYPE spread_utag_1(BIF_ALIST_1)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
Eterm ret;
Eterm *hp;
#endif
if (BIF_ARG_1 != am_true && BIF_ARG_1 != am_false) {
BIF_ERROR(BIF_P,BADARG);
}
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
hp = HAlloc(BIF_P,3);
ret = TUPLE2(hp,make_small(DT_UTAG_FLAGS(BIF_P)),DT_UTAG(BIF_P));
if (DT_UTAG(BIF_P) != NIL) {
if (BIF_ARG_1 == am_true) {
DT_UTAG_FLAGS(BIF_P) |= DT_UTAG_SPREADING;
- erts_fprintf(stderr,"XXX: PaN: Dtrace -> (%T) start spreading tag %T\r\n",BIF_P->id,DT_UTAG(BIF_P));
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) start spreading tag %T\r\n",
+ BIF_P->id,DT_UTAG(BIF_P));
+#endif
} else {
DT_UTAG_FLAGS(BIF_P) &= ~DT_UTAG_SPREADING;
- erts_fprintf(stderr,"XXX: PaN: Dtrace -> (%T) stop spreading tag %T\r\n",BIF_P->id,DT_UTAG(BIF_P));
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) stop spreading tag %T\r\n",
+ BIF_P->id,DT_UTAG(BIF_P));
+#endif
}
}
BIF_RET(ret);
@@ -4773,7 +4781,7 @@ BIF_RETTYPE spread_utag_1(BIF_ALIST_1)
}
BIF_RETTYPE restore_utag_1(BIF_ALIST_1)
{
-#ifdef HAVE_DTRACE
+#ifdef USE_VM_PROBES
Eterm *tpl;
Uint x;
if (is_not_tuple(BIF_ARG_1)) {
@@ -4785,7 +4793,11 @@ BIF_RETTYPE restore_utag_1(BIF_ALIST_1)
}
if (tpl[2] == NIL) {
if (DT_UTAG(BIF_P) != NIL) {
- erts_fprintf(stderr,"XXX: PaN: Dtrace -> (%T) restore Killing tag!\r\n",BIF_P->id);
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) restore Killing tag!\r\n",
+ BIF_P->id);
+#endif
}
DT_UTAG(BIF_P) = NIL;
if (SEQ_TRACE_TOKEN(BIF_P) == am_have_dt_utag) {
@@ -4794,11 +4806,21 @@ BIF_RETTYPE restore_utag_1(BIF_ALIST_1)
DT_UTAG_FLAGS(BIF_P) = 0;
} else {
x = unsigned_val(tpl[1]) & (DT_UTAG_SPREADING | DT_UTAG_PERMANENT);
- if (!(x & DT_UTAG_SPREADING) && (DT_UTAG_FLAGS(BIF_P) & DT_UTAG_SPREADING)) {
- erts_fprintf(stderr,"XXX: PaN: Dtrace -> (%T) restore stop spreading tag %T\r\n",BIF_P->id,tpl[2]);
- } else if ((x & DT_UTAG_SPREADING) && !(DT_UTAG_FLAGS(BIF_P) & DT_UTAG_SPREADING)) {
- erts_fprintf(stderr,"XXX: PaN: Dtrace -> (%T) restore start spreading tag %T\r\n",BIF_P->id,tpl[2]);
+#ifdef DTRACE_TAG_HARDDEBUG
+
+ if (!(x & DT_UTAG_SPREADING) && (DT_UTAG_FLAGS(BIF_P) &
+ DT_UTAG_SPREADING)) {
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) restore stop spreading "
+ "tag %T\r\n",
+ BIF_P->id, tpl[2]);
+ } else if ((x & DT_UTAG_SPREADING) &&
+ !(DT_UTAG_FLAGS(BIF_P) & DT_UTAG_SPREADING)) {
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) restore start spreading "
+ "tag %T\r\n",BIF_P->id,tpl[2]);
}
+#endif
DT_UTAG_FLAGS(BIF_P) = x;
DT_UTAG(BIF_P) = tpl[2];
if (SEQ_TRACE_TOKEN(BIF_P) == NIL) {