From 858c6f7fa44f7b2dc363b359198d6522dd60e914 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 5 Jan 2016 16:55:04 +0100 Subject: Introduce time warp safe trace timestamp formats New timestamp options for trace, sequential trace, and system profile: - monotonic_timestamp - strict_monotonic_timestamp --- erts/doc/src/erlang.xml | 64 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-) (limited to 'erts/doc/src/erlang.xml') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 64eebec936..79d3f66ea8 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -7739,6 +7739,13 @@ ok inactive, and later active when the port callback returns.

+ monotonic_timestamp + +

Timestamps in profile messages will use + Erlang + monotonic time. The time-stamp (Ts) has the same + format and value as produced by erlang:monotonic_time().

+
runnable_procs

If a process is put into or removed from the run queue, a @@ -7759,6 +7766,25 @@ ok {profile, scheduler, Id, State, NoScheds, Ts}, is sent to ProfilerPid.

+ strict_monotonic_timestamp + +

Timestamps in profile messages will consisting of + Erlang + monotonic time and a monotonically increasing + integer. The time-stamp (Ts) has the same format and value + as produced by {erlang:monotonic_time(), + erlang:unique_integer([monotonic])}.

+
+ timestamp + +

Timestamps in profile messages will include a + time-stamp (Ts) that has the same form as returned by + erlang:now(). This is also the default if no + timestamp flag is given. If cpu_timestamp has + been enabled via erlang:trace/3, this will also + effect the timestamp produced in profiling messages + when timestamp flag is enabled.

+

erlang:system_profile is considered experimental and its behavior can change in a future release.

@@ -8118,7 +8144,10 @@ timestamp() -> cpu_timestamp

A global trace flag for the Erlang node that makes all - trace time-stamps to be in CPU time, not wall clock time. + trace time-stamps using the timestamp flag to be + in CPU time, not wall clock time. That is, cpu_timestamp + will not be used if monotonic_timestamp, or + strict_monotonic_timestamp is enabled. Only allowed with PidSpec==all. If the host machine OS does not support high-resolution CPU time measurements, trace/3 exits with @@ -8126,6 +8155,26 @@ timestamp() -> not synchronize this value across cores, so be prepared that time might seem to go backwards when using this option.

+ monotonic_timestamp + +

Includes an + Erlang + monotonic time time-stamp in all trace messages. The + time-stamp (Ts) has the same format and value as produced by + erlang:monotonic_time(). This flag overrides + the cpu_timestamp flag.

+
+ strict_monotonic_timestamp + +

Includes an timestamp consisting of + Erlang + monotonic time and a monotonically increasing + integer in all trace messages. The time-stamp (Ts) has the + same format and value as produced by + {erlang:monotonic_time(), + erlang:unique_integer([monotonic])}. This flag overrides + the cpu_timestamp flag.

+
arity

Used with the call trace flag. @@ -8172,9 +8221,16 @@ timestamp() -> in the following list. Pid is the process identifier of the traced process in which the traced event has occurred. The third tuple element is the message tag.

-

If flag timestamp is given, the first tuple - element is trace_ts instead, and the time-stamp - is added last in the message tuple.

+

If flag timestamp, strict_monotonic_timestamp, or + monotonic_timestamp is given, the first tuple + element is trace_ts instead, and the time-stamp + is added as an extra element last in the message tuple. If + multiple timestamp flags are passed, timestamp has + precedence over strict_monotonic_timestamp which + in turn has precedence over monotonic_timestamp. All + timestamp flags are remembered, so if two are passed + and the one with highest precedence later is disabled + the other one will become active.

{trace, Pid, 'receive', Msg} -- cgit v1.2.3