aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.h
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-02-26 12:49:57 +0100
committerJohn Högberg <[email protected]>2018-03-23 09:50:59 +0100
commit06ed628dfd013010dd6e182508c1137b9f4ba09b (patch)
tree91dd86094c4e7d9383fc542d9cff7e818b6983e2 /erts/emulator/beam/erl_process.h
parentd77f0bdb55fd1bd36c4f19ab78cb02177d365b12 (diff)
downloadotp-06ed628dfd013010dd6e182508c1137b9f4ba09b.tar.gz
otp-06ed628dfd013010dd6e182508c1137b9f4ba09b.tar.bz2
otp-06ed628dfd013010dd6e182508c1137b9f4ba09b.zip
Lift the type restrictions on seq_trace token labels
OTP-14899
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r--erts/emulator/beam/erl_process.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index 0550fb05b5..256b8b7d16 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -1250,7 +1250,24 @@ void erts_check_for_holes(Process* p);
#define SEQ_TRACE_T_SENDER(token) (*(tuple_val(token) + 4))
#define SEQ_TRACE_T_LASTCNT(token) (*(tuple_val(token) + 5))
+#ifdef USE_VM_PROBES
+/* The dtrace probe for seq_trace only supports 'int' labels, so we represent
+ * all values that won't fit into a 32-bit signed integer as ERTS_SINT32_MIN
+ * (bigints, tuples, etc). */
+
+#define SEQ_TRACE_T_DTRACE_LABEL(token) \
+ DTRACE_SEQ_TRACE_LABEL__(SEQ_TRACE_T_LABEL(token))
+
+#define DTRACE_SEQ_TRACE_LABEL__(label_term) \
+ (is_small((label_term)) ? \
+ ((signed_val((label_term)) <= ERTS_SINT32_MAX && \
+ signed_val((label_term)) >= ERTS_SINT32_MIN) ? \
+ signed_val((label_term)) : ERTS_SINT32_MIN) \
+ : ERTS_SINT32_MIN)
+#endif
+
/*
+
* Possible flags for the flags field in ErlSpawnOpts below.
*/