aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_trace.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-01-05 16:55:04 +0100
committerRickard Green <[email protected]>2016-01-20 11:10:37 +0100
commit858c6f7fa44f7b2dc363b359198d6522dd60e914 (patch)
treefdad35b9a7a9904d7dc4586aced86c79fb46a78c /erts/emulator/beam/erl_trace.h
parentdf18cd270ad682cedc8c21990641b0bdb8788092 (diff)
downloadotp-858c6f7fa44f7b2dc363b359198d6522dd60e914.tar.gz
otp-858c6f7fa44f7b2dc363b359198d6522dd60e914.tar.bz2
otp-858c6f7fa44f7b2dc363b359198d6522dd60e914.zip
Introduce time warp safe trace timestamp formats
New timestamp options for trace, sequential trace, and system profile: - monotonic_timestamp - strict_monotonic_timestamp
Diffstat (limited to 'erts/emulator/beam/erl_trace.h')
-rw-r--r--erts/emulator/beam/erl_trace.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_trace.h b/erts/emulator/beam/erl_trace.h
index 7405490f76..a0058264d7 100644
--- a/erts/emulator/beam/erl_trace.h
+++ b/erts/emulator/beam/erl_trace.h
@@ -18,8 +18,38 @@
* %CopyrightEnd%
*/
+#ifndef ERL_TRACE_H__FLAGS__
+#define ERL_TRACE_H__FLAGS__
+/*
+ * NOTE! The bits used for these flags matter. The flag with
+ * the least significant bit will take precedence!
+ *
+ * The "now timestamp" has highest precedence due to
+ * compatibility reasons.
+ */
+#define ERTS_TRACE_FLG_NOW_TIMESTAMP (1 << 0)
+#define ERTS_TRACE_FLG_STRICT_MONOTONIC_TIMESTAMP (1 << 1)
+#define ERTS_TRACE_FLG_MONOTONIC_TIMESTAMP (1 << 2)
+
+/*
+ * The bits used effects trace flags (of processes and ports)
+ * as well as sequential trace flags. If changed make sure
+ * these arn't messed up...
+ */
+#define ERTS_TRACE_TS_TYPE_BITS 3
+#define ERTS_TRACE_TS_TYPE_MASK \
+ ((1 << ERTS_TRACE_TS_TYPE_BITS) - 1)
+
+#define ERTS_TFLGS2TSTYPE(TFLGS) \
+ ((int) (((TFLGS) >> ERTS_TRACE_FLAGS_TS_TYPE_SHIFT) \
+ & ERTS_TRACE_TS_TYPE_MASK))
+#define ERTS_SEQTFLGS2TSTYPE(SEQTFLGS) \
+ ((int) (((SEQTFLGS) >> ERTS_SEQ_TRACE_FLAGS_TS_TYPE_SHIFT) \
+ & ERTS_TRACE_TS_TYPE_MASK))
+
+#endif /* ERL_TRACE_H__FLAGS__ */
-#ifndef ERL_TRACE_H__
+#if !defined(ERL_TRACE_H__) && !defined(ERTS_ONLY_INCLUDE_TRACE_FLAGS)
#define ERL_TRACE_H__
struct binary;