aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-02-02 16:21:46 +0100
committerRickard Green <[email protected]>2016-02-02 16:21:46 +0100
commitf45b817d0da8f9f61d2241d4f0eb06e47a6be86a (patch)
tree55648184781e4aecb43f7489b7bc7f82c55c1d2c
parent1a1eaec544987f439061622f0177e424dfd6306a (diff)
parent876af25b600bf698cac95cd1902fa16aeecc0c7e (diff)
downloadotp-f45b817d0da8f9f61d2241d4f0eb06e47a6be86a.tar.gz
otp-f45b817d0da8f9f61d2241d4f0eb06e47a6be86a.tar.bz2
otp-f45b817d0da8f9f61d2241d4f0eb06e47a6be86a.zip
Merge branch 'maint'
* maint: Use nano second time unit in tracing
-rw-r--r--erts/doc/src/erl_driver.xml5
-rw-r--r--erts/doc/src/erlang.xml9
-rw-r--r--erts/emulator/beam/erl_trace.c3
-rw-r--r--erts/emulator/test/trace_bif_SUITE.erl4
-rw-r--r--lib/kernel/doc/src/seq_trace.xml5
5 files changed, 15 insertions, 11 deletions
diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml
index aa8f3baee4..241d4131d5 100644
--- a/erts/doc/src/erl_driver.xml
+++ b/erts/doc/src/erl_driver.xml
@@ -1052,8 +1052,9 @@ typedef struct ErlIOVec {
<desc>
<marker id="driver_get_now"></marker>
<warning><p><em>This function is deprecated! Do not use it!</em>
- Use the documented
- <seealso marker="#time_measurement">time measurement functionality</seealso>
+ Use <seealso marker="#erl_drv_monotonic_time"><c>erl_drv_monotonic_time()</c></seealso>
+ (perhaps in combination with
+ <seealso marker="#erl_drv_time_offset"><c>erl_drv_time_offset()</c></seealso>)
instead.</p></warning>
<p>This function reads a timestamp into the memory pointed to by
the parameter <c>now</c>. See the description of <seealso marker="#ErlDrvNowData">ErlDrvNowData</seealso> for
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index d0d35ea25f..d3aad94660 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -7859,7 +7859,8 @@ ok
<p>Timestamps in profile messages will use
<seealso marker="time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso>. The time-stamp (Ts) has the same
- format and value as produced by <c>erlang:monotonic_time()</c>.</p>
+ format and value as produced by
+ <c>erlang:monotonic_time(nano_seconds)</c>.</p>
</item>
<tag><c>runnable_procs</c></tag>
<item>
@@ -7887,7 +7888,7 @@ ok
<seealso marker="time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso> and a monotonically increasing
integer. The time-stamp (Ts) has the same format and value
- as produced by <c>{erlang:monotonic_time(),
+ as produced by <c>{erlang:monotonic_time(nano_seconds),
erlang:unique_integer([monotonic])}</c>.</p>
</item>
<tag><c>timestamp</c></tag>
@@ -8276,7 +8277,7 @@ timestamp() ->
<seealso marker="time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso> time-stamp in all trace messages. The
time-stamp (Ts) has the same format and value as produced by
- <c>erlang:monotonic_time()</c>. This flag overrides
+ <c>erlang:monotonic_time(nano_seconds)</c>. This flag overrides
the <c>cpu_timestamp</c> flag.</p>
</item>
<tag><c>strict_monotonic_timestamp</c></tag>
@@ -8286,7 +8287,7 @@ timestamp() ->
monotonic time</seealso> and a monotonically increasing
integer in all trace messages. The time-stamp (Ts) has the
same format and value as produced by
- <c>{erlang:monotonic_time(),
+ <c>{erlang:monotonic_time(nano_seconds),
erlang:unique_integer([monotonic])}</c>. This flag overrides
the <c>cpu_timestamp</c> flag.</p>
</item>
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index 164bfafc02..25393369a7 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -165,7 +165,8 @@ take_timestamp(ErtsTraceTimeStamp *tsp, int ts_type)
case ERTS_TRACE_FLG_STRICT_MONOTONIC_TIMESTAMP: {
Uint hsz = 0;
ErtsMonotonicTime mtime = erts_get_monotonic_time(NULL);
- mtime += ERTS_MONOTONIC_OFFSET_NATIVE;
+ mtime = ERTS_MONOTONIC_TO_NSEC(mtime);
+ mtime += ERTS_MONOTONIC_OFFSET_NSEC;
hsz = (IS_SSMALL(mtime) ?
(Uint) 0
: ERTS_SINT64_HEAP_SIZE((Sint64) mtime));
diff --git a/erts/emulator/test/trace_bif_SUITE.erl b/erts/emulator/test/trace_bif_SUITE.erl
index 760666d077..96b7dd159f 100644
--- a/erts/emulator/test/trace_bif_SUITE.erl
+++ b/erts/emulator/test/trace_bif_SUITE.erl
@@ -314,9 +314,9 @@ receive_trace_msg_ts_return_to({trace_ts, Pid, return_to, {M,F,A}}, PrevTs, TsTy
make_ts(timestamp) ->
erlang:now();
make_ts(monotonic_timestamp) ->
- erlang:monotonic_time();
+ erlang:monotonic_time(nano_seconds);
make_ts(strict_monotonic_timestamp) ->
- MT = erlang:monotonic_time(),
+ MT = erlang:monotonic_time(nano_seconds),
UMI = erlang:unique_integer([monotonic]),
{MT, UMI}.
diff --git a/lib/kernel/doc/src/seq_trace.xml b/lib/kernel/doc/src/seq_trace.xml
index 9f191d488d..f4fcd222ec 100644
--- a/lib/kernel/doc/src/seq_trace.xml
+++ b/lib/kernel/doc/src/seq_trace.xml
@@ -136,7 +136,7 @@ seq_trace:set_token(OldToken), % activate the trace token again
<seealso marker="erts:time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso> and a monotonically increasing
integer. The time-stamp has the same format and value
- as produced by <c>{erlang:monotonic_time(),
+ as produced by <c>{erlang:monotonic_time(nano_seconds),
erlang:unique_integer([monotonic])}</c>.</p>
</item>
<tag><c>set_token(monotonic_timestamp, <anno>Bool</anno>)</c></tag>
@@ -147,7 +147,8 @@ seq_trace:set_token(OldToken), % activate the trace token again
will use
<seealso marker="erts:time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso>. The time-stamp has the same
- format and value as produced by <c>erlang:monotonic_time()</c>.</p>
+ format and value as produced by
+ <c>erlang:monotonic_time(nano_seconds)</c>.</p>
</item>
<p>If multiple timestamp flags are passed, <c>timestamp</c> has
precedence over <c>strict_monotonic_timestamp</c> which