aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/seq_trace.erl
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 /lib/kernel/src/seq_trace.erl
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 'lib/kernel/src/seq_trace.erl')
-rw-r--r--lib/kernel/src/seq_trace.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/kernel/src/seq_trace.erl b/lib/kernel/src/seq_trace.erl
index 07ccd3e494..a7a782c29c 100644
--- a/lib/kernel/src/seq_trace.erl
+++ b/lib/kernel/src/seq_trace.erl
@@ -23,7 +23,9 @@
-define(SEQ_TRACE_SEND, 1). %(1 << 0)
-define(SEQ_TRACE_RECEIVE, 2). %(1 << 1)
-define(SEQ_TRACE_PRINT, 4). %(1 << 2)
--define(SEQ_TRACE_TIMESTAMP, 8). %(1 << 3)
+-define(SEQ_TRACE_NOW_TIMESTAMP, 8). %(1 << 3)
+-define(SEQ_TRACE_STRICT_MON_TIMESTAMP, 16). %(1 << 4)
+-define(SEQ_TRACE_MON_TIMESTAMP, 32). %(1 << 5)
-export([set_token/1,
set_token/2,
@@ -37,7 +39,7 @@
%%---------------------------------------------------------------------------
--type flag() :: 'send' | 'receive' | 'print' | 'timestamp'.
+-type flag() :: 'send' | 'receive' | 'print' | 'timestamp' | 'monotonic_timestamp' | 'strict_monotonic_timestamp'.
-type component() :: 'label' | 'serial' | flag().
-type value() :: (Integer :: non_neg_integer())
| {Previous :: non_neg_integer(),
@@ -135,5 +137,9 @@ decode_flags(Flags) ->
Print = (Flags band ?SEQ_TRACE_PRINT) > 0,
Send = (Flags band ?SEQ_TRACE_SEND) > 0,
Rec = (Flags band ?SEQ_TRACE_RECEIVE) > 0,
- Ts = (Flags band ?SEQ_TRACE_TIMESTAMP) > 0,
- [{print,Print},{send,Send},{'receive',Rec},{timestamp,Ts}].
+ NowTs = (Flags band ?SEQ_TRACE_NOW_TIMESTAMP) > 0,
+ StrictMonTs = (Flags band ?SEQ_TRACE_STRICT_MON_TIMESTAMP) > 0,
+ MonTs = (Flags band ?SEQ_TRACE_MON_TIMESTAMP) > 0,
+ [{print,Print},{send,Send},{'receive',Rec},{timestamp,NowTs},
+ {strict_monotonic_timestamp, StrictMonTs},
+ {monotonic_timestamp, MonTs}].