From afb632d2028fdc4a37e10e41e1929264ff59f52e Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 14 Mar 2013 09:53:33 +0100 Subject: Convert XML files to UTF-8, where needed --- erts/doc/src/notes.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 3a2c644ff7..dffc85ae36 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -1598,7 +1598,7 @@

Fix typo in supervisor behaviour doc (Thanks to Ricardo - Catalinas Jiménez)

+ Catalinas Jiménez)

Own Id: OTP-9924

@@ -1862,7 +1862,7 @@

Fixes module erlang doc style: option description (Thanks - to Ricardo Catalinas Jiménez)

+ to Ricardo Catalinas Jiménez)

Own Id: OTP-9697

@@ -2311,7 +2311,7 @@

Fix typos in the epmd documentation (Thanks to Holger - Weiß )

+ Weiß )

Own Id: OTP-9387

@@ -2416,7 +2416,7 @@

Fix non-existing function (erlang:disconnect/1) in - distributed reference manual (Thanks to Fabian Król)

+ distributed reference manual (Thanks to Fabian Król)

Own Id: OTP-9504

@@ -2444,7 +2444,7 @@ only separator characters (comma and space).

The same applies to epmd's -address option.(Thanks to - Holger Weiß)

+ Holger Weiß)

Own Id: OTP-9525

@@ -2588,7 +2588,7 @@

Add support for querying the number of configured and online processors on SGI systems running IRIX.(Thanks to - Holger Weiß)

+ Holger Weiß)

Own Id: OTP-9531

@@ -2698,7 +2698,7 @@ using a comma-separated list. If the loopback address is not in this list, it will be added implicitly, so that the daemon can be queried by an interactive epmd - process.(Thanks to Holger Weiß)

+ process.(Thanks to Holger Weiß)

Own Id: OTP-9213

@@ -2733,7 +2733,7 @@ value over to dbg_gen_printf(). This fixes the problem that errno had been reset to zero by the time it was used (to print the corresponding error message) in the - dbg_gen_printf() function. (Thanks to Holger Weiß)

+ dbg_gen_printf() function. (Thanks to Holger Weiß)

Own Id: OTP-9223

@@ -3119,7 +3119,7 @@ Mention that "-detached" implies "-noinput"

Clarify that specifying "-noinput" is unnecessary if the - "-detached" flag is given. (thanks to Holger Weiß)

+ "-detached" flag is given. (thanks to Holger Weiß)

Own Id: OTP-9086

@@ -4625,7 +4625,7 @@ failed to detect gcc C compilers with other command line names than gcc. `configure' now substitute GCC into the makefiles. If CC is a gcc C compiler, GCC will have the - value yes. (Thanks to Jean-Sébastien Pédron)

+ value yes. (Thanks to Jean-Sébastien Pédron)

Own Id: OTP-8373

@@ -6995,7 +6995,7 @@

IPv6 name resolving has now been fixed to use getaddrinfo() patch (thoroughly reworked) courtesy of Love - Hörnquist-Åstrand submitted by Fredrik Thulin. It also + Hörnquist-Ã…strand submitted by Fredrik Thulin. It also can use gethostname2() patch (also reworked) courtesy of Mikael Magnusson for debian submitted by Sergei Golovan.

-- cgit v1.2.3 From e5875001247e6a6ac4f474157a51a8c54f94ae49 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 14 Mar 2013 16:01:25 +0100 Subject: Convert XML files to UTF-8 --- erts/doc/src/absform.xml | 2 +- erts/doc/src/alt_dist.xml | 4 ++-- erts/doc/src/book.xml | 4 ++-- erts/doc/src/communication.xml | 2 +- erts/doc/src/crash_dump.xml | 4 ++-- erts/doc/src/driver.xml | 4 ++-- erts/doc/src/driver_entry.xml | 4 ++-- erts/doc/src/epmd.xml | 4 ++-- erts/doc/src/erl.xml | 2 +- erts/doc/src/erl_dist_protocol.xml | 2 +- erts/doc/src/erl_driver.xml | 2 +- erts/doc/src/erl_ext_dist.xml | 2 +- erts/doc/src/erl_nif.xml | 2 +- erts/doc/src/erl_prim_loader.xml | 4 ++-- erts/doc/src/erlang.xml | 2 +- erts/doc/src/erlc.xml | 4 ++-- erts/doc/src/erlsrv.xml | 4 ++-- erts/doc/src/erts_alloc.xml | 2 +- erts/doc/src/escript.xml | 2 +- erts/doc/src/fascicules.xml | 2 +- erts/doc/src/inet_cfg.xml | 4 ++-- erts/doc/src/init.xml | 4 ++-- erts/doc/src/match_spec.xml | 4 ++-- erts/doc/src/notes.xml | 2 +- erts/doc/src/notes_history.xml | 4 ++-- erts/doc/src/part.xml | 2 +- erts/doc/src/part_notes.xml | 4 ++-- erts/doc/src/part_notes_history.xml | 4 ++-- erts/doc/src/ref_man.xml | 2 +- erts/doc/src/run_erl.xml | 4 ++-- erts/doc/src/specs.xml | 2 +- erts/doc/src/start.xml | 4 ++-- erts/doc/src/start_erl.xml | 4 ++-- erts/doc/src/tty.xml | 4 ++-- erts/doc/src/werl.xml | 4 ++-- erts/doc/src/zlib.xml | 4 ++-- 36 files changed, 57 insertions(+), 57 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index e512c19e05..55aef9f8ab 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/alt_dist.xml b/erts/doc/src/alt_dist.xml index 038950b54d..e4912576f7 100644 --- a/erts/doc/src/alt_dist.xml +++ b/erts/doc/src/alt_dist.xml @@ -1,10 +1,10 @@ - +

- 20002011 + 20002013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/book.xml b/erts/doc/src/book.xml index 00a2888685..dc02edc5c6 100644 --- a/erts/doc/src/book.xml +++ b/erts/doc/src/book.xml @@ -1,10 +1,10 @@ - +
- 19972009 + 19972013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/communication.xml b/erts/doc/src/communication.xml index 61a9b0e716..02040c9edb 100644 --- a/erts/doc/src/communication.xml +++ b/erts/doc/src/communication.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index b3c4671c3d..7f17ef2632 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -1,10 +1,10 @@ - +
- 19992010 + 19992013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml index 52283879c7..616703fdef 100644 --- a/erts/doc/src/driver.xml +++ b/erts/doc/src/driver.xml @@ -1,10 +1,10 @@ - +
- 20012011 + 20012013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index c37138e7b1..69a4dea466 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -1,10 +1,10 @@ - +
- 20012012 + 20012013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 3e7005410f..963d35c3c8 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -1,10 +1,10 @@ - +
- 19962011 + 19962013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index a68e62d051..814b904de3 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml index 84f4be208d..890293d802 100644 --- a/erts/doc/src/erl_dist_protocol.xml +++ b/erts/doc/src/erl_dist_protocol.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index efe0483b31..7c74517b2e 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index c6849f3326..28e6f1d05e 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 864b91946a..01651aa83f 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index 9f5b3f385b..6751deda4d 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -1,10 +1,10 @@ - +
- 19962011 + 19962013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 7dc59ea954..5befd51974 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml index 81dffe45cf..10cab344b0 100644 --- a/erts/doc/src/erlc.xml +++ b/erts/doc/src/erlc.xml @@ -1,10 +1,10 @@ - +
- 19972012 + 19972013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml index 365ae21d39..71cee714a5 100644 --- a/erts/doc/src/erlsrv.xml +++ b/erts/doc/src/erlsrv.xml @@ -1,10 +1,10 @@ - +
- 19982012 + 19982013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index c73cdfd290..d0836a551d 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index 9e2a87dde6..180447cac4 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/fascicules.xml b/erts/doc/src/fascicules.xml index cae197a516..1c371bd9c8 100644 --- a/erts/doc/src/fascicules.xml +++ b/erts/doc/src/fascicules.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/inet_cfg.xml b/erts/doc/src/inet_cfg.xml index 2a033c037c..d40bc5f9ee 100644 --- a/erts/doc/src/inet_cfg.xml +++ b/erts/doc/src/inet_cfg.xml @@ -1,10 +1,10 @@ - +
- 20042010 + 20042013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index d5c43f6e57..09b5493341 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -1,10 +1,10 @@ - +
- 19962011 + 19962013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index bdcf9c3816..334b47d34c 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -1,10 +1,10 @@ - +
- 19992012 + 19992013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index dffc85ae36..2bea23ba88 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/notes_history.xml b/erts/doc/src/notes_history.xml index cc3b938c86..4420311912 100644 --- a/erts/doc/src/notes_history.xml +++ b/erts/doc/src/notes_history.xml @@ -1,10 +1,10 @@ - +
- 20062009 + 20062013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml index fa50329cad..fb720e05f3 100644 --- a/erts/doc/src/part.xml +++ b/erts/doc/src/part.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/part_notes.xml b/erts/doc/src/part_notes.xml index 4f183999e6..b5c8f0af09 100644 --- a/erts/doc/src/part_notes.xml +++ b/erts/doc/src/part_notes.xml @@ -1,10 +1,10 @@ - +
- 20042009 + 20042013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/part_notes_history.xml b/erts/doc/src/part_notes_history.xml index 1b9bcca773..a99fa4a17f 100644 --- a/erts/doc/src/part_notes_history.xml +++ b/erts/doc/src/part_notes_history.xml @@ -1,10 +1,10 @@ - +
- 20062009 + 20062013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml index e55923c344..8ed7090a61 100644 --- a/erts/doc/src/ref_man.xml +++ b/erts/doc/src/ref_man.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml index c9784299b3..684f7b1ddd 100644 --- a/erts/doc/src/run_erl.xml +++ b/erts/doc/src/run_erl.xml @@ -1,10 +1,10 @@ - +
- 19992011 + 19992013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/specs.xml b/erts/doc/src/specs.xml index e5c2f4783f..41a3984659 100644 --- a/erts/doc/src/specs.xml +++ b/erts/doc/src/specs.xml @@ -1,4 +1,4 @@ - + diff --git a/erts/doc/src/start.xml b/erts/doc/src/start.xml index 5dc33deb2a..e9a5714f93 100644 --- a/erts/doc/src/start.xml +++ b/erts/doc/src/start.xml @@ -1,10 +1,10 @@ - +
- 19992009 + 19992013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/start_erl.xml b/erts/doc/src/start_erl.xml index 92d87b095a..fe808f7737 100644 --- a/erts/doc/src/start_erl.xml +++ b/erts/doc/src/start_erl.xml @@ -1,10 +1,10 @@ - +
- 19982011 + 19982013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/tty.xml b/erts/doc/src/tty.xml index 7d662a2849..8c01365547 100644 --- a/erts/doc/src/tty.xml +++ b/erts/doc/src/tty.xml @@ -1,10 +1,10 @@ - +
- 19962010 + 19962013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/werl.xml b/erts/doc/src/werl.xml index 1494d91da8..49cc45e745 100644 --- a/erts/doc/src/werl.xml +++ b/erts/doc/src/werl.xml @@ -1,10 +1,10 @@ - +
- 19982009 + 19982013 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index 8917ab5c3a..afc597b729 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -1,10 +1,10 @@ - +
- 20052011 + 20052013 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From 75763bd57338b3efe8300ece094aacc8e1a7a467 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Mon, 25 Mar 2013 12:44:20 +0100 Subject: erts: Change erlang:open_port spawn to handle unicode Previously only 'spawn_executable' handled unicode input. Also change 'cd' option to always handle unicode. Update open_port documentation and tests --- erts/doc/src/erlang.xml | 66 +++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 43 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 5befd51974..81e9084e07 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2613,7 +2613,28 @@ os_prompt%

Returns a port identifier as the result of opening a new Erlang port. A port can be seen as an external Erlang - process. PortName is one of the following:

+ process. +

+

The name of the executable as well as the arguments + given in cd, env, args and arg0 is subject to + Unicode file name translation if the system is running + in Unicode file name mode. To avoid + translation or force i.e. UTF-8, supply the executable + and/or arguments as a binary in the correct + encoding. See the file module, the + + file:native_name_encoding/0 function and the + stdlib users guide + for details.

+ +

The characters in the name (if given as a list) + can only be > 255 if the Erlang VM is started in + Unicode file name translation mode, otherwise the name + of the executable is limited to the ISO-latin-1 + character set.

+ +

PortName is one of the following:

{spawn, Command} @@ -2668,25 +2689,6 @@ os_prompt% executed, the appropriate command interpreter will implicitly be invoked, but there will still be no command argument expansion or implicit PATH search.

- -

The name of the executable as well as the arguments - given in args and arg0 is subject to - Unicode file name translation if the system is running - in Unicode file name mode. To avoid - translation or force i.e. UTF-8, supply the executable - and/or arguments as a binary in the correct - encoding. See the file module, the - - file:native_name_encoding/0 function and the - stdlib users guide - for details.

- -

The characters in the name (if given as a list) - can only be > 255 if the Erlang VM is started in - Unicode file name translation mode, otherwise the name - of the executable is limited to the ISO-latin-1 - character set.

If the FileName cannot be run, an error exception, with the posix error code as the reason, is @@ -2762,11 +2764,7 @@ os_prompt% strings. The one exception is Val being the atom false (in analogy with os:getenv/1), which removes the environment variable. -

-

If Unicode filename encoding is in effect (see the erl manual - page), the strings (both Name and - Value) may contain characters with codepoints > 255.

+

{args, [ string() | binary() ]} @@ -2794,21 +2792,6 @@ os_prompt% should not be given in this list. The proper executable name will automatically be used as argv[0] where applicable.

-

When the Erlang VM is running in Unicode file name - mode, the arguments can contain any Unicode characters and - will be translated into whatever is appropriate on the - underlying OS, which means UTF-8 for all platforms except - Windows, which has other (more transparent) ways of - dealing with Unicode arguments to programs. To avoid - Unicode translation of arguments, they can be supplied as - binaries in whatever encoding is deemed appropriate.

- -

The characters in the arguments (if given as a - list of characters) can only be > 255 if the Erlang - VM is started in Unicode file name mode, - otherwise the arguments are limited to the - ISO-latin-1 character set.

-

If one, for any reason, wants to explicitly set the program name in the argument vector, the arg0 option can be used.

@@ -2824,9 +2807,6 @@ os_prompt% responds to this is highly system dependent and no specific effect is guaranteed.

-

The unicode file name translation rules of the - args option apply to this option as well.

-
exit_status -- cgit v1.2.3 From e753b347a4c88d169992ceaa87e775aebf935bf3 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 4 Jun 2013 12:04:04 +0200 Subject: erts: Use "+Muacul de" as default --- erts/doc/src/erts_alloc.xml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index a303ad18a6..9ea2e7a6b5 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -315,16 +315,17 @@ ]]> is an integer in the range [0, 100] representing utilization in percent. When a utilization value larger than zero is used, allocator instances - are allowed to abandon multiblock carriers. Currently the default - is zero. If de (default enabled) is passed instead of a - ]]>, a recomended non zero utilization - value will be used. The actual value chosen depend on allocator - type and may be changed between ERTS versions. Carriers will be - abandoned when memory utilization in the allocator instance falls - below the utilization value used. Once a carrier has been abandoned, - no new allocations will be made in it. When an allocator instance - gets an increased multiblock carrier need, it will first try to - fetch an abandoned carrier from an allocator instances of the same + are allowed to abandon multiblock carriers. If de (default + enabled) is passed instead of a ]]>, + a recomended non zero utilization value will be used. The actual + value chosen depend on allocator type and may be changed between + ERTS versions. Currently the default equals de, but this + may be changed in the future. Carriers will be abandoned when + memory utilization in the allocator instance falls below the + utilization value used. Once a carrier has been abandoned, no new + allocations will be made in it. When an allocator instance gets an + increased multiblock carrier need, it will first try to fetch an + abandoned carrier from an allocator instances of the same allocator type. If no abandoned carrier could be fetched, it will create a new empty carrier. When an abandoned carrier has been fetched it will function as an ordinary carrier. This feature has -- cgit v1.2.3 From 5d67cc7f4c176ea6ab4d2538443d5fe264152861 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 19 Jun 2013 18:34:56 +0200 Subject: erts: Add new allocator strategy aoffcbf with better performance than aoffcaobf as we don't have to rearrange the search tree when there are blocks of equal size. --- erts/doc/src/erts_alloc.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 2ffb55c6ab..5e008493b9 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -170,6 +170,15 @@ used. The time complexity is proportional to log N, where N is the number of free blocks.

+ Address order first fit carrier best fit + +

Strategy: Find the carrier with the lowest address that + can satisfy the requested block size, then find a block within + that carrier using the "best fit" strategy.

+

Implementation: Balanced binary search trees are + used. The time complexity is proportional to log N, where + N is the number of free blocks.

+
Address order first fit carrier address order best fit

Strategy: Find the carrier with the lowest address that @@ -330,7 +339,7 @@ fetched it will function as an ordinary carrier. This feature has special requirements on the allocation strategy used. Currently - only the aoff and the aoffcaobf strategies support + only the strategies aoff, aoffcbf and aoffcaobf support abandoned carriers. This feature also requires multiple thread specific instances to be enabled. When enabling this feature, multiple thread specific @@ -340,10 +349,11 @@ allocators based on the alloc_util framework with the exception of temp_alloc (which would be pointless). - as bf|aobf|aoff|aoffcaobf|gf|af]]> + as bf|aobf|aoff|aoffcbf|aoffcaobf|gf|af]]> Allocation strategy. Valid strategies are bf (best fit), aobf (address order best fit), aoff (address order first fit), + aoffcbf (address order first fit carrier best fit), aoffcaobf (address order first fit carrier address order best fit), gf (good fit), and af (a fit). See the description of allocation strategies in "the alloc_util framework" section. -- cgit v1.2.3 From 8212fdf19997e08a52ff9374283ff5e148561a0c Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 19 Jun 2013 18:37:36 +0200 Subject: erts: Make aoffcbf default when migration is enabled --- erts/doc/src/erts_alloc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 5e008493b9..6ce2261430 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -344,7 +344,7 @@ multiple thread specific instances to be enabled. When enabling this feature, multiple thread specific instances will be enabled if not already enabled, and the - aoffcaobf strategy will be enabled if current strategy does not + aoffcbf strategy will be enabled if current strategy does not support abandoned carriers. This feature can be enabled on all allocators based on the alloc_util framework with the exception of temp_alloc (which would be pointless). -- cgit v1.2.3 From 02909c3eaa2b4e636e0f17b24c527879cfc1bdcd Mon Sep 17 00:00:00 2001 From: Stefan Zegenhagen Date: Mon, 15 Jul 2013 17:03:07 +0200 Subject: make edlin understand a few important control keys Hi Fredrik, > I've gotten some feedback from your review, > You need to add documentation under Erts-> "User's Guide" -> "tty - A > command line interface" > > You need to add testcase in interactive_shell_SUITE a simplified > example of how this testcase could look like; > ctrl_w_and_ctrl_u(_Conf) -> > rtnode([{putline,""}, {putline, "2."}, {getline, "2"}, > {putline,"xxx yy"++[$\^w]++"."}, {getline,"xxx"}, {putline,"xxx > yy"++[$\^u]++"z."}, {getline,"z"}],[]). Please find an updated version of the patch attached to this e-mail. I hope that you still accept it via e-mail because the former patch was sent the same way ;-). I have extended the documentation to list the new key combinations and added tests to make sure they work. Kind regards, -- Dr. Stefan Zegenhagen arcutronix GmbH Garbsener Landstr. 10 30419 Hannover Germany Tel: +49 511 277-2734 Fax: +49 511 277-2709 Email: stefan.zegenhagen@arcutronix.com Web: www.arcutronix.com *Synchronize the Ethernet* General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer - Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht Hannover; Ust-Id: DE257551767. Please consider the environment before printing this message. >From ce4b827c78d18f39bb1146fd2959ffd7ae2b4bb6 Mon Sep 17 00:00:00 2001 From: Stefan Zegenhagen Date: Mon, 6 May 2013 14:39:07 +0200 Subject: [PATCH] [EDLIN] support a few more control keys Add support for the following control keys that many users have become accustomed to: - +W : backward kill word - +U : backward kill line - : goto start of line - : goto end of line - + : backward word - + : forward word It seems that the + control key sequences are different between terminal emulators, therefore a few possible combinations were added (similar to how libreadline is configured). Documentation and tests are extended to reflect the new functionality. --- erts/doc/src/tty.xml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/tty.xml b/erts/doc/src/tty.xml index 7d662a2849..15b67c8c7d 100644 --- a/erts/doc/src/tty.xml +++ b/erts/doc/src/tty.xml @@ -47,13 +47,17 @@

Normal Mode

In normal mode keystrokes from the user are collected and interpreted by . Most of the emacs line editing commands are supported. The following is a complete list of the supported line editing commands.

-

Note: The notation means pressing the control key and the letter simultaneously. means pressing the key followed by the letter . +

Note: The notation means pressing the control key and the letter simultaneously. means pressing the key followed by the letter . and represent the keys with the same name on the keyboard, whereas and represent the corresponding cursor keys.

Key Sequence Function + + Home + Beginning of line + C-a Beginning of line @@ -62,6 +66,10 @@ C-b Backward character + + C-Left + Backward word + M-b Backward word @@ -74,6 +82,10 @@ M-d Delete word + + End + End of line + C-e End of line @@ -82,6 +94,10 @@ C-f Forward character + + C-Right + Forward word + M-f Forward word @@ -94,6 +110,10 @@ C-k Kill line + + C-u + Backward kill line + C-l Redraw line @@ -110,6 +130,10 @@ C-t Transpose characters + + C-w + Backward kill word + C-y Insert previously killed text -- cgit v1.2.3 From a7db1f6930505ab6a70b0cb41a4c2d52a9448a08 Mon Sep 17 00:00:00 2001 From: olgeni Date: Wed, 7 Aug 2013 12:48:09 +0200 Subject: Misc. corrections for erl_driver(3) - Remove trailing whitespaces - Spelling fixes - Replace "deferred" with "deprecated" where applicable - Remove reference to non-existing "async_ready" entry point --- erts/doc/src/erl_driver.xml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index efe0483b31..f52d973709 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -666,7 +666,7 @@ typedef struct ErlDrvBinary {

The ErlDrvData is a handle to driver-specific data, passed to the driver call-backs. It is a pointer, and is - most often type casted to a specific pointer in the driver.

+ most often type cast to a specific pointer in the driver.

SysIOVec @@ -1014,7 +1014,7 @@ typedef struct ErlIOVec { Read a system timestamp -

This function reads a timestamp into the memory pointed to by +

This function reads a timestamp into the memory pointed to by the parameter now. See the description of ErlDrvNowData for specification of its fields.

The return value is 0 unless the now pointer is not @@ -1056,7 +1056,7 @@ typedef struct ErlIOVec { returned. Another thread may still be using the event object internally. To safely close an event object call driver_select with ERL_DRV_USE and on==0. That - will clear all events and then call + will clear all events and then call stop_select when it is safe to close the event object. ERL_DRV_USE should be set together with the first event @@ -1068,7 +1068,7 @@ typedef struct ErlIOVec {

ERL_DRV_USE was added in OTP release R13. Old drivers will still work as before. But it is recommended to update them to use ERL_DRV_USE and stop_select to make sure that event objects are closed in a safe way.

- +

The return value is 0 (failure, -1, only if the ready_input/ready_output is NULL).

@@ -1524,7 +1524,7 @@ typedef struct ErlIOVec {

This function removes a driver entry de previously added with add_driver_entry.

-

Driver entries added by the erl_ddll erlang interface can +

Driver entries added by the erl_ddll erlang interface can not be removed by using this interface.

@@ -1758,7 +1758,7 @@ typedef struct ErlIOVec {
 Term type            Argument(s)
 ===========================================
-ERL_DRV_NIL          
+ERL_DRV_NIL
 ERL_DRV_ATOM         ErlDrvTermData atom (from driver_mk_atom(char *string))
 ERL_DRV_INT          ErlDrvSInt integer
 ERL_DRV_UINT         ErlDrvUInt integer
@@ -1779,11 +1779,11 @@ ERL_DRV_EXT2TERM     char *buf, ErlDrvUInt len
 	  signed integer data type ErlDrvSInt are 64 bits wide
 	  on a 64 bit runtime system and 32 bits wide on a 32 bit
 	  runtime system. They were introduced in erts version 5.6,
-	  and replaced some of the int arguments in the list above. 
+	  and replaced some of the int arguments in the list above.
 	

The unsigned integer data type ErlDrvUInt64 and the signed integer data type ErlDrvSInt64 are always 64 bits - wide. They were introduced in erts version 5.7.4. + wide. They were introduced in erts version 5.7.4.

To build the tuple {tcp, Port, [100 | Binary]}, the @@ -1879,7 +1879,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len Send term data from driver to port owner -

driver_output_term() is deferred and will +

driver_output_term() is deprecated and will be removed in the OTP-R17 release. Use erl_drv_output_term() instead.

@@ -1937,7 +1937,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len Send term data to other process than port owner process -

driver_send_term() is deferred and will +

driver_send_term() is deprecated and will be removed in the OTP-R17 release. Use erl_drv_send_term() instead.

@@ -1998,7 +1998,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len The data should be freed in async_free, because it's called if driver_async_cancel is called.

When the async operation is done, ready_async driver - entry function is called. If async_ready is null in + entry function is called. If ready_async is null in the driver entry, the async_free function is called instead.

The return value is a handle to the asynchronous task, which @@ -2035,7 +2035,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len as of OTP-R15B driver_async_cancel() is deprecated, and scheduled for removal in OTP-R16. It will currently always fail, and return 0.

-

driver_async_cancel() is deferred and will +

driver_async_cancel() is deprecated and will be removed in the OTP-R16 release.

@@ -2048,7 +2048,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len

This function locks the driver used by the port port in memory for the rest of the emulator process' - lifetime. After this call, the driver behaves as one of Erlang's + lifetime. After this call, the driver behaves as one of Erlang's statically linked in drivers.

@@ -2076,7 +2076,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len driver_entry). drv_data The driver defined handle that will be passed in subsequent - calls to driver call-backs. Note, that the + calls to driver call-backs. Note, that the driver start call-back will not be called for this new driver instance. The driver defined handle is normally created in the @@ -2284,7 +2284,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len A thread identifier.

This function compares two thread identifiers for equality, - and returns 0 it they aren't equal, and + and returns 0 it they aren't equal, and a value not equal to 0 if they are equal.

A Thread identifier may be reused very quickly after a thread has terminated. Therefore, if a thread @@ -2469,7 +2469,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len

This function broadcasts on a condition variable. That is, if other threads are waiting on the condition variable being - broadcasted on, all of them will be woken. + broadcast on, all of them will be woken.

This function is thread-safe.

@@ -2498,7 +2498,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len the calling thread when calling this function.

erl_drv_cond_wait() might return even though - no-one has signaled or broadcasted on the condition + no-one has signaled or broadcast on the condition variable. Code calling erl_drv_cond_wait() should always be prepared for erl_drv_cond_wait() returning even though the condition that the thread was @@ -2822,7 +2822,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len A pointer to an output buffer. value_size A pointer to an integer. The integer is both used for - passing input and output sizes (see below). + passing input and output sizes (see below).

This function retrieves the value of an environment variable. @@ -2900,4 +2900,3 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len Guide Ch. 3)

- -- cgit v1.2.3 From c49f2d1c169add2262a24696f85ea4b8fb8e49a2 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Wed, 14 Aug 2013 12:23:22 +0200 Subject: erts: fixed doc regarding binary_part --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 767edc1cc0..5ee40823bc 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -235,7 +235,7 @@ 1> Bin = <<1,2,3,4,5,6,7,8,9,10>>. -2> binary_part(Bin,{byte_size(Bin), -5)). +2> binary_part(Bin,{byte_size(Bin), -5}). <<6,7,8,9,10>> -- cgit v1.2.3 From 1d547bfa39bcdfac29ed7c2eb3bd7a1daab7a9f1 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Tue, 20 Aug 2013 11:54:41 +0200 Subject: erts: fixed documentation regarding tty and arrow keys --- erts/doc/src/tty.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/tty.xml b/erts/doc/src/tty.xml index 15b67c8c7d..b16523e085 100644 --- a/erts/doc/src/tty.xml +++ b/erts/doc/src/tty.xml @@ -47,7 +47,7 @@
Normal Mode

In normal mode keystrokes from the user are collected and interpreted by . Most of the emacs line editing commands are supported. The following is a complete list of the supported line editing commands.

-

Note: The notation means pressing the control key and the letter simultaneously. means pressing the key followed by the letter . and represent the keys with the same name on the keyboard, whereas and represent the corresponding cursor keys. +

Note: The notation means pressing the control key and the letter simultaneously. means pressing the key followed by the letter . and represent the keys with the same name on the keyboard, whereas and represent the corresponding arrow keys.

-- cgit v1.2.3 From 20e0509d4e04fada3019639bc82d78b89f06b0fc Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 13 Aug 2013 17:14:11 +0200 Subject: erts: Add option to include nifs statically Both crypto and asn1 are supported. --- erts/doc/src/erl_nif.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 01651aa83f..7ac8181d47 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -330,6 +330,8 @@ ok upgrade will be called to initialize the library. unload is called to release the library. They are all described individually below.

+

If compiling a nif for static inclusion via --enable-static-nifs you + have to define STATIC_ERLANG_NIF before the ERL_NIF_INIT declaration.

int (*load)(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info) -- cgit v1.2.3 From 94d174949635cd4e641daaac0a7df98ea35f2c55 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 15 Aug 2013 17:04:52 +0200 Subject: erts: Add support for static linked-in drivers None of the OTP linked-in driver are supported --- erts/doc/src/driver_entry.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index 69a4dea466..48dfcb09b1 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -110,6 +110,8 @@

When the driver has passed the driver_entry over to the emulator, the driver is not allowed to modify the driver_entry.

+

If compiling a driver for static inclusion via --enable-static-drivers you + have to define STATIC_ERLANG_DRIVER before the DRIVER_INIT declaration.

Do not declare the driver_entry const. This since the emulator needs to modify the handle, and the handle2 -- cgit v1.2.3 From 6d1f1d43aa0a9e0a2cb275ef760339c49518fc69 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 16 Aug 2013 17:14:25 +0200 Subject: Create better distribution of files over async threads The actual port id is used to create a key from the pointer value which is the ErlDrvPort. To do this a new driver api function driver_async_port_key is added and the driver API minor version is updated. The documentation is updated and the faulty description of how to spread ports over async threads is updated to use the new API. Testcase also added. --- erts/doc/src/erl_driver.xml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index f52d973709..540390e1b1 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -1981,7 +1981,7 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len thread, the following call can be used:

@@ -2021,6 +2021,24 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len
+ + unsigned intdriver_async_port_key (ErlDrvPort port) + Calculate an async key from an ErlDrvPort + + +

This function calculates a key for later use in driver_async(). The keys are + evenly distributed so that a fair mapping between port id's + and async thread id's is achieved.

+ +

Before OTP-R16, the actual port id could be used as a key + with proper casting, but after the rewrite of the port + subsystem, this is no longer the case. With this function, you + can achieve the same distribution based on port id's as before + OTP-R16.

+
+
+
intdriver_async_cancel(long id) Cancel an asynchronous call @@ -2033,10 +2051,10 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len The user had to implement synchronization of cancellation anyway. It also unnecessarily complicated the implementation. Therefore, as of OTP-R15B driver_async_cancel() is deprecated, and - scheduled for removal in OTP-R16. It will currently always fail, + scheduled for removal in OTP-R17. It will currently always fail, and return 0.

driver_async_cancel() is deprecated and will - be removed in the OTP-R16 release.

+ be removed in the OTP-R17 release.

-- cgit v1.2.3 From a6df426d6daff0ab20c0a81ac834befd69322452 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 19 Apr 2013 11:00:32 +0200 Subject: Add time correction doc in users guide --- erts/doc/src/Makefile | 1 + erts/doc/src/part.xml | 1 + erts/doc/src/time_correction.xml | 274 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 erts/doc/src/time_correction.xml (limited to 'erts/doc') diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index 89d7c85a86..d4c6fe67d2 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -78,6 +78,7 @@ XML_CHAPTER_FILES = \ erl_ext_dist.xml \ erl_dist_protocol.xml \ communication.xml \ + time_correction.xml \ notes.xml \ notes_history.xml diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml index fb720e05f3..7b17b5b551 100644 --- a/erts/doc/src/part.xml +++ b/erts/doc/src/part.xml @@ -32,6 +32,7 @@

The Erlang Runtime System Application ERTS.

+ diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml new file mode 100644 index 0000000000..d52cc7f3e2 --- /dev/null +++ b/erts/doc/src/time_correction.xml @@ -0,0 +1,274 @@ + + + + +
+ + 19992013 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + Time and time correction in Erlang + Patrik Nyblom + + + + + 2013-08-28 + PA1 + time_correction.xml +
+

Time is vital to an Erlang program and, more importantly, correct + time is vital to an Erlang program. As Erlang is a language with + soft real time properties and we have the possibility to express + time in our programs, the Virtual Machine and the language has to be + very careful about what is considered a correct point in time and in + how time functions behave.

+ +

In the beginning, Erlang was constructed assuming that the wall + clock time in the system showed a monotonic time moving forward at + exactly the same pace as the definition of time. That more or less + meant that an atomic clock (or better) was expected to be attached + to your hardware and that the hardware was then expected to be + locked away from any human (or unearthly) tinkering for all + eternity. While this might be a compelling thought, it's simply + never the case.

+ +

A "normal" modern computer can not keep time. Not on itself and + not unless you actually have a chip level atomic clock wired to + it. Time, as perceived by your computer, will normally need to be + corrected. Hence the NTP protocol that together with the ntpd + process will do it's best to keep your computers time in sync with + the "real" time in the universe. Between NTP corrections, usually a + less potent time-keeper than an atomic clock is used.

+ +

But NTP is not fail safe. The NTP server can be unavailable, the + ntp.conf can be wrongly configured or your computer may from time to + time be disconnected from the internet. Furthermore you can have a + user (or even system administrator) on your system that thinks the + right way to handle daylight saving time is to adjust the clock one + hour two times a year (a tip, that is not the right way to do + it...). To further complicate things, this user fetched your + software from the internet and has never ever thought about what's + the correct time as perceived by a computer. The user simply does + not care about keeping the wall clock in sync with the rest of the + universe. The user expects your program to have omnipotent knowledge + about the time.

+ +

Most programmers also expect time to be reliable, at least until + they realize that the wall clock time on their workstation is of by + a minute. Then they simply set it to the correct time, maybe or + maybe not in a smooth way. Most probably not in a smooth way.

+ +

The amount of problems that arise when you expect the wall clock + time on the system to always be correct may be immense. Therefore Erlang + introduced the "corrected estimate of time", or the "time + correction" many years ago. The time correction relies on the fact + that most operating systems have some kind of monotonic clock, + either a real time extension or some built in "tick counter" that is + independent of the wall clock settings. This counter may have + microsecond resolution or much less, but generally it has a drift + that is not to be ignored.

+ +

So we have this monotonic ticking and we have the wall clock + time. Two unreliable times that together can give us an estimate of + an actual wall clock time that does not jump around and that + monotonically moves forward. If the tick counter has a high + resolution, this is fairly easy to do, if the counter has a low + resolution, it's more expensive, but still doable down to + frequencies of 50-60 Hz (of the tick counter).

+ +

So the corrected time is the nearest approximation of an atomic + clock that is available on the computer. We want it to have the + following properties:

+ + Monotonic + The clock should not move backwards + Intervals should be near the truth + We want the actual time (as measured by an atomic clock or + an astronomer) that passes between two time stamps, T1 and T2, to be as + near to T2 - T1 as possible. + Tight coupling to the wall clock + We want a timer that is to be fired when the wall clock + reaches a time in the future, to fire as near to that point in + time as possible + +

To meet all the criteria, we have to utilize both times in such a + way that Erlangs "corrected time" moves slightly slower or slightly + faster than the wall clock to get in sync with it. The word + "slightly" means a maximum of 1% difference to the wall clock time, + meaning that a sudden change in the wall clock of one minute, takes + 100 minutes to fix, by letting all "corrected time" move 1% slower + or faster.

+ +

Needless to say, correcting for a faulty handling of daylight + saving time may be disturbing to a user comparing wall clock + time to for example calendar:now_to_local_time(erlang:now()). But + calendar:now_to_local_time/1 is not supposed to be used for presenting wall + clock time to the user.

+ +

Time correction is not perfect, but it saves you from the havoc + of clocks jumping around, which would make timers in your program + fire far to late or far to early and could bring your whole system + to it's knees (or worse) just because someone detected a small error + in the wall clock time of the server where your program runs. So + while it might be confusing, it is still a really good feature of + Erlang and you should not throw it away using time functions which + may give you higher benchmark results, not unless you really know + what you're doing.

+ +
+ What does time correction mean in my system? +

Time correction means that Erlang estimates a time from current + and previous settings of the wall clock, and it uses a fairly + exact tick counter to detect when the wall clock time has jumped + for some reason, slowly adjusting to the new value.

+ +

In practice, this means that the difference between two calls + to time corrected functions, like erlang:now(), might differ up to + one percent from the corresponding calls to non time corrected + functions (like os:timestamp()). Furthermore, if comparing + calendar:local_time/0 to calendar:now_to_local_time(erlang:now()), + you might temporarily see a difference, depending on how well kept your + system is.

+ +

It is important to understand that it is (to the program) + always unknown if it is the wall clock time that moves in the + wrong pace or the Erlang corrected time. The only way to determine + that, is to have an external source of universally correct time. If + some such source is available, the wall clock time can be kept + nearly perfect at all times, and no significant difference will be + detected between erlang:now/0's pace and the wall clock's.

+ +

Still, the time correction will mean that your system keeps + it's real time characteristics very well, even when the wall clock + is unreliable.

+
+
+ Where does Erlang use corrected time? +

For all functionality where real time characteristics are + desirable, time correction is used. This basically means:

+ + erlang:now/0 + The infamous erlang:now/0 function uses time correction so + that differences between two "now-timestamps" will correspond to + other timeouts in the system. erlang:now/0 also holds other + properties, discussed later. + receive ... after + Timeouts on receive uses time correction to determine a + stable timeout interval. + The timer module + As the timer module uses other built in functions which + deliver corrected time, the timer module itself works with + corrected time. + erlang:start_timer/3 and erlang:send_after/3 + The timer BIF's work with corrected time, so that they + will not fire prematurely or too late due to changes in the wall + clock time. + + +

All other functionality in the system where erlang:now/0 or any + other time corrected functionality is used, will of course + automatically benefit from it, as long as it's not "optimized" to + use some other time stamp function (like os:timestamp/0).

+ +

Modules like calendar and functions like erlang:localtime/0 use + the wall clock time as it is currently set on the system. They + will not use corrected time. However, if you use a now-value and + convert it to local time, you will get a corrected local time + value, which may or may not be what you want. Typically older code + tend to use erlang:now/0 as a wall clock time, which is usually + correct (at least when testing), but might surprise you when + compared to other times in the system.

+
+
+ What is erlang:now/0 really? +

erlang:now/0 is a function designed to serve multiple purposes + (or a multi-headed beast if you're a VM designer). It is expected + to hold the following properties:

+ + Monotonic + erlang:now() never jumps backwards - it always moves + forward + Interval correct + The interval between two erlang:now() calls is expected to + correspond to the correct time in real life (as defined by an + atomic clock, or better) + Absolute correctness + The erlang:now/0 value should be possible to convert to an + absolute and correct date-time, corresponding to the real world + date and time (the wall clock) + System correspondence + The erlang:now/0 value converted to a date-time is + expected to correspond to times given by other programs on the + system (or by functions like os:timestamp/0) + Unique + No two calls to erlang:now on one Erlang node should + return the same value + +

All these requirements are possible to uphold at the same + time if (and only if):

+ + The wall clock time of the system is perfect + The system (Operating System) time needs to be perfectly + in sync with the actual time as defined by an atomic clock or + a better time source. A good installation using NTP, and that is + up to date before Erlang starts, will have properties that for + most users and programs will be near indistinguishable from the + perfect time. Note that any larger corrections to the time done + by hand, or after Erlang has started, will partly (or + temporarily) invalidate some of the properties, as the time is + no longer perfect. + Less than one call per microsecond to erlang:now/0 is + done + This means that at any microsecond interval in + time, there can be no more than one call to erlang:now/0 in the + system. However, for the system not to loose it's properties + completely, it's enough that it on average is no more than one + call per microsecond (in one Erlang node). + +

The uniqueness property of erlang:now/0 is the most limiting + property. It means that erlang:now() maintains a global state and + that there is a hard-to-check property of the system that needs to + be maintained. For most applications this is still not a problem, + but a future system might very well manage to violate the + frequency limit on the calls globally. The uniqueness property is + also quite useless, as there are globally unique references that + provide a much better unique value to programs. However the + property will need to be maintained unless a really subtle + backward compatibility issue is to be introduced.

+
+
+ Should I use erlang:now/0 or os:timestamp/0 +

The simple answer is to use erlang:now/0 for everything where + you want to keep real time characteristics, but use os:timestamp + for things like logs, user communication and debugging (typically + timer:ts uses os:timestamp, as it is a test tool, not a real world + application API). The benefit of using os:timestamp/0 is that it's + faster and does not involve any global state (unless the operating + system has one). The downside is that it will be vulnerable to wall + clock time changes.

+
+
+ Turning off time correction +

If, for some reason, time correction causes trouble and you are + absolutely confident that the wall clock on the system is nearly + perfect, you can turn off time correction completely by giving the + +c option to erl. The probability for this being a + good idea, is very low.

+
+
+ -- cgit v1.2.3 From 69e01c0f5d332d34b95575203ae9d7829b9a45fa Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Tue, 20 Aug 2013 21:09:47 -0400 Subject: add erl option to set schedulers by percentages For applications where measurements show enhanced performance from the use of a non-default number of emulator scheduler threads, having to accurately set the right number of scheduler threads across multiple hosts each with different numbers of logical processors is difficult because the erl +S option requires absolute numbers of scheduler threads and scheduler threads online to be specified. To address this issue, add a +SP option to erl, similar to the existing +S option but allowing the number of scheduler threads and scheduler threads online to be set as percentages of logical processors configured and logical processors available, respectively. For example, "+SP 50:25" sets the number of scheduler threads to 50% of the logical processors configured, and the number of scheduler threads online to 25% of the logical processors available. The +SP option also interacts with any settings specified with the +S option, such that the combination of options "+S 4:4 +SP 50:50" (in either order) results in 2 scheduler threads and 2 scheduler threads online. Add documentation for the +SP option. Add tests for the +SP option to scheduler_SUITE. Add tests and documentation for two existing features of the +S option: +S 0:0 resets the scheduler thread count and scheduler threads online count to their defaults, and specifying negative numbers for +S results in those values being subtracted from the default values for the host. --- erts/doc/src/erl.xml | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 70569b1c6c..c16b45856d 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -748,19 +748,47 @@ -

Sets the amount of scheduler threads to create and scheduler - threads to set online when SMP support has been enabled. - Valid range for both values are 1-1024. If the - Erlang runtime system is able to determine the amount - of logical processors configured and logical processors available, - Schedulers will default to logical processors configured, - and SchedulersOnline will default to logical processors - available; otherwise, the default values will be 1. Schedulers - may be omitted if :SchedulerOnline is not and vice versa. The - amount of schedulers online can be changed at run time via +

Sets the number of scheduler threads to create and scheduler + threads to set online when SMP support has been enabled. The maximum for + both values is 1024. If the Erlang runtime system is able to determine the + amount of logical processors configured and logical processors available, + Schedulers will default to logical processors configured, and + SchedulersOnline will default to logical processors available; + otherwise, the default values will be 1. Schedulers may be omitted + if :SchedulerOnline is not and vice versa. The number of schedulers + online can be changed at run time via erlang:system_flag(schedulers_online, SchedulersOnline).

-

This flag will be ignored if the emulator doesn't have +

If Schedulers or SchedulersOnline is specified as a + negative number, the value is subtracted from the default number of + logical processors configured or logical processors available, respectively. +

+

Specifying the value 0 for Schedulers or SchedulersOnline + resets the number of scheduler threads or scheduler threads online respectively + to its default value. +

+

This option is ignored if the emulator doesn't have + SMP support enabled (see the -smp + flag).

+
+ + +

Similar to +S but uses percentages to set the + number of scheduler threads to create, based on logical processors configured, + and scheduler threads to set online, based on logical processors available, when + SMP support has been enabled. Specified values must be greater than 0. For example, + +SP 50:25 sets the number of scheduler threads to 50% of the logical processors + configured and the number of scheduler threads online to 25% of the logical processors available. + SchedulersPercentage may be omitted if :SchedulersOnlinePercentage is + not and vice versa. The number of schedulers online can be changed at run time via + erlang:system_flag(schedulers_online, SchedulersOnline). +

+

This option interacts with +S settings. + For example, on a system with 8 logical cores configured and 8 logical cores + available, the combination of the options +S 4:4 +SP 50:25 (in either order) + results in 2 scheduler threads (50% of 4) and 1 scheduler thread online (25% of 4). +

+

This option is ignored if the emulator doesn't have SMP support enabled (see the -smp flag).

-- cgit v1.2.3 From a209817dd8467a04be869541e7c31216dc4b0a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 3 Sep 2013 17:11:24 +0200 Subject: erts: Document erl_driver interface lock names --- erts/doc/src/erl_driver.xml | 78 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index efe0483b31..5cf0d2f47f 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -2889,8 +2889,84 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len beginning of this document.

- + + char *erl_drv_cond_name(ErlDrvCond *cnd) + Get name of driver mutex. + + +

Arguments:

+ + cnd + A pointer to an initialized condition. + +

+ Returns a pointer to the name of the condition. +

+ +

This function is intended for debugging purposes only.

+
+
+
+ + + char *erl_drv_mutex_name(ErlDrvMutex *mtx) + Get name of driver mutex. + + +

Arguments:

+ + mtx + A pointer to an initialized mutex. + +

+ Returns a pointer to the name of the mutex. +

+ +

This function is intended for debugging purposes only.

+
+
+
+ + + char *erl_drv_rwlock_name(ErlDrvRWLock *rwlck) + Get name of driver mutex. + + +

Arguments:

+ + rwlck + A pointer to an initialized r/w-lock. + +

+ Returns a pointer to the name of the r/w-lock. +

+ +

This function is intended for debugging purposes only.

+
+
+
+ + + char *erl_drv_thread_name(ErlDrvTid tid) + Get name of driver mutex. + + +

Arguments:

+ + tid + A thread identifier. + +

+ Returns a pointer to the name of the thread. +

+ +

This function is intended for debugging purposes only.

+
+
+
+ +
SEE ALSO

driver_entry(3), -- cgit v1.2.3 From d7ce2d9b68ba83e46100a97aaf56c0ca09899525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 6 Sep 2013 10:03:56 +0200 Subject: Convert some notes.xml files from latin-1 to utf-8 In the master branch, the encoding for most xml files have been changed from latin-1 to utf-8. The problem is, that the corresponding files in the maint branch still are encoded in latin-1, and that a merge from maint to master may bring in characters encoded in latin-1 into a notes.xml file declared to be in utf-8. To fix the problem once and for all (for the files involved), we'll need to re-encode the files files utf-8 in maint, and then merge to master. Noticed-by: Magnus Henoch --- erts/doc/src/notes.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index f94d71ee3d..822aceff08 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -321,7 +321,7 @@

Support wide characters in the shell through wcwidth(). - Thanks to Anthony Ramine. Reported by Loïc Hoguin.

+ Thanks to Anthony Ramine. Reported by Loïc Hoguin.

Own Id: OTP-11088

@@ -342,7 +342,7 @@

Remove 'query' from the list of reserved words in docs. - Thanks to Matthias Endler and Loïc Hoguin.

+ Thanks to Matthias Endler and Loïc Hoguin.

Own Id: OTP-11158

@@ -1961,7 +1961,7 @@

Fix typo in supervisor behaviour doc (Thanks to Ricardo - Catalinas Jiménez)

+ Catalinas Jiménez)

Own Id: OTP-9924

@@ -2225,7 +2225,7 @@

Fixes module erlang doc style: option description (Thanks - to Ricardo Catalinas Jiménez)

+ to Ricardo Catalinas Jiménez)

Own Id: OTP-9697

@@ -2674,7 +2674,7 @@

Fix typos in the epmd documentation (Thanks to Holger - Weiß )

+ Weiß )

Own Id: OTP-9387

@@ -2779,7 +2779,7 @@

Fix non-existing function (erlang:disconnect/1) in - distributed reference manual (Thanks to Fabian Król)

+ distributed reference manual (Thanks to Fabian Król)

Own Id: OTP-9504

@@ -2807,7 +2807,7 @@ only separator characters (comma and space).

The same applies to epmd's -address option.(Thanks to - Holger Weiß)

+ Holger Weiß)

Own Id: OTP-9525

@@ -2951,7 +2951,7 @@

Add support for querying the number of configured and online processors on SGI systems running IRIX.(Thanks to - Holger Weiß)

+ Holger Weiß)

Own Id: OTP-9531

@@ -3061,7 +3061,7 @@ using a comma-separated list. If the loopback address is not in this list, it will be added implicitly, so that the daemon can be queried by an interactive epmd - process.(Thanks to Holger Weiß)

+ process.(Thanks to Holger Weiß)

Own Id: OTP-9213

@@ -3096,7 +3096,7 @@ value over to dbg_gen_printf(). This fixes the problem that errno had been reset to zero by the time it was used (to print the corresponding error message) in the - dbg_gen_printf() function. (Thanks to Holger Weiß)

+ dbg_gen_printf() function. (Thanks to Holger Weiß)

Own Id: OTP-9223

@@ -3482,7 +3482,7 @@ Mention that "-detached" implies "-noinput"

Clarify that specifying "-noinput" is unnecessary if the - "-detached" flag is given. (thanks to Holger Weiß)

+ "-detached" flag is given. (thanks to Holger Weiß)

Own Id: OTP-9086

@@ -4988,7 +4988,7 @@ failed to detect gcc C compilers with other command line names than gcc. `configure' now substitute GCC into the makefiles. If CC is a gcc C compiler, GCC will have the - value yes. (Thanks to Jean-Sébastien Pédron)

+ value yes. (Thanks to Jean-Sébastien Pédron)

Own Id: OTP-8373

@@ -7358,7 +7358,7 @@

IPv6 name resolving has now been fixed to use getaddrinfo() patch (thoroughly reworked) courtesy of Love - Hörnquist-Åstrand submitted by Fredrik Thulin. It also + Hörnquist-Ã…strand submitted by Fredrik Thulin. It also can use gethostname2() patch (also reworked) courtesy of Mikael Magnusson for debian submitted by Sergei Golovan.

-- cgit v1.2.3 From 20641fe0f2ea745873fc7557448d3a7deb1bd639 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 16 Sep 2013 20:11:53 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 226 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 822aceff08..77ffeefd04 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,232 @@

This document describes the changes made to the ERTS application.

+
Erts 5.10.3 + +
Fixed Bugs and Malfunctions + + +

The documentation of predefined types and built-in + types has been corrected.

+

+ Own Id: OTP-11090

+
+ +

+ Fix changing terminal parameters in to_erl

+

+ Change the behaviour of to_erl to use TCSADRAIN instead + of TCSANOW when changing terminal parameters. This makes + the serial driver wait for the output queues to be empty + before applying the terminal parameter change. Thanks to + Stefan Zegenhagen.

+

+ Own Id: OTP-11206

+
+ +

+ The default value of {flush, boolean()} in erlang:halt/2 + is documented to be 'true' if the status is an integer. + The implementation behaviour was reversed. The + Implementation is now corrected to adhere to the + documentation. Thanks to Jose Valim for reporting the + error.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11218

+
+ +

+ Fix serious race bug in R16B01 that could cause PID + mix-ups when a lot of processes were spawned and + terminated in a very rapid pace on an SMP emulator with + at least two scheduler threads.

+

+ Own Id: OTP-11225

+
+ +

+ Validating a trace pattern with the option silent no + longer incorrectly enables/disables the silent option of + the calling process.

+

+ Own Id: OTP-11232

+
+ +

+ Fixed a bug where GCC 4.8 and later use a more aggressive + loop optimization algorithm that broke some previously + working code in the efile driver. Thanks to Tomas + Abrahamsson for reporting this issue.

+

+ Own Id: OTP-11246

+
+ +

+ Fixed bug when printing memory allocator acul option in + crash dump.

+

+ Own Id: OTP-11264

+
+ +

+ Opening a new compressed file on Windows could in rare + (random) cases result in {error,eisdir} or other error + codes although it should have succeeded. This is now + corrected.

+

+ Own Id: OTP-11265

+
+ +

+ Fixed a race condition when closing a trace port that + would cause the emulator to crash.

+

+ Own Id: OTP-11290

+
+
+
+ + +
Improvements and New Features + + +

+ There is a new somewhat experimental socket option + 'netns' that can set the network namespace for a socket + on Linux:es where it is supported. See the documentation.

+

+ Own Id: OTP-11157

+
+ +

+ New allocator strategy aoffcbf (address order + first fit carrier best fit). Supports carrier migration + but with better CPU performance than aoffcaobf.

+

+ Own Id: OTP-11174

+
+ +

+ Introduced functionality for inspection of system and + build configuration.

+

+ Own Id: OTP-11196

+
+ +

+ Fix matching of floating point middle-endian machines. + Thanks to Johannes Weissl.

+

+ Own Id: OTP-11201

+
+ +

+ Fix compile error on ARM and GCC versions greater than + 4.1.0. Thanks to Johannes Weissl.

+

+ Own Id: OTP-11214

+
+ +

+ run_erl: Redirect standard streams to /dev/null. Thanks + to Johannes Weissl.

+

+ Own Id: OTP-11215

+
+ +

+ Misc. corrections in documentation for erl_driver. Thanks + to Giacomo Olgeni.

+

+ Own Id: OTP-11227

+
+ +

+ Fix documentation regarding binary_part.

+

+ Own Id: OTP-11239

+
+ +

+ Make edlin understand a few important control keys. + Thanks to Stefan Zegenhagen.

+

+ Own Id: OTP-11251

+
+ +

+ Export type zlib:zstream/0. Thanks to Loic Hoguin.

+

+ Own Id: OTP-11278

+
+ +

+ Add erl option to set schedulers by percentages.

+

+ For applications where measurements show enhanced + performance from the use of a non-default number of + emulator scheduler threads, having to accurately set the + right number of scheduler threads across multiple hosts + each with different numbers of logical processors is + difficult because the erl +S option requires absolute + numbers of scheduler threads and scheduler threads online + to be specified.

+

+ To address this issue, add a +SP option to erl, similar + to the existing +S option but allowing the number of + scheduler threads and scheduler threads online to be set + as percentages of logical processors configured and + logical processors available, respectively. For example, + "+SP 50:25" sets the number of scheduler threads to 50% + of the logical processors configured, and the number of + scheduler threads online to 25% of the logical processors + available. The +SP option also interacts with any + settings specified with the +S option, such that the + combination of options "+S 4:4 +SP 50:50" (in either + order) results in 2 scheduler threads and 2 scheduler + threads online.

+

+ Thanks to Steve Vinoski

+

+ Own Id: OTP-11282

+
+ +

+ Extend erl_driver interface with lock names

+

+ Lock and thread names are already a feature in the driver + interface. This extension will let developers read these + names which eases debugging.

+

+ Own Id: OTP-11303

+
+ +

+ Fix incorrect values returned by integer_to_binary/2. + Thanks to Juan Jose Comellas.

+

+ Own Id: OTP-11311

+
+ +

+ Fix system_flag scheduling_statistics - disable . Thanks + to Steve Vinoski.

+

+ Own Id: OTP-11317

+
+ +

The documentation of predefined types has been + corrected Thanks to Kostis Sagonas.

+

+ Own Id: OTP-11321

+
+
+
+ +
+
Erts 5.10.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 75a79e6547fd66c2194d6f488c30ad888a715f4b Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Wed, 4 Sep 2013 10:21:47 -0400 Subject: add system_info(ets_limit) Add system_info(ets_limit) to provide a way to retrieve the runtime's maximum number of ETS tables. Add tests and documentation for it too. Also repair the alphabetical order of system_info/1 argument descriptions in the documentation and in the erlang.erl clauses. Add new preloaded erlang.erl due to that change. Also ensure all system_info/1 clauses are represented in the erlang.xml source documentation -- a couple had been inadvertently dropped in previous commits when other clauses were added. --- erts/doc/src/erl.xml | 2 +- erts/doc/src/erlang.xml | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index c16b45856d..528a2d95aa 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -524,7 +524,7 @@

Calling erlang:halt/1 with a string argument will still produce a crash dump.

- +

Set max number of ETS tables.

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 5ee40823bc..d3b21de8cf 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5500,6 +5500,9 @@ ok + + + Information about the system

Returns various information about the current system @@ -5576,6 +5579,13 @@ ok information see the "How to interpret the Erlang crash dumps" chapter in the ERTS User's Guide.

+ dist_buf_busy_limit + +

Returns the value of the distribution buffer busy limit + in bytes. This limit can be set on startup by passing the + +zdbbl command line + flag to erl.

+
dist_ctrl

Returns a list of tuples @@ -5622,12 +5632,14 @@ ok The return value will always be false since the elib_malloc allocator has been removed.

- dist_buf_busy_limit + ets_limit -

Returns the value of the distribution buffer busy limit - in bytes. This limit can be set on startup by passing the - +zdbbl command line - flag to erl.

+

Returns the maximum number of ETS tables allowed. This limit + can be increased on startup by passing the +e command line flag to + erl or by setting the environment variable + ERL_MAX_ETS_TABLES before starting the Erlang runtime + system.

fullsweep_after -- cgit v1.2.3 From abac2eda110a33d8310c0f9cc152d91de37f731d Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 27 Sep 2013 17:16:02 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 77ffeefd04..b25e4ccbec 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,30 @@

This document describes the changes made to the ERTS application.

+
Erts 5.10.3.1 + +
Improvements and New Features + + +

+ Memory allocators will be able to create sys_alloc + carriers as fallback, if mseg_alloc cannot create + more carriers, on systems with posix_memalign() + support. This is similar to how it worked in pre-R16 + releases.

+

+ Windows systems will create carriers using + _aligned_malloc() and can by this use the new + optimized allocator header scheme introduced in R16 on + other platforms.

+

+ Own Id: OTP-11318

+
+
+
+ +
+
Erts 5.10.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From ffbd1fe3fe4fdd1657f98d650eb3b40139e4b115 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 10 Sep 2013 15:33:33 +0200 Subject: erts: Add documentation for +MMsc* system flags --- erts/doc/src/erts_alloc.xml | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 6ce2261430..9dab5b3876 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -271,6 +271,65 @@ memory segment cache is not reused if its size exceeds the requested size with more than relative max cache bad fit percent of the requested size. Default value is 20. + ]]> + + Set super carrier max guaranteed + no of carriers. This parameter defaults to 65536. This + parameter determines an amount of pre-allocated structures that is + needed in order to keep track of different areas in the super carrier. + When the system runs out of such structures it may crash due to an + out of memory condition. + + + + Set super carrier only flag. This + flag defaults to true. When a super carrier is used and this + flag is true, the system will crash when a carrier request + cannot be satisfied by the super carrier. When the flag is false + the system will try to create requested carrier by other means. +

+ NOTE: Setting this flag to false may not be supported + on all systems. This flag will in that case be ignored. +

+ NOTE: The super carrier cannot be enabled nor + disabled on halfword heap systems. This flag will be + ignored on halfword heap systems. +
+ + + Set super carrier reserve physical + memory flag. This flag defaults to true. When this flag is + true, physical memory will be reserved for the whole super + carrier at once when it is created. The reservation will after that + be left unchanged. When this flag is set to false only virtual + address space will be reserved for the super carrier upon creation. + The system will attempt to reserve physical memory upon carrier + creations in the super carrier, and attempt to unreserve physical + memory upon carrier destructions in the super carrier. +

+ NOTE: What reservation of physical memory actually means + highly depends on the operating system, and how it is configured. For + example, different memory overcommit settings on Linux drastically + change the behaviour. Also note, setting this flag to false + may not be supported on all systems. This flag will in that case + be ignored. +

+ NOTE: The super carrier cannot be enabled nor + disabled on halfword heap systems. This flag will be + ignored on halfword heap systems. +
+ ]]> + + Set super carrier size (in MB). The super carrier size defaults to + zero; i.e, the super carrier is by default disabled. The super + carrier is a large continuous area in the virtual address space. + The system will always try to create new carriers in the super + carrier. +

+ NOTE: The super carrier cannot be enabled nor + disabled on halfword heap systems. This flag will be + ignored on halfword heap systems. +
]]> Max cached segments. The maximum number of memory segments -- cgit v1.2.3 From 41e340fb37d0e660fca70486dc715383df9ba026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=A4ssler?= Date: Thu, 2 May 2013 20:52:30 +0200 Subject: Fix erts erlang.xml doc typo badargif -> badarg if --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index d3b21de8cf..bc38055b62 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2467,7 +2467,7 @@ os_prompt% fails, a nodedown message is delivered.

Nodes connected through hidden connections can be monitored as any other node.

-

Failure: badargif the local node is not alive.

+

Failure: badarg if the local node is not alive.

-- cgit v1.2.3 From 3d4078722e5baa1bc64c1e6a808f98c802faa6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 5 Nov 2013 06:43:47 +0100 Subject: erts: Clarify documentation for erlang:statistics(run_queue) --- erts/doc/src/erlang.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index bc38055b62..cbb25c2cf2 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4727,8 +4727,8 @@ true Information about the run-queue -

Returns the length of the run queue, that is, the number - of processes that are ready to run.

+

Returns the total length of the run queues, that is, the number + of processes that are ready to run on all available run queues.

-- cgit v1.2.3 From f17532112c6b723a7b025c7d74565e7ac2588cbb Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 4 Nov 2013 17:18:52 +0100 Subject: Add support for locking mappings to physical memory Using "+Mlpm all" switch all mappings made by the emulator will be locked into physical memory. --- erts/doc/src/erts_alloc.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 9dab5b3876..90bc35cdc9 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -604,6 +604,16 @@
+ +Mlpm all|no + Lock physical memory. The default value is no, i.e., + no physical memory will be locked. If set to all, all + memory mappings made by the runtime system, will be locked into + physical memory. If set to all, the runtime system will fail + to start if this feature is not supported, the user has not got enough + privileges, or the user is not allowed to lock enough physical memory. + The runtime system will also fail with an out of memory condition + if the user limit on the amount of locked memory is reached. +

Only some default values have been presented here. -- cgit v1.2.3 From bb59a8fcf1f6cf4162a2a97c13087843d1b9dac4 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 5 Nov 2013 15:37:49 +0100 Subject: Add switch for disabling sys_alloc carriers The switch "+Musac " controls if sys_alloc carriers are allowed. --- erts/doc/src/erts_alloc.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 90bc35cdc9..70029dbeab 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -549,6 +549,11 @@ placed in separate memory segments. When this limit has been reached, new carriers will be placed in memory retrieved from sys_alloc. + ]]> + + Allow sys_alloc carriers. By default true. If + set to false, sys_alloc carriers will never be + created by allocators using the alloc_util framework.

Instrumentation flags:

-- cgit v1.2.3 From e526cb32336afc4feb4b92665d31ccc2af3e741c Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 5 Nov 2013 17:00:38 +0100 Subject: Replace the +MMscmgc switch with +MMscrfsd Replaced the +MMscmgc switch with the +MMscrfsd switch. The old switch didn't reflect what it controlled. --- erts/doc/src/erts_alloc.xml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 70029dbeab..8f5e8cd10b 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -271,15 +271,6 @@ memory segment cache is not reused if its size exceeds the requested size with more than relative max cache bad fit percent of the requested size. Default value is 20. - ]]> - - Set super carrier max guaranteed - no of carriers. This parameter defaults to 65536. This - parameter determines an amount of pre-allocated structures that is - needed in order to keep track of different areas in the super carrier. - When the system runs out of such structures it may crash due to an - out of memory condition. - Set super carrier only flag. This @@ -295,6 +286,19 @@ disabled on halfword heap systems. This flag will be ignored on halfword heap systems. + ]]> + + Set super carrier reserved + free segment descriptors. This parameter defaults to 65536. + This parameter determines the amount of memory to reserve for + free segment descriptors used by the super carrier. If the system + runs out of reserved memory for free segment descriptors, other + memory will be used. This may however cause fragmentation issues, + so you want to ensure that this never happens. The maximum amount + of free segment descriptors used can be retrieved from the + erts_mmap tuple part of the result from calling + erlang:system_info({allocator, mseg_alloc}). + Set super carrier reserve physical -- cgit v1.2.3 From b82549dfb985e4b55a6531d634e46446f7a8dbee Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 5 Nov 2013 17:13:35 +0100 Subject: Fix documentation of the +MMsco switch --- erts/doc/src/erts_alloc.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 8f5e8cd10b..a0ec89f398 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -275,9 +275,14 @@ Set super carrier only flag. This flag defaults to true. When a super carrier is used and this - flag is true, the system will crash when a carrier request - cannot be satisfied by the super carrier. When the flag is false - the system will try to create requested carrier by other means. + flag is true, mseg_alloc will only create carriers + in the super carrier. Note that the alloc_util framework may + create sys_alloc carriers, so if you want all carriers to + be created in the super carrier, you therefore want to disable use + of sys_alloc carriers by also passing + +Musac false. When the flag + is false, mseg_alloc will try to create carriers outside + of the super carrier when the super carrier is full.

NOTE: Setting this flag to false may not be supported on all systems. This flag will in that case be ignored. -- cgit v1.2.3 From ee0ca14382e76d97285e64b3396fbb87f33e23da Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 18 Nov 2013 16:56:40 +0100 Subject: erts: Fix bugs in binary_to_term for invalid bitstrings <<131, 77, Len:32, Bits:8, Data/binary>> badarg if Bits > 8 Used to return internally inconsistent bitstring badarg if Len==0 and Bits > 0 Used to return invalid *huge* binary (size = (Uint)-1) badarg if Bits==0 and Len > 0 Used to return valid binary as if Bits was 8 --- erts/doc/src/erl_ext_dist.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index c6849f3326..64a201cc8f 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -1014,10 +1014,10 @@

- This term represents a bitstring whose length in bits is not a - multiple of 8 (created using the bit syntax in R12B and later). + This term represents a bitstring whose length in bits does + not have to be a multiple of 8. The Len field is an unsigned 4 byte integer (big endian). - The Bits field is the number of bits that are used + The Bits field is the number of bits (1-8) that are used in the last byte in the data field, counting from the most significant bit towards the least significant. -- cgit v1.2.3 From ca0425c6ff85262bc15367f5fd9cbc51cde52b20 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 2 Oct 2013 10:07:27 +0200 Subject: Execution of system tasks in context of another process A process requesting a system task to be executed in the context of another process will be notified by a message when the task has executed. This message will be on the form: {RequestType, RequestId, Pid, Result}. A process requesting a system task to be executed can set priority on the system task. The requester typically set the same priority on the task as its own process priority, and by this avoiding priority inversion. A request for execution of a system task is made by calling the statically linked in NIF erts_internal:request_system_task(Pid, Prio, Request). This is an undocumented ERTS internal function that should remain so. It should *only* be called from BIF implementations. Currently defined system tasks are: * garbage_collect * check_process_code Further system tasks can and will be implemented in the future. The erlang:garbage_collect/[1,2] and erlang:check_process_code/[2,3] BIFs are now implemented using system tasks. Both the 'garbage_collect' and the 'check_process_code' operations perform or may perform garbage_collections. By doing these via the system task functionality all garbage collect operations in the system will be performed solely in the context of the process being garbage collected. This makes it possible to later implement functionality for disabling garbage collection of a process over context switches. Newly introduced BIFs: * erlang:garbage_collect/2 - The new second argument is an option list. Introduced option: * {async, RequestId} - making it possible for users to issue asynchronous garbage collect requests. * erlang:check_process_code/3 - The new third argument is an option list. Introduced options: * {async, RequestId} - making it possible for users to issue asynchronous check process code requests. * {allow_gc, boolean()} - making it possible to issue requests that aren't allowed to garbage collect (operation will abort if gc should be needed). These options have been introduced as a preparation for parallelization of check_process_code operations when the code_server is about to purge a module. --- erts/doc/src/erlang.xml | 161 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 143 insertions(+), 18 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 5ee40823bc..a9642be6fa 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -501,16 +501,87 @@ Check if a process is executing old code for a module -

Returns true if the process Pid is executing - old code for Module. That is, if the current call of - the process executes old code for this module, or if the - process has references to old code for this module, or if the - process contains funs that references old code for this - module. Otherwise, it returns false.

-
-> check_process_code(Pid, lists).
-false
+

The same as + erlang:check_process_code(Pid, + Module, []).

+ + + + + Check if a process is executing old code for a module + +

Check if the node local process identified by Pid + is executing old code for Module.

+

Currently available Options:

+ + {allow_gc, boolean()} + + Determines if garbage collection is allowed when performing + the operation. If {allow_gc, false} is passed, and + a garbage collection is needed in order to determine the + result of the operation, the operation will be aborted + (see information on CheckResult below). + The default is to allow garbage collection, i.e., + {allow_gc, true}. + + {async, RequestId} + + The check_process_code/3 function will return + the value async immediately after the request + has been sent. When the request has been processed, the + process that called this function will be passed a + message on the form:
+ {check_process_code, RequestId, CheckResult}. +
+
+

If Pid equals self(), and + no async option has been passed, the operation will + be performed at once. In all other cases a request for + the operation will be sent to the process identified by + Pid, and will be handled when + appropriate. If no async option has been passed, + the caller will block until CheckResult + is available and can be returned.

+

CheckResult informs about the result of + the request:

+ + true + + The process identified by Pid is + executing old code for Module. + That is, the current call of the process executes old + code for this module, or the process has references + to old code for this module, or the process contains + funs that references old code for this module. + + false + + The process identified by Pid is + not executing old code for Module. + + aborted + + The operation was aborted since the process needed to + be garbage collected in order to determine the result + of the operation, and the operation was requested + by passing the {allow_gc, false} option. +

See also code(3).

+

Failures:

+ + badarg + + If Pid is not a node local process identifier. + + badarg + + If Module is not an atom. + + badarg + + If OptionList is not a valid list of options. + +
@@ -1197,20 +1268,74 @@ true that the spontaneous garbage collection will occur too late or not at all. Improper use may seriously degrade system performance.

-

Compatibility note: In versions of OTP prior to R7, - the garbage collection took place at the next context switch, - not immediately. To force a context switch after a call to - erlang:garbage_collect(), it was sufficient to make - any function call.

- Force an immediate garbage collection of a process + Garbage collect a process + +

The same as + garbage_collect(Pid, []).

+
+
+ + + Garbage collect a process -

Works like erlang:garbage_collect() but on any - process. The same caveats apply. Returns false if - Pid refers to a dead process; true otherwise.

+

Garbage collect the node local process identified by + Pid.

+

Currently available Options:

+ + {async, RequestId} + + The garbage_collect/2 function will return + the value async immediately after the request + has been sent. When the request has been processed, the + process that called this function will be passed a + message on the form:
+ {garbage_collect, RequestId, GCResult}. +
+
+

If Pid equals self(), and + no async option has been passed, the garbage + collection will be performed at once, i.e. the same as + calling + garbage_collect/0. + In all other cases a request for garbage collection will + be sent to the process identified by Pid, + and will be handled when appropriate. If no async + option has been passed, the caller will block until + GCResult is available and can be + returned.

+

GCResult informs about the result of + the garbage collection request:

+ + true + + The process identified by Pid has + been garbage collected. + + false + + No garbage collection was performed. This since the + the process identified by Pid + terminated before the request could be satisfied. + + +

Note that the same caveats as for + garbage_collect/0 + apply.

+

Failures:

+ + badarg + + If Pid is not a node local process identifier. + + badarg + + If OptionList is not a valid list of options. + +
-- cgit v1.2.3 From dc9ff931423b57e64abde0f1de7133f334abb780 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 25 Nov 2013 15:34:03 +0100 Subject: Ensure exit signal due to link precede port BIF return --- erts/doc/src/erlang.xml | 162 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 133 insertions(+), 29 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index cbb25c2cf2..062caadad3 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -3032,7 +3032,10 @@ os_prompt% (see below), being synchronous, and that the port does not reply with {Port, closed}. Any process may close a port with port_close/1, not only the port owner - (the connected process).

+ (the connected process). If the calling process is linked to + port identified by Port, an exit signal due + to that link will be received by the process prior to the return + from port_close/1.

For comparison: Port ! {self(), close} fails with badarg if Port cannot be sent to (i.e., Port refers neither to a port nor to a process). If @@ -3041,6 +3044,7 @@ os_prompt% the port replies with {Port, closed} when all buffers have been flushed and the port really closes, but if the calling process is not the port owner the port owner fails with badsig.

+

Note that any process can close a port using Port ! {PortOwner, close} just as if it itself was the port owner, but the reply always goes to the port owner.

@@ -3050,8 +3054,17 @@ os_prompt% implementation has been synchronous. port_close/1 is however still fully synchronous. This due to its error behavior.

-

Failure: badarg if Port is not an open port or - the registered name of an open port.

+

Failure:

+ + badarg + + If Port is not an identifier of an open + port, or the registered name of an open port. If the calling + process was linked to the previously open port identified by + Port, an exit signal due to this link + was received by the process prior to this exception. + +
@@ -3086,8 +3099,11 @@ os_prompt% badarg - If Port is not an open port or the registered name - of an open port. + If Port is not an identifier of an open + port, or the registered name of an open port. If the calling + process was linked to the previously open port identified by + Port, an exit signal due to this link + was received by the process prior to this exception. badarg @@ -3130,8 +3146,11 @@ os_prompt% badarg - If Port is not an open port or the registered name - of an open port. + If Port is not an identifier of an open + port, or the registered name of an open port. If the calling + process was linked to the previously open port identified by + Port, an exit signal due to this link + was received by the process prior to this exception. badarg @@ -3198,9 +3217,20 @@ os_prompt% implementation has been synchronous. port_connect/2 is however still fully synchronous. This due to its error behavior.

-

Failure: badarg if Port is not an open port - or the registered name of an open port, or if Pid is - not an existing local pid.

+

Failures:

+ + badarg + + If Port is not an identifier of an open + port, or the registered name of an open port. If the calling + process was linked to the previously open port identified by + Port, an exit signal due to this link + was received by the process prior to this exception. + + badarg + If process identified by Pid is not an existing + local process. +
@@ -3236,12 +3266,33 @@ os_prompt% binary term format and sent to the port.

Returns: a term from the driver. The meaning of the returned data also depends on the port driver.

-

Failure: badarg if Port is not an open port or - the registered name of an open port, if Operation - cannot fit in a 32-bit integer, if the port driver does not - support synchronous control operations, or if the port driver - so decides for any reason (probably something wrong with - Operation or Data).

+

Failures:

+ + badarg + + If Port is not an identifier of an open + port, or the registered name of an open port. If the calling + process was linked to the previously open port identified by + Port, an exit signal due to this link + was received by the process prior to this exception. + + badarg + + If Operation does not fit in a + 32-bit integer. + + badarg + + If the port driver does not support synchronous control + operations. + + badarg + + If the port driver so decides for any reason (probably + something wrong with Operation, or + Data). + +
@@ -3251,7 +3302,12 @@ os_prompt%

Returns a list containing tuples with information about the Port, or undefined if the port is not open. The order of the tuples is not defined, nor are all the - tuples mandatory.

+ tuples mandatory. + If undefined is returned and the calling process + was linked to a previously open port identified by + Port, an exit signal due to this link + was received by the process prior to the return from + port_info/1.

Currently the result will containt information about the following Items: registered_name (if the port has a registered name), id, connected, links, @@ -3269,7 +3325,11 @@ os_prompt%

Pid is the process identifier of the process connected to the port.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3281,7 +3341,11 @@ os_prompt%

Index is the internal index of the port. This index may be used to separate ports.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3293,7 +3357,11 @@ os_prompt%

Bytes is the total number of bytes read from the port.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3305,7 +3373,11 @@ os_prompt%

Pids is a list of the process identifiers of the processes that the port is linked to.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3320,7 +3392,11 @@ os_prompt% that these results are highly implementation specific and might change in the future.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3334,7 +3410,11 @@ os_prompt% that the port itself might have allocated memory which is not included in Bytes.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3346,7 +3426,11 @@ os_prompt%

Monitors represent processes that this port is monitoring.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3358,7 +3442,11 @@ os_prompt%

Name is the command name set by open_port/2.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3373,7 +3461,11 @@ os_prompt% Command}, Options). If the port is not the result of spawning an OS process, the value is undefined.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3389,7 +3481,11 @@ os_prompt% or Port ! {Owner, {command, Data}.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3412,7 +3508,11 @@ os_prompt% in bytes, queued by the port using the ERTS driver queue implementation.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3424,7 +3524,11 @@ os_prompt%

RegisteredName is the registered name of the port. If the port has no registered name, [] is returned.

If the port identified by Port is not open, - undefined is returned.

+ undefined is returned. If undefined is returned and + the calling process was linked to a previously open port identified + by Port, an exit signal due to this link + was received by the process prior to the return from + port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

-- cgit v1.2.3 From 30e97f13e85efdc2d68282996cc6f907fc1cf9d6 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 2 Dec 2013 18:21:16 +0100 Subject: Documentation fix --- erts/doc/src/erlang.xml | 6 +++++- erts/doc/src/erts_alloc.xml | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index bc38055b62..287346340c 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5316,7 +5316,11 @@ ok As of erts version 5.6.1 the return value is a list of {instance, InstanceNo, InstanceInfo} tuples where InstanceInfo contains information about - a specific instance of the allocator. + a specific instance of the allocator. As of erts version + 5.10.4 the returned list when calling + erlang:system_info({allocator, mseg_alloc}) also + include an {erts_mmap, _} tuple as one element + in the list. If Alloc is not a recognized allocator, undefined is returned. If Alloc is disabled, false is returned.

diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index a0ec89f398..49ee740a73 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -332,8 +332,11 @@ Set super carrier size (in MB). The super carrier size defaults to zero; i.e, the super carrier is by default disabled. The super carrier is a large continuous area in the virtual address space. - The system will always try to create new carriers in the super - carrier. + mseg_alloc will always try to create new carriers in the super + carrier if it exists. Note that the alloc_util framework may + create sys_alloc carriers. For more information on this, see the + documentation of the +MMsco + flag.

NOTE: The super carrier cannot be enabled nor disabled on halfword heap systems. This flag will be -- cgit v1.2.3 From f265dc315485734adda7e7a8a88f6b4c02211477 Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Mon, 9 Dec 2013 09:31:38 -0800 Subject: Clean up some awkward wording around the +spp flag. This issue was pointed out by lpgauth in #erlounge. While the intention is clear, the original wording was a bit dodgy. I'm no grammarian--though I am a native speaker--so it's quite possible the new wording I've introduced is not impeachable. Should be idiomatic, though. Signed-off-by: Brian L. Troutwine --- erts/doc/src/erl.xml | 20 ++++++++++---------- erts/doc/src/erlang.xml | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index bf0d132955..34c9d8ea61 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1126,18 +1126,18 @@ +spp Bool

Set default scheduler hint for port parallelism. If set to - true, the VM will schedule port tasks when it by this can - improve the parallelism in the system. If set to false, - the VM will try to perform port tasks immediately and by this - improve latency at the expense of parallelism. If this - flag has not been passed, the default scheduler hint for port - parallelism is currently false. The default used can be - inspected in runtime by calling - erlang:system_info(port_parallelism). + true, the VM will schedule port tasks when doing so will + improve parallelism in the system. If set to false, the VM + will try to perform port tasks immediately, improving latency at the + expense of parallelism. If this flag has not been passed, the + default scheduler hint for port parallelism is currently + false. The default used can be inspected in runtime by + calling erlang:system_info(port_parallelism). The default can be overriden on port creation by passing the parallelism - option to - open_port/2

. + option to open_port/2

.
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index a498fc24df..13665f3e7c 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2886,11 +2886,11 @@ os_prompt% {parallelism, Boolean}

Set scheduler hint for port parallelism. If set to true, - the VM will schedule port tasks when it by this can improve the + the VM will schedule port tasks when doing so will improve parallelism in the system. If set to false, the VM will - try to perform port tasks immediately and by this improving the - latency at the expense of parallelism. The default can be set on - system startup by passing the + try to perform port tasks immediately, improving latency at the + expense of parallelism. The default can be set on system startup + by passing the +spp command line argument to erl(1).

-- cgit v1.2.3 From 25237481ccccd3ddfa74582dc267632ad618ba30 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 9 Dec 2013 20:12:33 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 259 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index b25e4ccbec..8c008c493e 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,265 @@

This document describes the changes made to the ERTS application.

+
Erts 5.10.4 + +
Fixed Bugs and Malfunctions + + +

+ When normalizing paths, erl_prim_loader would always + convert backslash to forward slash. This is correct on + Windows, but not on other operating systems. + erl_prim_loader now checks which OS is running before + performing this conversion.

+

+ Own Id: OTP-11170

+
+ +

+ Fixed syslog defines and defined LOG_ERR for systems + without syslog.h. Thanks to Matt Lewandowsky.

+

+ Own Id: OTP-11349

+
+ +

+ Check all pattern arguments passed to binary:matches/2. + Thanks to Mike Sassak.

+

+ Own Id: OTP-11350

+
+ +

+ Fix two small silent rules omissions. Thanks to Anthony + Ramine.

+

+ Own Id: OTP-11351

+
+ +

+ Teach configure to detect if posix_memalign cannot align + to more than the system page size.

+

+ For cross-compiled systems a new environment variable + called erl_xcomp_posix_memalign has been introduced to + indicate whether posix_memalign should be used.

+

+ Own Id: OTP-11371

+
+ +

+ Fix bsr bug occurring when shifting a huge number a huge + number of bits to the right. Thanks to Lars Hesel + Christensen.

+

+ Own Id: OTP-11381

+
+ +

+ Fix memory leak for distributed monitors

+

+ Own Id: OTP-11410

+
+ +

+ Fix various typos in erts, kernel and ssh. Thanks to + Martin Hässler.

+

+ Own Id: OTP-11414

+
+ +

+ Crashdumps initiated by out-of-memory on process spawn + could cause the beam to segfault during crashdump writing + due to invalid pointers.

+

+ The pointers are invalid since the process creation never + finished. This fix removes these processes from the + printouts. Reported by Richard Carlsson.

+

+ Own Id: OTP-11420

+
+ +

+ Crash dumps from 64-bit Erlang machines would have all + memory addresses truncated to 32 bits, which could cause + trouble inspecting processes message queues and stacks in + the crashdump viewer.

+

+ Own Id: OTP-11450

+
+ +

+ Threads other than schedulers threads could make thread + unsafe accesses when support for migration of memory + carriers had been enabled, i.e., when the +M<S>acul + command line flag had been passed to erl. This could cause + corruption of the VMs internal state.

+

+ This bug was introduced in erts-5.10.2 when the support + for migration of memory carriers was introduced.

+

+ Own Id: OTP-11456 Aux Id: OTP-10279

+
+ +

+ Fix bug in binary_to_term for invalid bitstrings + and very large binaries (>2Gb).

+

+ Own Id: OTP-11479

+
+ +

+ Under rare circumstances a process calling inet:close/1, + gen_tcp:close/1, + gen_udp:close/1, + or gen_sctp:close/1 + could hang in the call indefinitely.

+

+ Own Id: OTP-11491

+
+ +

+ Fix bug that could cause a 32-bit emulator to always + crash at start (since R16B01) depending on the alignment + of static data in the beam executable.

+

+ Own Id: OTP-11496

+
+ +

+ Fix benign bugs regarding bitstring compare. Only a + nuisance for debug and valgrind VM.

+

+ Own Id: OTP-11501

+
+ +

+ Silence warnings (Thanks to Anthony Ramine)

+

+ Own Id: OTP-11517

+
+ +

+ The default wordsize of the emulator (beam) is now + determined by compiler default on Mac OSX (Darwin). This + was previously forced to 32bits by the configure script + unless otherwise specified.

+

+ Own Id: OTP-11521

+
+
+
+ + +
Improvements and New Features + + +

+ A new memory allocation feature called "super carrier" + has been introduced. The super carrier feature can be + used in different ways. It can for example be used for + pre-allocation of all memory that the runtime system + should be able to use.

+

+ By default the super carrier is disabled. It is enabled + by passing the +MMscs <size in + MB> command line argument. For more + information see the documentation of the +MMsco, + +MMscrfsd, + +MMscrpm, + +MMscs, + +MMusac, + and, +Mlpm + command line arguments in the erts_alloc(3) + documentation.

+

+ Since it is disabled by default there should be no impact + on system characteristics if not used.

+

+ This change has been marked as a potential + incompatibility since the returned list when calling + erlang:system_info({allocator, + mseg_alloc}) now also include an + {erts_mmap, _} tuple as one element in the list.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11149

+
+ +

+ Added erlang:system_info(ets_limit) to provide a way to + retrieve the runtime's maximum number of ETS tables. + Thanks to Steve Vinoski

+

+ Own Id: OTP-11362

+
+ +

+ Add new BIF os:unsetenv/1 which deletes an environment + variable. Thanks to Martin Hässler.

+

+ Own Id: OTP-11446

+
+ +

Introduced a new guarantee regarding exit signals + from ports:

If the process calling one of the + synchronous port BIFs listed below is linked to the port + identified by the first argument, and the port exits + before sending the result of the port operation, the exit + signal issued due to this link will be received by the + processes before the BIF returns, or fail with an + exception due to the port not being open.

The + synchronous port BIFs are:

port_close/1 + port_command/2 + port_command/3 + port_connect/2 + port_control/3 + erlang:port_call/3 + erlang:port_info/1 + erlang:port_info/2 +

Note that some ports under certain + circumstances unlink themselves from the calling process + before exiting, i.e. even though the process linked + itself to the port there might be no link triggering an + exit signal.

Characteristics impact: The return + or exception from the synchronous port BIF will be + delayed if the port simultaneously exit due to some issue + unrelated to the outstanding synchronous port BIF call. + In all other cases characteristics are unchanged.

+

+ Own Id: OTP-11489

+
+
+
+ +
+
Erts 5.10.3.1
Improvements and New Features -- cgit v1.2.3 From a929df291877df45c93303d22995bbbebf6a2c45 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 12 Nov 2012 10:07:37 +0100 Subject: Document named fun expressions --- erts/doc/src/absform.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 55aef9f8ab..4acc03b133 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -290,6 +290,18 @@ If E is where each is a function clause then Rep(E) = . + If E is + where is a variable and each + is a function clause then Rep(E) = + . + + If E is , + where each is a generator or a filter, then + Rep(E) = . + For Rep(W), see below. + If E is , a Mnesia record access + inside a query, then + Rep(E) = . If E is , then Rep(E) = , i.e., parenthesized expressions cannot be distinguished from their bodies. -- cgit v1.2.3 From 18315c1675d965e5d0210a560e4742c483fcfd7f Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 3 Dec 2013 18:43:30 +0100 Subject: Officially support building assembler files erlc is wired to treat *.S files as assembler and build them as compile:file(File, [from_asm]), but this is not documented. There's also a documented compile:file/2 option called 'asm' (mapping to 'from_asm'), but the wording discourages its use. All of this has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * un-document 'asm' and document 'from_asm' instead * deprecate 'asm' While at it, fix a minor typo in the test suite. --- erts/doc/src/erlc.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml index 10cab344b0..2df026aef5 100644 --- a/erts/doc/src/erlc.xml +++ b/erts/doc/src/erlc.xml @@ -234,6 +234,11 @@ erlc +export_all file.erl from the shell.

Supported options: -I, -o, -D, -v, -W, -b.

+ .S + +

Erlang assembler source code. It generates a file.

+

Supported options: same as for .erl.

+
.yrl

Yecc source code. It generates an file.

-- cgit v1.2.3 From 455c8238535d2754234cd68bbf7caba9960607d6 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 3 Dec 2013 19:16:16 +0100 Subject: Officially support building core files erlc is wired to treat *.core files as core and build them as compile:file(File, [from_core]), but this is not documented. There's also an udocumented compile:file/2 option called 'from_core'. This has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * document 'from_core' --- erts/doc/src/erlc.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml index 2df026aef5..c3fc3b1686 100644 --- a/erts/doc/src/erlc.xml +++ b/erts/doc/src/erlc.xml @@ -239,6 +239,11 @@ erlc +export_all file.erl

Erlang assembler source code. It generates a file.

Supported options: same as for .erl.

+ .core + +

Erlang core source code. It generates a file.

+

Supported options: same as for .erl.

+
.yrl

Yecc source code. It generates an file.

-- cgit v1.2.3 From d61aff41862a017b948aeac58a8340ff41e69135 Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Sun, 15 Dec 2013 19:32:33 +0000 Subject: Add a chmod call in the CLI example add missing './' --- erts/doc/src/escript.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index 180447cac4..d2b09d4515 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -44,6 +44,7 @@

escript runs a script written in Erlang.

Here follows an example.

+$ chmod u+x factorial
 $ cat factorial
 #!/usr/bin/env escript
 %% -*- erlang -*-
@@ -66,12 +67,13 @@ usage() ->
 
 fac(0) -> 1;
 fac(N) -> N * fac(N-1).
-$ factorial 5
+$ ./factorial 5
 factorial 5 = 120
-$ factorial
+$ ./factorial
 usage: factorial integer
-$ factorial five
-usage: factorial integer        
+$ ./factorial five +usage: factorial integer +

The header of the Erlang script in the example differs from a normal Erlang module. The first line is intended to be the interpreter line, which invokes escript. However if you -- cgit v1.2.3 From 47979206defa9429458e419b691138ab1b519833 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 9 Jan 2014 12:50:28 +0100 Subject: Fix issues with new versioning --- erts/doc/src/erlang.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 711473afd2..124302a2cb 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6008,6 +6008,13 @@ ok erlang:system_info(multi_scheduling), and erlang:system_info(schedulers).

+ otp_correction_package + +

Returns a string containing the OTP correction package version + number that currenly executing VM is part of. Note that other + OTP applications in the system may be part of other OTP correction + packages.

+
otp_release

Returns a string containing the OTP release number.

-- cgit v1.2.3 From 8ff33cff02d01b2b4f20769cbd77c5ef23b01631 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Wed, 15 Jan 2014 10:13:11 -0500 Subject: remove deprecated driver_async_cancel function Some time ago the driver_async_cancel function was deprecated and slated for removal in R17. This commit removes the function along with its associated tests and documentation, sets the ERL_DRV_EXTENDED_MAJOR_VERSION to 3 and ERL_DRV_EXTENDED_MINOR_VERSION to 0, and modifies the sys_info_base_drv and sys_info_prev_drv tests in the driver test suite to check version 3.0 instead of 2.0. --- erts/doc/src/erl_driver.xml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index b453a4861e..c2f7fa4588 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -745,7 +745,7 @@ typedef struct ErlIOVec { created and decrement it once when the port associated with the lock terminates. The emulator will also increment the reference count when an async job is enqueued and decrement - it after an async job has been invoked, or canceled. Besides + it after an async job has been invoked. Besides this, it is the responsibility of the driver to ensure that the reference count does not reach zero before the last use of the lock by the driver has been made. The reference count @@ -1995,14 +1995,12 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len async_invoke and async_free. It's typically a pointer to a structure that contains a pipe or event that can be used to signal that the async operation completed. - The data should be freed in async_free, because it's - called if driver_async_cancel is called.

+ The data should be freed in async_free.

When the async operation is done, ready_async driver entry function is called. If ready_async is null in the driver entry, the async_free function is called instead.

-

The return value is a handle to the asynchronous task, which - can be used as argument to driver_async_cancel.

+

The return value is a handle to the asynchronous task.

As of erts version 5.5.4.3 the default stack size for threads in the async-thread pool is 16 kilowords, @@ -2039,26 +2037,6 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len - - intdriver_async_cancel(long id) - Cancel an asynchronous call - - -

This function used to cancel a scheduled asynchronous operation, - if it was still in the queue. It returned 1 if it succeeded, and - 0 if it failed.

-

Since it could not guarantee success, it was more or less useless. - The user had to implement synchronization of cancellation anyway. - It also unnecessarily complicated the implementation. Therefore, - as of OTP-R15B driver_async_cancel() is deprecated, and - scheduled for removal in OTP-R17. It will currently always fail, - and return 0.

-

driver_async_cancel() is deprecated and will - be removed in the OTP-R17 release.

-
- - - intdriver_lock_driver(ErlDrvPort port) Make sure the driver is never unloaded -- cgit v1.2.3 From 1101fcb3e61634f1be92e1b9ba9fad5a11b8554a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 16 Jan 2014 12:16:39 +0100 Subject: Add the 'rle' zstrategy --- erts/doc/src/zlib.xml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index afc597b729..11a7437f5a 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -161,20 +161,22 @@ list_to_binary([Compressed|Last]) state. MemLevel=1 uses minimum memory but is slow and reduces compression ratio; MemLevel=9 uses maximum memory for optimal speed. The default value is 8.

-

The Strategy parameter is used to tune the - compression algorithm. Use the value default for - normal data, filtered for data produced by a filter - (or predictor), or huffman_only to force Huffman - encoding only (no string match). Filtered data consists - mostly of small values with a somewhat random - distribution. In this case, the compression algorithm is - tuned to compress them better. The effect of - filteredis to force more Huffman coding and less - string matching; it is somewhat intermediate between - default and huffman_only. The Strategy - parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set - appropriately.

+

The Strategy parameter is used to tune + the compression algorithm. Use the value default for + normal data, filtered for data produced by a filter (or + predictor), huffman_only to force Huffman encoding + only (no string match), or rle to limit match + distances to one (run-length encoding). Filtered data + consists mostly of small values with a somewhat random + distribution. In this case, the compression algorithm is tuned + to compress them better. The effect of filteredis to + force more Huffman coding and less string matching; it is + somewhat intermediate between default and + huffman_only. rle is designed to be almost as + fast as huffman_only, but give better compression for PNG + image data. The Strategy parameter only + affects the compression ratio but not the correctness of the + compressed output even if it is not set appropriately.

-- cgit v1.2.3 From e7ea832a4a3a8ba2f94ce02a47ca34b60277cb0a Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 16 Jan 2014 23:41:47 +0100 Subject: Add support for scheduler utilization balancing For more information see documentation of the new command line argument +sub --- erts/doc/src/erl.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index bf0d132955..2aa247e293 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -941,6 +941,10 @@ when schedulers frequently run out of work. When disabled, the frequency with which schedulers run out of work will not be taken into account by the load balancing logic. +
  +scl false is similar to + +sub true with the difference + that +sub true also will balance scheduler utilization + between schedulers.

+sct CpuTopology @@ -1087,6 +1091,29 @@ documentation of the +sbt flag.

+ +sub true|false + +

Enable or disable + scheduler + utilization balancing of load. By default scheduler + utilization balancing is disabled and instead scheduler + compaction of load is enabled which will strive for a load + distribution which causes as many scheduler threads as possible + to be fully loaded (i.e., not run out of work). When scheduler + utilization balancing is enabled the system will instead try to + balance scheduler utilization between schedulers. That is, + strive for equal scheduler utilization on all schedulers. +
   +sub true is only supported on + systems where the runtime system detects and use a monotonically + increasing high resolution clock. On other systems, the runtime + system will fail to start. +
   +sub true implies + +scl false. The difference + between +sub true and +scl false is that + +scl false will not try to balance the scheduler + utilization. +

+
+sws very_eager|eager|medium|lazy|very_lazy

-- cgit v1.2.3 From 302954c0641ba679fb33a003c0a665b7b4a79a0e Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 27 Jan 2014 16:14:10 +0100 Subject: 17.0 anchor and broken links fixes --- erts/doc/src/notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 8c008c493e..b4ebef72f4 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -257,7 +257,7 @@ processes before the BIF returns, or fail with an exception due to the port not being open.

The synchronous port BIFs are:

port_close/1 + marker="erlang#port_close/1">port_close/1
port_command/2 Date: Thu, 9 Jan 2014 21:22:45 -0500 Subject: initial support for dirty schedulers and dirty NIFs Add initial support for dirty schedulers. There are two types of dirty schedulers: CPU schedulers and I/O schedulers. By default, there are as many dirty CPU schedulers as there are normal schedulers and as many dirty CPU schedulers online as normal schedulers online. There are 10 dirty I/O schedulers (similar to the choice of 10 as the default for async threads). By default, dirty schedulers are disabled and conditionally compiled out. To enable them, you must pass --enable-dirty-schedulers to the top-level configure script when building Erlang/OTP. Current dirty scheduler support requires the emulator to be built with SMP support. This restriction will be lifted in the future. You can specify the number of dirty schedulers with the command-line options +SDcpu (for dirty CPU schedulers) and +SDio (for dirty I/O schedulers). The +SDcpu option is similar to the +S option in that it takes two numbers separated by a colon: C1:C2, where C1 specifies the number of dirty schedulers available and C2 specifies the number of dirty schedulers online. The +SDPcpu option allows numbers of dirty CPU schedulers available and dirty CPU schedulers online to be specified as percentages, similar to the existing +SP option for normal schedulers. The number of dirty CPU schedulers created and dirty CPU schedulers online may not exceed the number of normal schedulers created and normal schedulers online, respectively. The +SDio option takes only a single number specifying the number of dirty I/O schedulers available and online. There is no support yet for programmatically changing at run time the number of dirty CPU schedulers online via erlang:system_flag/2. Also, changing the number of normal schedulers online via erlang:system_flag(schedulers_online, NewSchedulersOnline) should ensure that there are no more dirty CPU schedulers than normal schedulers, but this is not yet implemented. You can retrieve the number of dirty schedulers by passing dirty_cpu_schedulers, dirty_cpu_schedulers_online, or dirty_io_schedulers to erlang:system_info/1. Currently only NIFs are able to access dirty scheduler functionality. Neither drivers nor BIFs currently support dirty schedulers. This restriction will be addressed in the future. If dirty scheduler support is present in the runtime, the initial status line Erlang prints before presenting its interactive prompt will include the indicator "[ds:C1:C2:I]" where "ds" indicates "dirty schedulers", "C1" indicates the number of dirty CPU schedulers available, "C2" indicates the number of dirty CPU schedulers online, and "I" indicates the number of dirty I/O schedulers. Document The dirty NIF API in the erl_nif man page. The API closely follows Rickard Green's presentation slides from his talk "Future Extensions to the Native Interface", presented at the 2011 Erlang Factory held in the San Francisco Bay Area. Rickard's slides are available online at http://bit.ly/1m34UHB . Document the new erl command-line options, the additions to erlang:system_info/1, and also add the erlang:system_flag/2 dirty scheduler documentation even though it's not yet implemented. To determine whether the dirty NIF API is available, native code can check to see whether the C preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined. To check if dirty schedulers are available at run time, native code can call the boolean enif_have_dirty_schedulers() function, and Erlang code can call erlang:system_info(dirty_cpu_schedulers), which raises badarg if no dirty scheduler support is available. Add a simple dirty NIF test to the emulator NIF suite. --- erts/doc/src/erl.xml | 48 +++++++++++++++++++ erts/doc/src/erl_nif.xml | 122 ++++++++++++++++++++++++++++++++++++++++++++++- erts/doc/src/erlang.xml | 100 +++++++++++++++++++++++++++++++++++--- 3 files changed, 262 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index e737727941..27a23174d5 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -792,6 +792,54 @@ SMP support enabled (see the -smp flag).

+ + +

Sets the number of dirty CPU scheduler threads to create and dirty + CPU scheduler threads to set online when threading support has been + enabled. The maximum for both values is 1024, and each value is further + limited by the settings for normal schedulers: the number of dirty CPU + scheduler threads created cannot exceed the number of normal scheduler + threads created, and the number of dirty CPU scheduler threads online + cannot exceed the number of normal scheduler threads online (see the + +S and +SP + flags for more details). By default, the number of dirty CPU scheduler + threads created equals the number of normal scheduler threads created, + and the number of dirty CPU scheduler threads online equals the number + of normal scheduler threads online. DirtyCPUSchedulers may be + omitted if :DirtyCPUSchedulersOnline is not and vice versa. The + number of dirty CPU schedulers online can be changed at run time via + erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline). +

+

This option is ignored if the emulator doesn't have threading support + enabled. Currently, this option is experimental and is supported only + if the emulator was configured and built with support for dirty schedulers + enabled (it's disabled by default). +

+
+ + +

Similar to +SDcpu but uses percentages to set the + number of dirty CPU scheduler threads to create and number of dirty CPU scheduler threads + to set online when threading support has been enabled. Specified values must be greater + than 0. For example, +SDPcpu 50:25 sets the number of dirty CPU scheduler threads + to 50% of the logical processors configured and the number of dirty CPU scheduler threads + online to 25% of the logical processors available. DirtyCPUSchedulersPercentage may + be omitted if :DirtyCPUSchedulersOnlinePercentage is not and vice versa. The + number of dirty CPU schedulers online can be changed at run time via + erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline). +

+

This option interacts with +SDcpu settings. + For example, on a system with 8 logical cores configured and 8 logical cores available, + the combination of the options +SDcpu 4:4 +SDPcpu 50:25 (in either order) results + in 2 dirty CPU scheduler threads (50% of 4) and 1 dirty CPU scheduler thread online (25% of 4). +

+

This option is ignored if the emulator doesn't have threading support + enabled. Currently, this option is experimental and is supported only + if the emulator was configured and built with support for dirty schedulers + enabled (it's disabled by default). +

+
+

Scheduling specific flags.

diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 7ac8181d47..8b19725c02 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -181,7 +181,11 @@ ok to dispatch the work to another thread, return from the native function, and wait for the result. The thread can send the result back to the calling thread using message passing. Information - about thread primitives can be found below.

+ about thread primitives can be found below. If you have built your system + with the currently experimental support for dirty schedulers, + you may want to try out this functionality by dispatching the work to a + dirty NIF, + which does not have the same duration restriction as a normal NIF.

FUNCTIONALITY @@ -312,6 +316,38 @@ ok

The library initialization callbacks load, reload and upgrade are all thread-safe even for shared state data.

+ Dirty NIFs +

Note that the dirty NIF functionality + is experimental and that you have to enable support for dirty + schedulers when building OTP in order to try the functionality out. Native functions + + must normally run quickly, as explained earlier in this document. They + generally should execute for no more than a millisecond. But not all native functions + can execute so quickly; for example, functions that encrypt large blocks of data or + perform lengthy file system operations can often run for tens of seconds or more.

+

A NIF that cannot execute in a millisecond or less is called a "dirty NIF" since + it performs work that the Erlang runtime cannot handle cleanly. Applications + that make use of such functions must indicate to the runtime that the functions are + dirty so they can be handled specially. To schedule a dirty NIF for execution, the + application calls enif_schedule_dirty_nif, + passing to it a pointer to the dirty NIF to be executed and indicating with a flag + argument whether it expects the operation to be CPU-bound or I/O-bound.

+

All dirty NIFs must ultimately invoke the + enif_schedule_dirty_nif_finalizer as their final action, passing to it the + result they wish to return to the original caller. A finalizer function can either + receive the result and return it directly, or it can return a different value instead. + For convenience, the NIF API provides the + enif_dirty_nif_finalizer function that applications can use as a finalizer; + it simply returns its result argument.

+

Dirty NIF support is available only when the emulator is configured with dirty + schedulers enabled. This feature is currently disabled by default. To determine whether + the dirty NIF API is available, native code can check to see if the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined. Also, if the Erlang runtime was built + without threading support, dirty schedulers are disabled. To check at runtime for the presence + of dirty scheduler threads, code can call the + enif_have_dirty_schedulers() API function, which returns true if dirty + scheduler threads are present, false otherwise.

+
@@ -610,6 +646,18 @@ typedef enum { See also the warning text at the beginning of this document.

+ ERL_NIF_TERMenif_dirty_nif_finalizer(ErlNifEnv* env, ERL_NIF_TERM result) + Simple dirty NIF result finalizer + +

A convenience function that a dirty NIF can use as a finalizer that simply + return its result argument as its return value. This function is provided + for dirty NIFs with results that should be returned directly to the original caller.

+

This function is available only when the emulator is configured with dirty + schedulers enabled. This feature is currently disabled by default. To determine whether + the dirty NIF API is available, native code can check to see if the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

+
+
intenif_equal_tids(ErlNifTid tid1, ErlNifTid tid2)

Same as erl_drv_equal_tids. @@ -730,6 +778,22 @@ typedef enum { and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

+ intenif_have_dirty_schedulers() + Runtime check for the presence of dirty scheduler threads + +

Check at runtime for the presence of dirty scheduler threads. If the emulator is + built with threading support, dirty scheduler threads are available and + enif_have_dirty_schedulers() returns true. If the emulator was built without + threading support, enif_have_dirty_schedulers() returns false.

+

If dirty scheduler threads are not available in the emulator, calls to + enif_schedule_dirty_nif and enif_schedule_dirty_nif_finalizer result in + the NIF and finalizer functions being called directly within the calling thread.

+

This function is available only when the emulator is configured with dirty + schedulers enabled. This feature is currently disabled by default. To determine whether + the dirty NIF API is available, native code can check to see if the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

+
+
intenif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin) Inspect the content of a binary

Initialize the structure pointed to by bin with @@ -777,6 +841,20 @@ typedef enum { Erlang operators =:= and =/=.

+ intenif_is_on_dirty_scheduler(ErlNifEnv* env) + Check to see if executing on a dirty scheduler thread + +

Check to see if the current NIF is executing on a dirty scheduler thread. If the + emulator is built with threading support, calling enif_is_on_dirty_scheduler + from within a dirty NIF returns true. It returns false when the calling NIF is a regular + NIF or a NIF finalizer, both of which run on normal scheduler threads, or when the emulator + is built without threading support.

+

This function is available only when the emulator is configured with dirty + schedulers enabled. This feature is currently disabled by default. To determine whether + the dirty NIF API is available, native code can check to see if the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

+
+
intenif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is a pid

Return true if term is a pid.

@@ -1141,6 +1219,48 @@ typedef enum {

Same as erl_drv_rwlock_tryrwlock.

+ ERL_NIF_TERMenif_schedule_dirty_nif(ErlNifEnv* env, int flags, ERL_NIF_TERM (*fp)(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]), int argc, const ERL_NIF_TERM argv[]) + Schedule a dirty NIF for execution + +

Schedule dirty NIF fp to execute a long-running operation. The flags + argument must be set to either ERL_NIF_DIRTY_JOB_CPU_BOUND if the job is expected to + be primarily CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will be + I/O-bound. The argc and argv arguments can either be the originals passed + into the calling NIF, or they can be values created by the calling NIF. The calling + NIF must use the return value of enif_schedule_dirty_nif as its own return value.

+

Be aware that enif_schedule_dirty_nif, as its name implies, only schedules the + dirty NIF for future execution. The calling NIF does not block waiting for the dirty NIF to + execute and return, which means that the calling NIF can't expect to receive the dirty NIF + return value and use it for further operations.

+

A dirty NIF may not invoke the enif_make_badarg + to raise an exception. If it wishes to return an exception, the dirty NIF should pass a + regular result indicating the exception details to its finalizer, and allow the finalizer + to raise the exception on its behalf.

+

This function is available only when the emulator is configured with dirty schedulers + enabled. This feature is currently disabled by default. To determine whether the dirty NIF API + is available, native code can check to see if the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

+
+
+ ERL_NIF_TERMenif_schedule_dirty_nif_finalizer(ErlNifEnv* env, ERL_NIF_TERM result, ERL_NIF_TERM (*fp)(ErlNifEnv* env, ERL_NIF_TERM result)) + Schedule a dirty NIF finalizer + +

When a dirty NIF finishes executing, it must schedule a finalizer function to return + its result to the original NIF caller. The dirty NIF passes result as the value it + wants the finalizer to use as the return value. The fp argument is a pointer to the + finalizer function. The NIF API provides the + enif_dirty_nif_finalizer function that can be used as a finalizer that simply + returns its result argument. You are also free to write your own custom finalizer + that uses result to derive a different return value, or ignores result + entirely and returns a completely different value.

+

Without exception, all dirty NIFs must invoke enif_schedule_dirty_nif_finalizer + to complete their execution.

+

This function is available only when the emulator is configured with dirty + schedulers enabled. This feature is currently disabled by default. To determine whether + the dirty NIF API is available, native code can check to see if the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

+
+
ErlNifPid *enif_self(ErlNifEnv* caller_env, ErlNifPid* pid) Get the pid of the calling process.

Initialize the pid variable *pid to represent the diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index ea753cfaaf..4cf5631727 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5194,6 +5194,27 @@ ok + Set system flag dirty CPU schedulers online + +

+ Sets the amount of dirty CPU schedulers online. Valid range is + where N is the + lesser of the return values of erlang:system_info(dirty_cpu_schedulers) and + erlang:system_info(schedulers_online). +

+

Returns the old value of the flag.

+

Note that the dirty schedulers functionality is experimental, and + that you have to enable support for dirty schedulers when building OTP in + order to try the functionality out.

+

For more information see + erlang:system_info(dirty_cpu_schedulers) + and + erlang:system_info(dirty_cpu_schedulers_online). +

+
+
+ + Set system flag fullsweep_after

Number is a non-negative integer which indicates @@ -5211,7 +5232,7 @@ ok - + Set system flag min_heap_size

Sets the default minimum heap size for processes. The @@ -5226,7 +5247,7 @@ ok - + Set system flag min_bin_vheap_size

Sets the default minimum binary virtual heap size for processes. The @@ -5241,7 +5262,7 @@ ok - + Set system flag multi_scheduling

@@ -5279,7 +5300,7 @@ ok - + Set system flag scheduler_bind_type @@ -5399,7 +5420,7 @@ ok - + Set system flag scheduler_wall_time

Turns on/off scheduler wall time measurements.

@@ -5409,7 +5430,7 @@ ok
- + Set system flag schedulers_online

@@ -5425,7 +5446,7 @@ ok - + Set system flag trace_control_word

Sets the value of the node's trace control word to @@ -5785,6 +5806,71 @@ ok compiled; otherwise, false.

+ dirty_cpu_schedulers + +

Returns the number of dirty CPU scheduler threads used by + the emulator. Dirty CPU schedulers execute CPU-bound + native functions such as NIFs, linked-in driver code, and BIFs + that cannot be managed cleanly by the emulator's normal schedulers. +

+

The number of dirty CPU scheduler threads is determined at emulator + boot time and cannot be changed after that. The number of dirty CPU + scheduler threads online can however be changed at any time. The number of + dirty CPU schedulers can be set on startup by passing + the +SDcpu command line flag, see + erl(1). +

+

Note that the dirty schedulers functionality is experimental, and + that you have to enable support for dirty schedulers when building OTP in + order to try the functionality out.

+

See also erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline), + erlang:system_info(dirty_cpu_schedulers_online), + erlang:system_info(dirty_io_schedulers), + erlang:system_info(schedulers), + erlang:system_info(schedulers_online), and + erlang:system_flag(schedulers_online, SchedulersOnline).

+
+ dirty_cpu_schedulers_online + +

Returns the number of dirty CPU schedulers online. The return value + satisfies the following relationship: + , where N is + the lesser of the return values of erlang:system_info(dirty_cpu_schedulers) and + erlang:system_info(schedulers_online). +

+

The number of dirty CPU schedulers online can be set on startup by passing + the +SDcpu command line flag, see + erl(1). +

+

Note that the dirty schedulers functionality is experimental, and + that you have to enable support for dirty schedulers when building OTP in + order to try the functionality out.

+

For more information, see + erlang:system_info(dirty_cpu_schedulers), + erlang:system_info(dirty_io_schedulers), + erlang:system_info(schedulers_online), and + erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline). +

+
+ dirty_io_schedulers + +

Returns the number of dirty I/O schedulers as an integer. Dirty I/O schedulers + execute I/O-bound native functions such as NIFs and linked-in driver code that + cannot be managed cleanly by the emulator's normal schedulers. +

+

This value can be set on startup by passing + the +SDio command line flag, see + erl(1). +

+

Note that the dirty schedulers functionality is experimental, and + that you have to enable support for dirty schedulers when building OTP in + order to try the functionality out.

+

For more information, see + erlang:system_info(dirty_cpu_schedulers), + erlang:system_info(dirty_cpu_schedulers_online), and + erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline). +

+
dist

Returns a binary containing a string of distribution -- cgit v1.2.3 From 0cc9753f7f873bbcf8a528e05ab0adbd5c8fc79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 27 Jan 2014 13:10:54 +0100 Subject: Change the default file name encoding mode to +fnaw --- erts/doc/src/erl.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index e737727941..6428a24209 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -535,12 +535,15 @@ -

The VM works with file names as if they are encoded using the ISO-latin-1 encoding, disallowing Unicode characters with codepoints beyond 255. This is default on operating systems that have transparent file naming, i.e. all Unixes except MacOSX.

+

The VM works with file names as if they are encoded using the ISO-latin-1 encoding, disallowing Unicode characters with codepoints beyond 255.

See STDLIB User's Guide for more infomation about unicode file names.

-

The VM works with file names as if they are encoded using UTF-8 (or some other system specific Unicode encoding). This is the default on operating systems that enforce Unicode encoding, i.e. Windows and MacOSX.

+

The VM works with file names as if they are encoded using + UTF-8 (or some other system specific Unicode encoding). This + is the default on operating systems that enforce Unicode + encoding, i.e. Windows and MacOS X.

The +fnu switch can be followed by w, i, or e to control the way wrongly encoded file names are to be reported. w means that a warning is @@ -556,7 +559,12 @@ -

Selection between +fnl and +fnu is done based on the current locale settings in the OS, meaning that if you have set your terminal for UTF-8 encoding, the filesystem is expected to use the same encoding for file names (use with care).

+

Selection between +fnl and +fnu is done based + on the current locale settings in the OS, meaning that if you + have set your terminal for UTF-8 encoding, the filesystem is + expected to use the same encoding for file names. This is + default on all operating systems except MacOS X and + Windows.

The +fna switch can be followed by w, i, or e. This will have effect if the locale settings cause the behavior of +fnu to be selected. -- cgit v1.2.3 From bc34b5dafaebf07d7185900310246f5752c0a6c4 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 21 Jan 2014 12:21:11 +0100 Subject: erts: Add map construction to driver API erl_drv_output_term() and erl_drv_send_term() can send messages containing maps with the use of the new ERL_DRV_MAP. The driver API minor version is updated as new functionality is added. --- erts/doc/src/erl_driver.xml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index c2f7fa4588..710c9b19cf 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -4,7 +4,7 @@

- 20012013 + 20012014 Ericsson AB. All Rights Reserved. @@ -1742,15 +1742,19 @@ typedef struct ErlIOVec { term consists of one to four elements in the array. The term first has a term type, and then arguments. The port parameter specifies the sending port.

-

Tuple and lists (with the exception of strings, see below), +

Tuples, maps and lists (with the exception of strings, see below), are built in reverse polish notation, so that to build a tuple, the elements are given first, and then the tuple - term, with a count. Likewise for lists.

+ term, with a count. Likewise for lists and maps.

A tuple must be specified with the number of elements. (The elements precede the ERL_DRV_TUPLE term.)

A list must be specified with the number of elements, including the tail, which is the last term preceding ERL_DRV_LIST.

+

A map must be specified with the number of key-value pairs N. + The key-value pairs must precede the ERL_DRV_MAP in this order: + key1,value1,key2,value2,...,keyN,valueN. + Duplicate keys are not allowed.

The special term ERL_DRV_STRING_CONS is used to "splice" in a string in a list, a string given this way is not a list per se, but the elements are elements of the @@ -1774,6 +1778,7 @@ ERL_DRV_PID ErlDrvTermData pid (from driver_connected(ErlDrvPort port) ERL_DRV_STRING_CONS char *str, int len ERL_DRV_FLOAT double *dbl ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len +ERL_DRV_MAP int sz

The unsigned integer data type ErlDrvUInt and the signed integer data type ErlDrvSInt are 64 bits wide @@ -1856,6 +1861,24 @@ ERL_DRV_EXT2TERM char *buf, ErlDrvUInt len }; erl_drv_output_term(driver_mk_port(drvport), spec, sizeof(spec) / sizeof(spec[0])); ]]> + +

To build the map #{key1 => 100, key2 => {200, 300}}, the + following call could be made.

+ + +

If you want to pass a binary and don't already have the content of the binary in an ErlDrvBinary, you can benefit from using ERL_DRV_BUF2BINARY instead of creating an ErlDrvBinary -- cgit v1.2.3 From e5ccb57c0e45535d4b2b34cc85b177056b67b2da Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 31 Jan 2014 20:09:44 +0100 Subject: Document maps-related abstract syntax trees {map,Loc,Fields} {map,Loc,Argument,Fields} {map_field_assoc,Loc,Name,Value} {map_field_exact,Loc,Name,Value} --- erts/doc/src/absform.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 4acc03b133..835a4fc692 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -217,6 +217,14 @@ Rep(E) = . If E is , then Rep(E) = . + If E is where each + is a map assoc or exact field, then Rep(E) = + . For Rep(W), see + below. + If E is where + is a map assoc or exact field, then Rep(E) = + . For + Rep(W), see below. If E is , then Rep(E) = . If E is , then @@ -334,6 +342,21 @@ is an integer, Rep(TS) = .

+ +
+ Map assoc and exact fields +

When W is an assoc or exact field (in the body of a map), then:

+ + If W is an assoc field V]]>, where + and are both expressions, + then Rep(W) = . + + If W is an exact field , where + and are both expressions, + then Rep(W) = . + + +
-- cgit v1.2.3 From 3fd4e3e770fbed95fd6fa2d547945ac71256339c Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Sun, 16 Feb 2014 00:54:08 +0100 Subject: Misc adjustments of OTP version --- erts/doc/src/Makefile | 2 +- erts/doc/src/erlang.xml | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index d4c6fe67d2..e8b856c3ff 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -139,7 +139,7 @@ man: $(MAN1_FILES) $(MAN3_FILES) gifs: $(GIF_FILES:%=$(HTMLDIR)/%) -$(INFO_FILE): $(INFO_FILE_SRC) ../../vsn.mk +$(INFO_FILE): $(INFO_FILE_SRC) $(ERL_TOP)/make/$(TARGET)/otp.mk sed -e 's;%RELEASE%;$(SYSTEM_VSN);' $(INFO_FILE_SRC) > $(INFO_FILE) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 4cf5631727..0f312fb430 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6094,16 +6094,19 @@ ok erlang:system_info(multi_scheduling), and erlang:system_info(schedulers).

- otp_correction_package - -

Returns a string containing the OTP correction package version - number that currenly executing VM is part of. Note that other - OTP applications in the system may be part of other OTP correction - packages.

-
otp_release -

Returns a string containing the OTP release number.

+

Returns a string containing the OTP release number of the + OTP release that the currently executing ERTS application is + part of.

+

As of OTP release 17, the OTP release number corresponds to + the major OTP version number. There is no + erlang:system_info() argument giving the exact OTP + version. This since the exact OTP version in the general case + is hard to determine. For more information see + the + documentation of the OTP version in the installation + guide.

port_parallelism

Returns the default port parallelism scheduling hint used. -- cgit v1.2.3 From a3af5f4a5c4568225ef91ee4493da6bf659f7161 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 2 Sep 2013 17:27:58 +0200 Subject: erts: Set default external enc to use new float scheme This change was triggered by the OSE float printing function not working exactly the same way as linux/win32. But it is also a good one in general as it cuts size in more than half for floats. --- erts/doc/src/erlang.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 0f312fb430..accd7f0b08 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6572,11 +6572,12 @@ ok some details of the encoding. This option was introduced in R11B-4. Currently, the allowed values for Version are 0 and 1.

-

{minor_version, 1} forces any floats in the term to be encoded +

{minor_version, 1} is since 17.0 the default, it forces any floats in + the term to be encoded in a more space-efficient and exact way (namely in the 64-bit IEEE format, rather than converted to a textual representation). binary_to_term/1 - in R11B-4 and later is able decode the new representation.

-

{minor_version, 0} is currently the default, meaning that floats + in R11B-4 and later is able decode this representation.

+

{minor_version, 0} meaning that floats will be encoded using a textual representation; this option is useful if you want to ensure that releases prior to R11B-4 can decode resulting binary.

-- cgit v1.2.3 From 3e8b423a2cb11f819f3cede7ef817f4012f18944 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Sun, 26 Jan 2014 20:34:12 -0500 Subject: further enhancements for dirty schedulers Add support for setting the number of dirty CPU schedulers online via erlang:system_flag/2. Assuming the emulator is built with dirty schedulers enabled, the number of dirty CPU schedulers online may not be less than 1, nor greater than the number of dirty CPU schedulers available, nor greater than the number of normal schedulers online. Dirty CPU scheduler threads that are taken offline via system_flag/2 are suspended. The number of dirty CPU schedulers online may be adjusted independently of the number of normal schedulers online, but if system_flag/2 is used to set the number of normal schedulers online to a value less than the current number of normal schedulers online, the number of dirty CPU schedulers online is decreased proportionally. Likewise, if the number of normal schedulers online is increased, the number of dirty CPU schedulers online is increased proportionally. For example, if 8 normal schedulers and 4 dirty CPU schedulers are online, and system_flag/2 is called to set the number of normal schedulers online to 4, the number of dirty CPU schedulers online is also decreased by half, to 2. Subsequently setting the number of normal schedulers online back to 8 also sets the number of dirty CPU schedulers online back to 4. Augment the system_flag/2 documentation in the erlang man page to explain this relationship between schedulers_online and dirty_cpu_schedulers_online. Also ensure that all dirty CPU and I/O schedulers are suspended when multi-scheduling is blocked via system_flag/2, and brought back online when multi-scheduling is unblocked. Add Rickard Green's rewritten check_enqueue_in_prio_queue() function that inspects process state more thoroughly to determine if to enqueue it and if so on what queue, including dirty queues when appropriate. Make sure dirty NIF jobs do not trigger erlang:system_monitor long_schedule messages. Add more dirty scheduler testing to the scheduler test suite. Remove the erts_no_dirty_cpu_schedulers_online global variable, since it's no longer needed. Execute dirty NIFs on a normal scheduler thread while multi-scheduling blocking is in effect. Evacuate any dirty jobs residing in the dirty run queues over to a normal run queue when multi-scheduling is blocked. Allow dirty schedulers to execute aux work. Set the dirty run queues halt_in_progress flag when halting the normal schedulers. Change dirty scheduler numbers to a structure including both scheduler number and type, either dirty CPU or dirty I/O. Add some assertions to ensure that dirty CPU schedulers operate only on dirty CPU scheduler process flags, and the same for dirty I/O schedulers. --- erts/doc/src/erlang.xml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 4cf5631727..3004acf124 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5203,9 +5203,16 @@ ok erlang:system_info(schedulers_online).

Returns the old value of the flag.

-

Note that the dirty schedulers functionality is experimental, and - that you have to enable support for dirty schedulers when building OTP in - order to try the functionality out.

+

Note that the number of dirty CPU schedulers online may change if the number of + schedulers online changes. For example, if there are 12 schedulers and all are + online, and 6 dirty CPU schedulers, all online as well, and system_flag/2 + is used to set the number of schedulers online to 6, then the number of dirty + CPU schedulers online is automatically decreased by half as well, down to 3. + Similarly, the number of dirty CPU schedulers online increases proportionally + to increases in the number of schedulers online.

+

Note that the dirty schedulers functionality is experimental, and + that you have to enable support for dirty schedulers when building OTP in order + to try out the functionality.

For more information see erlang:system_info(dirty_cpu_schedulers) and @@ -5438,6 +5445,15 @@ ok .

Returns the old value of the flag.

+

Note that if the emulator was built with support for dirty schedulers, + changing the number of schedulers online can also change the number of dirty + CPU schedulers online. For example, if there are 12 schedulers and all are + online, and 6 dirty CPU schedulers, all online as well, and system_flag/2 + is used to set the number of schedulers online to 6, then the number of dirty + CPU schedulers online is automatically decreased by half as well, down to 3. + Similarly, the number of dirty CPU schedulers online increases proportionally + to increases in the number of schedulers online.

For more information see, erlang:system_info(schedulers), and @@ -5817,12 +5833,13 @@ ok boot time and cannot be changed after that. The number of dirty CPU scheduler threads online can however be changed at any time. The number of dirty CPU schedulers can be set on startup by passing - the +SDcpu command line flag, see - erl(1). + the +SDcpu or + +SDPcpu command line flags, + see erl(1).

Note that the dirty schedulers functionality is experimental, and that you have to enable support for dirty schedulers when building OTP in - order to try the functionality out.

+ order to try out the functionality.

See also erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline), erlang:system_info(dirty_cpu_schedulers_online), erlang:system_info(dirty_io_schedulers), @@ -5844,7 +5861,7 @@ ok

Note that the dirty schedulers functionality is experimental, and that you have to enable support for dirty schedulers when building OTP in - order to try the functionality out.

+ order to try out the functionality.

For more information, see erlang:system_info(dirty_cpu_schedulers), erlang:system_info(dirty_io_schedulers), @@ -5864,7 +5881,7 @@ ok

Note that the dirty schedulers functionality is experimental, and that you have to enable support for dirty schedulers when building OTP in - order to try the functionality out.

+ order to try out the functionality.

For more information, see erlang:system_info(dirty_cpu_schedulers), erlang:system_info(dirty_cpu_schedulers_online), and -- cgit v1.2.3 From cd69c2a54201b4e0c4ba86d4248937120e1957e7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 8 Jan 2014 18:54:15 +0100 Subject: ose: Create OSE application Create an specific OSE application that mainly contains documentation around the OSE specific part of Erlang/OTP. --- erts/doc/src/driver_entry.xml | 8 ++++++-- erts/doc/src/erl_driver.xml | 6 ++++-- erts/doc/src/run_erl.xml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index 48dfcb09b1..469b59dba6 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -245,10 +245,14 @@ typedef struct erl_drv_entry { something that the WaitForMultipleObjects API function understands). (Some trickery in the emulator allows more than the built-in limit of 64 Events to be used.)

+

On Enea OSE the event is one or more signals that can + be retrieved using erl_drv_ose_get_input_signal.

To use this with threads and asynchronous routines, create a - pipe on unix and an Event on Windows. When the routine + pipe on unix, an Event on Windows or a unique signal number on + Enea OSE. When the routine completes, write to the pipe (use SetEvent on - Windows), this will make the emulator call + Windows or send a message to the emulator process on Enea OSE), + this will make the emulator call ready_input or ready_output.

Spurious events may happen. That is, calls to ready_input or ready_output even though no real events are signaled. In diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 710c9b19cf..8da1836da7 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -1035,7 +1035,9 @@ typedef struct ErlIOVec { select/poll can use). On windows, the Win32 API function WaitForMultipleObjects is used. This places other restrictions on the event object. - Refer to the Win32 SDK documentation.

+ Refer to the Win32 SDK documentation. + On Enea OSE, the receive function is used. See the for more details.

The on parameter should be 1 for setting events and 0 for clearing them.

The mode argument is a bitwise-or combination of @@ -1047,7 +1049,7 @@ typedef struct ErlIOVec { ready_output.

-

Some OS (Windows) do not differentiate between read and write events. +

Some OS (Windows and Enea OSE) do not differentiate between read and write events. The call-back for a fired event then only depends on the value of mode.

ERL_DRV_USE specifies if we are using the event object or if we want to close it. diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml index 684f7b1ddd..28e94c6da8 100644 --- a/erts/doc/src/run_erl.xml +++ b/erts/doc/src/run_erl.xml @@ -58,7 +58,7 @@ first argument to run_erl on the command line. pipe_dir This is where to put the named pipe, usually - . It shall be suffixed by a (slash), + on Unix or on OSE. It shall be suffixed by a (slash), i.e. not , but . log_dir This is where the log files are written. There will be one -- cgit v1.2.3 From ff77d5049cca221e82d1b28e862512069c399eb7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 14 Feb 2014 15:29:43 +0100 Subject: ose: Fix broken doc links --- erts/doc/src/driver_entry.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index 469b59dba6..b34ca136f3 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -246,7 +246,7 @@ typedef struct erl_drv_entry { function understands). (Some trickery in the emulator allows more than the built-in limit of 64 Events to be used.)

On Enea OSE the event is one or more signals that can - be retrieved using erl_drv_ose_get_input_signal.

+ be retrieved using erl_drv_ose_get_signal.

To use this with threads and asynchronous routines, create a pipe on unix, an Event on Windows or a unique signal number on Enea OSE. When the routine -- cgit v1.2.3 From 345af4a0c8d68b9369c3556fa6d911854c123d3f Mon Sep 17 00:00:00 2001 From: Rick Reed Date: Wed, 13 Feb 2013 08:48:18 -0800 Subject: Add run queue index to process dump info --- erts/doc/src/crash_dump.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index c59741f250..885b7c3bb4 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -246,6 +246,9 @@ Last scheduled in for | Current call The current function of the process. These fields will not always exist. + Run queue + The identifier of the scheduler run queue in which the process is + running. Spawned by The parent of the process, i.e. the process which executed or . -- cgit v1.2.3 From 5d5f9c1857029d7e8e1de141e29d20dd3de929be Mon Sep 17 00:00:00 2001 From: Rick Reed Date: Wed, 13 Feb 2013 08:49:20 -0800 Subject: Add thread index to allocator enomem dump slogan --- erts/doc/src/crash_dump.xml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index 885b7c3bb4..d3de29b876 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -85,20 +85,22 @@ operating system.

"<A>: Cannot allocate <N> - bytes of memory (of type "<T>")." - The system - has run out of memory. <A> is the allocator that failed - to allocate memory, <N> is the number of bytes that - <A> tried to allocate, and <T> is the memory block - type that the memory was needed for. The most common case is - that a process stores huge amounts of data. In this case - <T> is most often , , - , or . For more information on - allocators see - erts_alloc(3). + bytes of memory (of type "<T>", thread + <I>em>)." - The system has run out of memory. <A> + is the allocator that failed to allocate memory, <N> is the + number of bytes that <A> tried to allocate, <T> is the + memory block type that the memory was needed for, and <I> is the + thread identifier. The most common case is that a process stores huge + amounts of data. In this case <T> is most often + , , + , or . + For more information on allocators see + erts_alloc(3).
"<A>: Cannot reallocate <N> - bytes of memory (of type "<T>")." - Same as - above with the exception that memory was being reallocated - instead of being allocated when the system ran out of memory. + bytes of memory (of type "<T>", thread + <I>em>)." - Same as above with the exception that memory + was being reallocated instead of being allocated when the system ran + out of memory. "Unexpected op code N" - Error in compiled code, file damaged or error in the compiler. "Module Name undefined" "Function -- cgit v1.2.3 From 8fbe76d64e7d55eb41943484602b928658313a65 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 11 Mar 2014 12:23:06 +0100 Subject: erts: Document external format for maps (MAP_EXT) --- erts/doc/src/erl_ext_dist.xml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index f91ed78122..9a53f3f829 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -5,7 +5,7 @@
2007 - 2013 + 2014 Ericsson AB, All Rights Reserved @@ -572,6 +572,36 @@

+
+ + MAP_EXT + + + + 1 + 4 + N + M + + + 116 + Arity + Keys + Values + +
+

+ MAP_EXT encodes a map. The Arity field is an unsigned + 4 byte integer in big endian format that determines the number of + key-value pairs in the map. All key terms follow in the Keys + section and then all value terms in the Values section. Keys + and values are paired according to order; first key with first value + and so on. Duplicate keys are not allowed within the same + map. +

+

Since: OTP 17.0

+
+
NIL_EXT -- cgit v1.2.3 From 785cb2081ff2c84453506380c97aced147df2b73 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 11 Mar 2014 09:41:19 +0100 Subject: erts: Clarify escript's encoding of the I/O-server A note has been added that clarifies that the encoding of the I/O-server has to be set explicitly, irrespective of any encoding comment. --- erts/doc/src/escript.xml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index d2b09d4515..1abbdb2180 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -4,7 +4,7 @@
- 20072013 + 20072014 Ericsson AB. All Rights Reserved. @@ -92,6 +92,18 @@ $ escript factorial 5 marker="stdlib:epp#encoding">encoding it can be located on the second line.

+

+ The encoding specified by the above mentioned comment + applies to the script itself. The encoding of the + I/O-server, however, has to be set explicitly like this: +io:setopts([{encoding, unicode}])

+

The default encoding of the I/O-server for standard_io + is latin1 + since the script runs in a non-interactive terminal + (see + Using Unicode in Erlang). +

+

On the third line (or second line depending on the presence of the Emacs directive), it is possible to give arguments to the emulator, such as

@@ -141,8 +153,9 @@ halt(1). -include_lib("kernel/include/file.hrl").

to include the record definitions for the records used by the file:read_link_info/1 function. You can also select - encoding here, but if there is a valid encoding comment on - the second line it takes precedence.

+ encoding by including a encoding comment here, but if there + is a valid encoding comment on the second line it takes + precedence.

The script will be checked for syntactic and semantic correctness before being run. If there are warnings (such as @@ -163,7 +176,7 @@ halt(1). If much of the execution takes place in interpreted code it may be worthwhile to compile it, even though the compilation itself will take a little while. It is also possible to supply - native instead of compile, this will compile the script + native instead of compile, this will compile the script using the native flag, again depending on the characteristics of the escript this could or could not be worth while.

@@ -239,7 +252,7 @@ factorial 5 = 120 can either be returned as a binary or written to file.

As an example of how the function can be used, we create an - interpreted escript which uses emu_args to set some emulator + interpreted escript which uses emu_args to set some emulator flag. In this case it happens to disable the smp_support. We do also extract the different sections from the newly created script:

-- cgit v1.2.3 From c543d5bff7fb23c3f44cc4817c0654117de78919 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 12 Mar 2014 20:11:10 +0100 Subject: erts: Change external format for maps to be: 116,Arity, K1,V1,K2,V2,...,Kn,Vn instead of: 116,Arity, K1,K2,...,Kn, V1,V2,....,Vn We think this will be better for future internal map structures like HAMT. Would be bad if we need to iterate twice over HAMT in term_to_binary, one for keys and one for values. --- erts/doc/src/erl_ext_dist.xml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index 9a53f3f829..fa083db4c7 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -581,23 +581,20 @@ 1 4 N - M 116 Arity - Keys - Values + Pairs

MAP_EXT encodes a map. The Arity field is an unsigned 4 byte integer in big endian format that determines the number of - key-value pairs in the map. All key terms follow in the Keys - section and then all value terms in the Values section. Keys - and values are paired according to order; first key with first value - and so on. Duplicate keys are not allowed within the same - map. + key-value pairs in the map. Key and value pairs (Ki => Vi) + are encoded in the Pairs section in the following order: + K1, V1, K2, V2,..., Kn, Vn. + Duplicate keys are not allowed within the same map.

Since: OTP 17.0

-- cgit v1.2.3 From 50cbd99857a674f2b082f5c436b7e721d33f4cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Sun, 16 Mar 2014 23:32:44 +0100 Subject: erts: Document map guard functions * erlang:is_map/1 * erlang:map_size/1 --- erts/doc/src/erlang.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index aeded7c719..e34646eaf0 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1783,6 +1783,15 @@ os_prompt%

Allowed in guard tests.

+ + + Check whether a term is a map + +

Returns true if Term is a map; + otherwise returns false.

+

Allowed in guard tests.

+
+
Check whether a term is a number @@ -2219,6 +2228,17 @@ os_prompt% {{[],aa,[],[],zz} + + + Return the size of a map + +

Returns an integer which is the number of key-value pairs in Map.

+
+> map_size(#{a=>1, b=>2, c=>3}).
+3
+

Allowed in guard tests.

+
+
Return the largest of two term -- cgit v1.2.3 From 66280266a4b9147ea683836e2409a2ad1f2a78af Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 26 Feb 2014 11:24:06 +0100 Subject: Change encoding for XML files to utf-8 These are some files that were erronously missed earlier: erts/doc/src/time_correction.xml lib/crypto/doc/src/crypto_app.xml lib/snmp/doc/src/snmpa_mib_data.xml lib/snmp/doc/src/snmpa_mib_storage.xml --- erts/doc/src/time_correction.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index d52cc7f3e2..7f7c28fc30 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -1,10 +1,10 @@ - +
- 19992013 + 19992014 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From e310677df7b3ce6506b35044abafcb507caa7e07 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 10 Mar 2014 17:44:25 +0100 Subject: Verify runtime_dependencies when running 'otp_build patch_app' --- erts/doc/src/erlang.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index aeded7c719..b06d5aeb12 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6121,8 +6121,8 @@ ok erlang:system_info() argument giving the exact OTP version. This since the exact OTP version in the general case is hard to determine. For more information see - the - documentation of the OTP version in the installation + the + documentation of versions in the system principles guide.

port_parallelism -- cgit v1.2.3 From bf3222f10edbd1f6a5186c8fb35c29900ad0665f Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 20 Mar 2014 19:01:11 +0100 Subject: Introduce minimum allowed major driver and nif versions on load --- erts/doc/src/erl_driver.xml | 7 +++++-- erts/doc/src/erl_nif.xml | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 8da1836da7..ad37813ac0 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -315,10 +315,13 @@ ERL_DRV_EXTENDED_MINOR_VERSION will be incremented when new features are added. The runtime system uses the minor version of the driver to determine what features to use. - The runtime system will refuse to load a driver if the major + The runtime system will normally refuse to load a driver if the major versions differ, or if the major versions are equal and the minor version used by the driver is greater than the one used - by the runtime system.

+ by the runtime system. Old drivers with lower major versions + will however be allowed after a bump of the major version during + a transition period of two major releases. Such old drivers might + however fail if deprecated features are used.

The emulator will refuse to load a driver that does not use the extended driver interface, to allow for 64-bit capable drivers, diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 8b19725c02..6b1f4cccf8 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -316,6 +316,32 @@ ok

The library initialization callbacks load, reload and upgrade are all thread-safe even for shared state data.

+ + Version Management +

+ When a NIF library is built, information about NIF API version + is compiled into the library. When a NIF library is loaded the + runtime system verifies that the library is of a compatible version. + erl_nif.h defines ERL_NIF_MAJOR_VERSION, and + ERL_NIF_MINOR_VERSION. ERL_NIF_MAJOR_VERSION will be + incremented when NIF library incompatible changes are made to the + Erlang runtime system. Normally it will suffice to recompile the NIF + library when the ERL_NIF_MAJOR_VERSION has changed, but it + could, under rare circumstances, mean that NIF libraries have to + be slightly modified. If so, this will of course be documented. + ERL_NIF_MINOR_VERSION will be incremented when + new features are added. The runtime system uses the minor version + to determine what features to use. +

+ The runtime system will normally refuse to load a NIF library if + the major versions differ, or if the major versions are equal and + the minor version used by the NIF library is greater than the one + used by the runtime system. Old NIF libraries with lower major + versions will however be allowed after a bump of the major version + during a transition period of two major releases. Such old NIF + libraries might however fail if deprecated features are used. +

+ Dirty NIFs

Note that the dirty NIF functionality is experimental and that you have to enable support for dirty -- cgit v1.2.3 From a9fd7c1ffbb2b3509821b6655f460e27f70c2892 Mon Sep 17 00:00:00 2001 From: Vlad Dumitrescu Date: Fri, 21 Mar 2014 21:24:28 +0100 Subject: Specify that +fn* flags affect even command-line parameters and environment variables --- erts/doc/src/erl.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 4aa3033f40..9724a1345a 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -536,7 +536,7 @@

The VM works with file names as if they are encoded using the ISO-latin-1 encoding, disallowing Unicode characters with codepoints beyond 255.

-

See STDLIB User's Guide for more infomation about unicode file names.

+

See STDLIB User's Guide for more infomation about unicode file names. Note that this value also applies to command-line parameters and environment variables (see STDLIB User's Guide).

@@ -555,7 +555,7 @@ encountered. w is the default. Note that file:read_link/1 will always return an error if the link points to an invalid file name.

-

See STDLIB User's Guide for more infomation about unicode file names.

+

See STDLIB User's Guide for more infomation about unicode file names. Note that this value also applies to command-line parameters and environment variables (see STDLIB User's Guide).

@@ -572,7 +572,7 @@ settings cause the behavior of +fnl to be selected, then w, i, or e will not have any effect.

-

See STDLIB User's Guide for more infomation about unicode file names.

+

See STDLIB User's Guide for more infomation about unicode file names. Note that this value also applies to command-line parameters and environment variables (see STDLIB User's Guide).

-- cgit v1.2.3 From ff3ac97b2fedf6621de5f3442a3b81f29f08daae Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 14 Mar 2014 16:18:33 +0100 Subject: ose: erlang display goes to ramlog printf --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index aeded7c719..e06c56daac 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -887,7 +887,7 @@ Print a term on standard output

Prints a text representation of Term on the standard - output.

+ output. On OSE the term is printed to the ramlog.

This BIF is intended for debugging only.

-- cgit v1.2.3 From be34551be2119a6c3c1a7edf113b7db12789423b Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Thu, 19 Dec 2013 14:36:06 +0000 Subject: Document an escript:create/2 hidden feature escript:create/2 accepts a 3-elements tuple containing files and zip:create/3 options to build a zip file. Also had to update zip typespecs to allow referral from escript docs. --- erts/doc/src/escript.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index 9e2a87dde6..bac8dd1e01 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -221,8 +221,13 @@ factorial 5 = 120 EmuArgs = string() | 'undefined' Body = {source, SourceCode} | {beam, BeamCode} - | {archive, ZipArchive} - SourceCode = BeamCode = ZipArchive = binary() + | {archive, ZipArchive} + | {archive, ZipFiles, ZipOptions} + SourceCode = BeamCode = file:filename() | binary() + ZipArchive = zip:filename() | binary() + ZipFiles = [ZipFile] + ZipFile = file:filename() | {file:filename(), binary()} | {file:filename(), binary(), file:file_info()} + ZipOptions = [zip:create_option()]

The create/2 -- cgit v1.2.3 From f719d0fe308f00b85f92c29d7cdf9b0dc20d98a2 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 7 Apr 2014 19:52:48 +0200 Subject: Update release notes --- erts/doc/src/notes.xml | 709 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 709 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index b4ebef72f4..eba4cdf06f 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,715 @@

This document describes the changes made to the ERTS application.

+
Erts 6.0 + +
Fixed Bugs and Malfunctions + + +

+ The option dupnames did not work as intended in re. When + looking for names with {capture, [Name, ...]}, re:run + returned a random instance of the match for that name, + instead of the leftmost matching instance, which was what + the documentation stated. This is now corrected to adhere + to the documentation. The option {capture,all_names} + along with a re:inspect/2 function is also added to + further help in using named subpatterns.

+

+ Own Id: OTP-11205

+
+ +

+ Allow loading of NIF library with unicode path name

+

+ Own Id: OTP-11408

+
+ +

+ Allow loading of driver with unicode path name

+

+ Own Id: OTP-11549

+
+ +

+ Fixed a bug where starting Erlang without having an open + stdin on fd 0 would sometimes deadlock the emulator when + terminating.

+

+ Own Id: OTP-11558

+
+ +

+ The option '-names' in epmd now works on Windows (Thanks + to Johannes Weißl)

+

+ Own Id: OTP-11565

+
+ +

+ Correction of the examples in escript documentation. + (Thanks to Pierre Fenoll).

+

+ Own Id: OTP-11577

+
+ +

+ Fix bs_get_integer instruction

+

+ The instruction bs_get_integer could unnecessarily + trigger a garbage collection in failure cases which is + unwanted or outright dangerous.

+

+ Ex:

+

+ <<X:Sz,_/bits>> = <<"some + binary">>

+

+ Previously, if Sz induced X to a bignum it would reserved + memory size this on the heap via a garbage collection + before checking if the size could actually match.

+

+ It will now check the binary size before triggering a + collection.

+

+ Own Id: OTP-11581

+
+ +

+ Remove heap space overestimation in binary_to_term + (and remote message reception) for integers in the + intervals [-2147483648,-1] and [256,2147483647] on 64-bit + emulators.

+

+ Own Id: OTP-11585

+
+ +

+ Add support for detecting the separate tinfo library from + ncurses (Thanks to Dirkjan Ochtman)

+

+ Own Id: OTP-11590

+
+ +

+ Deprecation warning for system_flag(cpu_topology) has + been extended for removal in OTP 18 (Thanks to Steve + Vinoski for the update)

+

+ Own Id: OTP-11602

+
+ +

+ Documentation improvement regarding some awkward wording + around the +spp flag. (Thanks to Brian L. Troutwine )

+

+ Own Id: OTP-11607

+
+ +

+ Fixed bug where sendfile would return the wrong error + code for a remotely closed socket if the socket was in + passive mode. (Thanks to Vincent Siliakus for reporting + the bug.)

+

+ Own Id: OTP-11614

+
+ +

+ Increase garbage collection tenure rate

+

The garbage collector tries to maintain the previous + heap block size during a minor gc, i.e. 'need' is not + utilized in determining the size of the new heap, instead + it relies on tenure and garbage to be sufficiently + large.

+

In instances during intense growing with exclusively + live data on the heap coupled with delayed tenure, + fullsweeps would be triggered directly after a minor gc + to make room for 'need' since the new heap would be + full.

+

To remedy this, the tenure of terms on the minor heap + will always happen (if it is below the high watermark) + instead of every other minor gc.

+

Characteristics Impact: Reduced CPU-time spent in + garbage collection but may infer delays in collecting + garbage from the heap. Tweak 'fullsweep_after' options to + increase gc pressure if needed.

+

+ Own Id: OTP-11617

+
+ +

+ Fix bug when comparing integers with floats larger than + 2^992. The bug could potentially cause memory corruption + on 32-bit emulators.

+

+ Own Id: OTP-11618

+
+ +

+ Cross-compilation fixes for TileraMDE-3.0.1.125620

+

+ Own Id: OTP-11635

+
+ +

+ sendfile no longer uses async threads by default

+

+ This has been done because a slow client attack is + possible if the async thread pool is used. The scenario + is:

+

+ Client does a request for a file and then slowly receives + the file one byte at a time. This will eventually fill + the async thread pool with blocking sendfile operations + and thus starving the vm of all file operations.

+

+ If you still want to use the async threads pool for + sendfile an option to enable it has been introduced.

+

+ Thanks to Christopher Faulet for identifying this + vulnerability.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11639

+
+ +

+ Do proper rollback of calls to + enif_open_resource_type when load/upgrade + callbacks of NIF library return failure.

+

+ Own Id: OTP-11722

+
+ +

+ Changed the default configuration when configuring with + $ERL_TOP/configure to be the same as when + configuring with $ERL_TOP/otp_build configure.

+

+ Previously floating point exceptions got enabled by + default on Linux when HiPE was enabled when configuring + with $ERL_TOP/configure, but not when configuring + with $ERL_TOP/otp_build configure. The default is + now in both cases not to use floating point exceptions + since there still exist unresolved issues with floating + point exceptions on Linux.

+

+ For more information see $ERL_TOP/HOWTO/INSTALL.md.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11723

+
+ +

+ A comment in erl_db_tree.c no longer differ from the + code. (Thanks to Cobus Carstens)

+

+ Own Id: OTP-11793

+
+ +

+ Fix epmd debug functionality for VxWorks (Thanks to Jay + True)

+

+ Own Id: OTP-11808

+
+ +

+ Use closefrom/2 when available in child_setup (Thanks to + Rick Reed and Anthony Ramine)

+

+ Own Id: OTP-11809

+
+ +

+ Fix dtrace/systemtap bug where the probe arguments would + be concatenated due to faulty length calculation.

+

+ Thanks to Michal Ptaszek and Scott Lystig Fritchie

+

+ Own Id: OTP-11816

+
+ +

+ It is now better documented that the +fn* flags to + erl also affect how command line parameters and + environment variables are read. (Thanks to Vlad + Dumitrescu)

+

+ Own Id: OTP-11818

+
+
+
+ + +
Improvements and New Features + + +

+ Options to set match_limit and match_limit_recursion are + added to re:run. The option report_errors is also added + to get more information when re:run fails due to limits + or compilation errors.

+

+ Own Id: OTP-10285

+
+ +

Dialyzer's unmatched_return warnings have been + corrected.

+

+ Own Id: OTP-10908

+
+ +

+ A common case is to wrap an argument to + list_to_binary/1 in a list to ensure conversion + can happen even though the argument may already be a + binary. Take special care of this case and do not copy + binary.

+

+ Impact: May cause incompatibility since a single binary + is no longer copied. Use binary:copy/1,2 instead.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11082

+
+ +

+ Make erlang:open_port/2 spawn and spawn_executable handle + unicode.

+

+ Own Id: OTP-11105

+
+ +

+ Handle unicode (widestring) in erl, erlc, heart, etc on + windows.

+

+ Own Id: OTP-11135

+
+ +

+ The version of the PCRE library Used by Erlang's re + module is raised to 8.33 from 7.6. This means, among + other things, better Unicode and Unicode Character + Properties support. New options connected to PCRE 8.33 + are also added to the re module (ucd, notempty_atstart, + no_start_optimize). PCRE has extended the regular + expression syntax between 7.6 and 8.33, why this imposes + a potential incompatibility. Only very complicated + regular expressions may be affected, but if you know you + are using obscure features, please test run your regular + expressions and verify that their behavior has not + changed.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11204

+
+ +

Filenames containing UTF-8 encoded characters can now + be handled by erlc.

+

If you have set the ERLC_EMULATOR environment + variable, note that erlc in OTP 17 will only work + with erl in OTP 17 since the protocol between the + erlc program and the erl_compile module has + changed.

+

+ Own Id: OTP-11248

+
+ +

+ By giving --enable-static-{nifs,drivers} to configure it + is now possible to statically linking of nifs and drivers + to the main Erlang VM binary. At the moment only the asn1 + and crypto nifs of the Erlang/OTP nifs and drivers have + been prepared to be statically linked. For more details + see the Installation Guide in the System documentation.

+

+ Own Id: OTP-11258

+
+ +

+ Erlang/OTP has been ported to the realtime operating + system OSE. The port supports both smp and non-smp + emulator. For details around the port and how to started + see the User's Guide in the ose application.

+

+ Note that not all parts of Erlang/OTP has been ported.

+

+ Notable things that work are: non-smp and smp emulators, + OSE signal interaction, crypto, asn1, run_erl/to_erl, + tcp, epmd, distribution and most if not all non-os + specific functionality of Erlang.

+

+ Notable things that does not work are: udp/sctp, os_mon, + erl_interface, binding of schedulers.

+

+ Own Id: OTP-11334

+
+ +

+ Add the {active,N} socket option for TCP, UDP, and SCTP, + where N is an integer in the range -32768..32767, to + allow a caller to specify the number of data messages to + be delivered to the controlling process. Once the + socket's delivered message count either reaches 0 or is + explicitly set to 0 with inet:setopts/2 or by including + {active,0} as an option when the socket is created, the + socket transitions to passive ({active, false}) mode and + the socket's controlling process receives a message to + inform it of the transition. TCP sockets receive + {tcp_passive,Socket}, UDP sockets receive + {udp_passive,Socket} and SCTP sockets receive + {sctp_passive,Socket}.

+

+ The socket's delivered message counter defaults to 0, but + it can be set using {active,N} via any gen_tcp, gen_udp, + or gen_sctp function that takes socket options as + arguments, or via inet:setopts/2. New N values are added + to the socket's current counter value, and negative + numbers can be used to reduce the counter value. + Specifying a number that would cause the socket's counter + value to go above 32767 causes an einval error. If a + negative number is specified such that the counter value + would become negative, the socket's counter value is set + to 0 and the socket transitions to passive mode. If the + counter value is already 0 and inet:setopts(Socket, + [{active,0}]) is specified, the counter value remains at + 0 but the appropriate passive mode transition message is + generated for the socket.

+

+ Thanks to Steve Vinoski

+

+ Own Id: OTP-11368

+
+ +

+ A new optional scheduler utilization balancing mechanism + has been introduced. For more information see the + +sub command + line argument.

+

+ Characteristics impact: None, when not enabled. When + enabled, changed timing in the system, normally a small + overhead due to measuring of utilization and calculating + balancing information. On some systems, such as old + Windows systems, the overhead can be quite substantial. + This time measurement overhead highly depend on the + underlying primitives provided by the OS.

+

+ Own Id: OTP-11385

+
+ +

+ A call to either the garbage_collect/1 BIF or the + check_process_code/2 BIF may trigger garbage + collection of another processes than the process calling + the BIF. The previous implementations performed these + kinds of garbage collections without considering the + internal state of the process being garbage collected. In + order to be able to more easily and more efficiently + implement yielding native code, these types of garbage + collections have been rewritten. A garbage collection + like this is now triggered by an asynchronous request + signal, the actual garbage collection is performed by the + process being garbage collected itself, and finalized by + a reply signal to the process issuing the request. Using + this approach processes can disable garbage collection + and yield without having to set up the heap in a state + that can be garbage collected.

+

+ The garbage_collect/2, + and check_process_code/3 + BIFs have been introduced. Both taking an option list as + last argument. Using these, one can issue asynchronous + requests.

+

+ code:purge/1 and code:soft_purge/1 have + been rewritten to utilize asynchronous + check_process_code requests in order to + parallelize work.

+

+ Characteristics impact: A call to the + garbage_collect/1 BIF or the + check_process_code/2 BIF will normally take longer + time to complete while the system as a whole wont be as + much negatively effected by the operation as before. A + call to code:purge/1 and code:soft_purge/1 + may complete faster or slower depending on the state of + the system while the system as a whole wont be as much + negatively effected by the operation as before.

+

+ Own Id: OTP-11388 Aux Id: OTP-11535, OTP-11648

+
+ +

+ Cleanup 'Buckets' and 'Time left' fields in crashdump to + ease parsing.

+

+ Own Id: OTP-11419

+
+ +

+ Add sync option to file:open/2.

+

+ The sync option adds the POSIX O_SYNC flag to the open + system call on platforms that support the flag or its + equivalent, e.g., FILE_FLAG_WRITE_THROUGH on Windows. For + platforms that don't support it, file:open/2 returns + {error, enotsup} if the sync option is passed in. Thank + to Steve Vinoski and Joseph Blomstedt

+

+ Own Id: OTP-11498

+
+ +

+ erlang:binary_to_term will now cost an appropriate amount + of reductions and will interrupt (yield) for reschedule + if the term is big. This avoids too long schedules when + binary_to_term is used. (Thanks to Svante Karlsson for + the original patch)

+

+ Impact: Programs running binary_to_term on large binaries + will run more smoothly, but rescheduling will impact the + single process performance of the BIF. Single threaded + benchmarks might show degraded performance of the BIF, + while general system behaviour will be improved.

+

+ Own Id: OTP-11535 Aux Id: OTP-11388

+
+ +

+ Added high resolution icon for windows. (Thanks to Daniel + Goertz for the inspiration.)

+

+ Own Id: OTP-11560

+
+ +

+ Migration of memory carriers has been enabled by default + on all ERTS internal memory allocators based on the + alloc_util + framework except for temp_alloc. That is, +M<S>acul + de is default for these allocators. Note + that this also implies changed allocation strategies for + all of these allocators. They will all now use the + "address order first fit carrier best fit" strategy.

+

+ By passing +Muacul 0 on the command line, all + configuration changes made by this change will be + reverted.

+

+ Characteristics impact: Improved memory characteristics + with a smaller memory footprint at the expense of a quite + small performance cost.

+

+ Own Id: OTP-11604 Aux Id: OTP-10279

+
+ +

A clarification has been added to the documentation of + -on_load() in the Reference Manual that it is only + recommended for loading NIF libraries.

+

+ Own Id: OTP-11611

+
+ +

+fnaw is now default when starting the + emulator; it used to be +fnl.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11612

+
+ +

+ EEP43: New data type - Maps

+

+ With Maps you may for instance: M0 = + #{ a => 1, b => 2}, % create + associations M1 = M0#{ a := 10 }, % + update values M2 = M1#{ "hi" => + "hello"}, % add new associations #{ + "hi" := V1, a := V2, b := V3} = M2. % match keys with + values

+

+ For information on how to use Maps please see the + Reference + Manual.

+

+ The current implementation is without the following + features: No variable keys + No single value access No map + comprehensions

+

+ Note that Maps is experimental during OTP 17.0.

+

+ Own Id: OTP-11616

+
+ +

+ The previously deprecated driver API function + driver_async_cancel() has been removed. Due to + this, the driver API version has been bumped to 3.0.

+

+ Thanks to Steve Vinoski.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11628

+
+ +

+ Experimental "dirty scheduler" functionality has been + introduced. In order to try the functionality out, you + need to pass the command line argument + --enable-dirty-schedulers to configure when + building the system.

+

+ Dirty schedulers can currently only be used by NIFs on a + system with SMP support. More information can be found in + the erl_nif(3) + documentation, the erl(1) documentation, and + in the git commit comment of commit + 'c1c03ae4ee50e58b7669ea88ec4d29c6b2b67c7b'.

+

+ Note that the functionality is experimental, and + not supported. This functionality will + be subject to backward incompatible changes. You should + not enable the dirty scheduler functionality on + production systems. It is only provided for testing.

+

+ Thanks to Steve Vinoski.

+

+ Own Id: OTP-11629

+
+ +

+ Improve reduction cost and yielding of + term_to_binary. The reduction cost is increased + and garbage collection is disabled during yield.

+

+ Impact: Improves system responsiveness when + term_to_binary is called with large terms without + significant degradation of single threaded performance.

+

+ Own Id: OTP-11648 Aux Id: OTP-11388

+
+ +

+ By default, the system's version of zlib will be used, + provided its version is 1.2.4 or higher; otherwise the + built-in zlib will be used. The built-in version of zlib + has been bumped to 1.2.8. (Use the + --enable-builtin-zlib option to configure + to force the use of the built-in zlib.)

+

+ Own Id: OTP-11669

+
+ +

+ The default float encoding in binary_to_term and + external_size has been changed to use minor_mode 1 + instead of 0.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11738

+
+ +

+ Introduced the configure option + --with-assumed-cache-line-size=SIZE. For more + information see $ERL_TOP/HOWTO/INSTALL.md.

+

+ Own Id: OTP-11742

+
+ +

+ Halfword emulator is marked as deprecated. It still works + as before but is planned to be removed in a future major + release.

+

+ Own Id: OTP-11777

+
+ +

+ The external format for Maps has changed in a way that is + not compatible with the format used in OTP 17.0-rc1 and + OTP 17.0-rc2.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11782

+
+ +

+ Fixed faulty make dependency that would make some make + versions fail while building gen_git_version.mk.

+

+ Own Id: OTP-11784

+
+ +

+ Introduced functionality for allowing old drivers and NIF + libraries to be loaded during a transition period. For + more information see the version + management section in the erl_driver(3) + documentation and the version + management section in the erl_nif(3) + documentation.

+

+ Own Id: OTP-11799

+
+ +

+ Support file paths longer than 259 characters on Windows. + Long absolute paths are automatically converted to UNC + format with a \\?\ prefix which is the only way to + represent long paths. The 259 character limit still + applies for individual file names, relative paths and the + current working directory.

+

+ Own Id: OTP-11813

+
+ +

+ Document that escript:create/2 also accepts a 3-elements + tuple containing files and zip:create/3 options to build + a zip file.

+

+ Thanks to Pierre Fenoll

+

+ Own Id: OTP-11827

+
+ +

+ Add systemd socket activation for epmd.

+

+ Thanks to Matwey V. Kornilov

+

+ Own Id: OTP-11829

+
+
+
+ +
+
Erts 5.10.4
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c6237ad7b6b485990f915daa2b1cf0a9095f129d Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 10 Apr 2014 04:46:19 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index eba4cdf06f..68feaa027a 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,29 @@

This document describes the changes made to the ERTS application.

+
Erts 6.0.1 + +
Fixed Bugs and Malfunctions + + +

+ Fix broken system monitoring of large_heap for + non-smp VM. No message for large_heap was ever + sent on non-smp VM. Bug exist since R16B.

+

+ Own Id: OTP-11852

+
+ +

+ Fixed type spec of erlang:system_info/1.

+

+ Own Id: OTP-11859 Aux Id: OTP-11615

+
+
+
+ +
+
Erts 6.0
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 21207dc3deb90e02a7746df9c8794f5471d4a5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 7 Apr 2014 12:16:45 +0200 Subject: Document that spawn_opt/5 does not support the 'monitor' option --- erts/doc/src/erlang.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e7e9b218f2..0f4dfc0f98 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4842,6 +4842,8 @@ true Node does not exist, a useless pid is returned. Otherwise works like spawn_opt/4.

+

The monitor option is currently not supported by + spawn_opt/5.

-- cgit v1.2.3 From e492b43c3e4366e865e5f1c34d0834df2a91d490 Mon Sep 17 00:00:00 2001 From: Eiichi Tsukata Date: Wed, 23 Apr 2014 21:46:21 +0900 Subject: Add erlang:system_info(tolerant_timeofday) Add erlang:system_info(tolerant_timeofday), an API to check whether compensation for sudden changes of system time is enabled or not. --- erts/doc/src/erl.xml | 5 ++++- erts/doc/src/erlang.xml | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 9724a1345a..f8f4d14436 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -495,7 +495,7 @@ , not (). Note also that is used instead of on Windows.

- +

Disable compensation for sudden changes of system time.

Normally, will not immediately reflect @@ -510,6 +510,9 @@ reflect the current system time. Note that timers are based on . If the system time jumps, timers then time out at the wrong time.

+

NOTE: You can check whether the adjustment is enabled or + disabled by calling + erlang:system_info(tolerant_timeofday).

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e7e9b218f2..49cd0a8a52 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6293,6 +6293,13 @@ ok (driver_async()) as an integer.

+ tolerant_timeofday + +

Returns whether compensation for sudden changes of system + time is enabled or disabled.

+

See also +c + command line flag.

+
trace_control_word

Returns the value of the node's trace control word. -- cgit v1.2.3 From 7ff17ddfd337d1c49c1174d8d24b2ce0671b2c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 12 May 2014 14:26:30 +0200 Subject: BIFs should be considered exported All BIFs now have stub functions and are exported. For example in the erlang module: -export([..., is_list/1, ...]). . . . is_list(_Term) -> erlang:nif_error(undefined). But erlang:function_exported(erlang, is_list, 1) returns false, which is weird. Change erlang:function_exported/3 to return true for BIFs. --- erts/doc/src/erlang.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 0f4dfc0f98..03d184f4d2 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1252,10 +1252,11 @@ true Check if a function is exported and loaded

Returns true if the module Module is loaded - and contains an exported function Function/Arity; - otherwise false.

-

Returns false for any BIF (functions implemented in C - rather than in Erlang).

+ and contains an exported function Function/Arity, + or if there is a BIF (a built-in function implemented in C) + with the given name; otherwise returns false.

+

This function used to return false for built-in + functions before the 18.0 release.

-- cgit v1.2.3 From 02c00c02bedde6bad018eef490527aa513fbd552 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 12 Jun 2014 17:13:29 +0200 Subject: erts: Fix documentation for no of default allocator instances ll_alloc does not default to single instance since 17.0 --- erts/doc/src/erts_alloc.xml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index c9eca39a99..1ade41f1aa 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -4,7 +4,7 @@
- 20022013 + 20022014 Ericsson AB. All Rights Reserved. @@ -531,15 +531,9 @@

Multiple, thread specific instances of the allocator. This option will only have any effect on the runtime system with SMP support. Default behaviour on the runtime system with - SMP support:

- - ll_alloc - 1 instance. - Other allocators - NoSchedulers+1 instances. Each scheduler will use - a lock-free instance of its own and other threads will use - a common instance. - + SMP support is NoSchedulers+1 instances. Each scheduler will use + a lock-free instance of its own and other threads will use + a common instance.

It was previously (before ERTS version 5.9) possible to configure a smaller amount of thread specific instances than schedulers. This is, however, not possible any more.

-- cgit v1.2.3 From f47320f43c3fb39f78054834e60ae9424ac79f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 17 Jun 2014 16:26:50 +0200 Subject: doc: Fix broken links --- erts/doc/src/notes.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 68feaa027a..fbbaf1c674 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -595,9 +595,9 @@ "hi" := V1, a := V2, b := V3} = M2. % match keys with values

- For information on how to use Maps please see the - Reference - Manual.

+ For information on how to use Maps please see Map Expressions in the + + Reference Manual.

The current implementation is without the following features: No variable keys -- cgit v1.2.3 From 139825694c587b0f543224bf083170fad0e1ad75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 17 Jun 2014 16:56:09 +0200 Subject: doc: Fix broken links in Installation Guide --- erts/doc/src/notes.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index fbbaf1c674..6b3e41c1f2 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -4854,7 +4854,7 @@

The configure command line argument --enable-ethread-pre-pentium4-compatibility + marker="doc/installation_guide:INSTALL#Advanced-configuration-and-build-of-ErlangOTP">--enable-ethread-pre-pentium4-compatibility had no effect. This option is now also automatically enabled if required on the build machine.

@@ -5433,7 +5433,7 @@ platforms than before. If configure warns about no atomic implementation available, try using the libatomic_ops library. Use the --with-libatomic_ops=PATH + marker="doc/installation_guide:INSTALL#Advanced-configuration-and-build-of-ErlangOTP">--with-libatomic_ops=PATH configure command line argument when specifying where the libatomic_ops installation is located. The libatomic_ops library can be downloaded from: @@ -5451,7 +5451,7 @@ the pentium 4 processor. If you want the runtime system to be compatible with older processors (back to 486) you need to pass the --enable-ethread-pre-pentium4-compatibility + marker="doc/installation_guide:INSTALL#Advanced-configuration-and-build-of-ErlangOTP">--enable-ethread-pre-pentium4-compatibility configure command line argument when configuring the system.

-- cgit v1.2.3 From 77da984614ae462912a1896ba1bb73c798ffd4f8 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 19 Jun 2014 13:47:21 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 148 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 6b3e41c1f2..68875fe56f 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,154 @@

This document describes the changes made to the ERTS application.

+
Erts 6.1 + +
Fixed Bugs and Malfunctions + + +

The documentation for spawn_opt/5 now has a + note mentioning that the monitor option is not + supported.

+

+ Own Id: OTP-11849

+
+ +

+ Fix broken system monitoring of large_heap for + non-smp VM. No message for large_heap was ever + sent on non-smp VM. Bug exist since R16B.

+

+ Own Id: OTP-11852

+
+ +

+ The emulator without SMP support crashed when passing a + message to a process without enough heap space for the + message. This bug was introduced in erts-6.0.

+

+ Own Id: OTP-11887 Aux Id: OTP-11388

+
+ +

+ Fix race between ETS table deletion and unfixation that + could cause VM crash. The race could happen between a + terminating process that does not own the table but has a + fixation on it and another process that deletes the table + (maybe the owner terminating) at the same time. Bug + existed since R15B02.

+

+ Own Id: OTP-11892

+
+ +

The string following the -eval option when + invoking erl would not be properly translated from + UTF-8 to a list of Unicode characters (as would the + arguments for -run).

+

That bug would cause the build of Erlang/OTP to fail + when building in a directory whose pathname contained + non-US ASCII characters encoded in UTF-8. (Thanks to Eric + Pailleau for reporting this bug.)

+

+ Own Id: OTP-11916

+
+ +

+ Fix erts_debug:size/1 to handle Map sizes

+

+ Own Id: OTP-11923

+
+ +

+ Removed erlang:bitstr_to_list/1 and + erlang:list_to_bitstr/1. They were added by + mistake, and have always raised an undefined + exception when called.

+

+ Own Id: OTP-11942

+
+ +

+ Fixed compilation using mingw-w64 on Windows.

+

+ Thanks to Jani Hakala.

+

+ Own Id: OTP-11945

+
+ +

+ The git sha is no longer printed in the shell start + header when erlang is built from a tagged git release.

+

+ Own Id: OTP-11961

+
+ +

+ Fixed a bug where send trace events were + erroneously dropped when the send was done to a + registered process. This bug was introduced in R16B.

+

+ Own Id: OTP-11968

+
+
+
+ + +
Improvements and New Features + + +

The following native functions now bump an appropriate + amount of reductions and yield when out of + reductions:

+ erlang:binary_to_list/1 + erlang:binary_to_list/3 + erlang:bitstring_to_list/1 + erlang:list_to_binary/1 + erlang:iolist_to_binary/1 + erlang:list_to_bitstring/1 + binary:list_to_bin/1 +

Characteristics impact:

+ Performance The functions converting + from lists got a performance loss for very small lists, + and a performance gain for very large lists. + Priority Previously a process executing + one of these functions effectively got an unfair priority + boost. This priority boost depended on the input size. + The larger the input was, the larger the priority boost + got. This unfair priority boost is now lost. + +

+ Own Id: OTP-11888

+
+ +

+ The systemd features of epmd have been removed from epmd + by default. To enable them you have to build erlang with + the configure option --enable-systemd.

+

+ Own Id: OTP-11921

+
+ +

+ Removed Erlang wrapper code used when calling + binary_to_term/1, and binary_to_term/2. + This improves the performance of these BIFs especially + when they are called with small binaries as input.

+

+ Own Id: OTP-11931

+
+ +

+ Add erlang:system_info(tolerant_timeofday), an API to + check whether compensation for sudden changes of system + time is enabled or not.

+

+ Own Id: OTP-11970

+
+
+
+ +
+
Erts 6.0.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 864ebdc6264d134b1face2cd6b400b992b31e6e5 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Sat, 21 Jun 2014 17:22:34 -0400 Subject: add missing description for erl +SDio option Add explanatory text for the erl +SDio option, which is used to set the number of dirty I/O schedulers. --- erts/doc/src/erl.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 9724a1345a..1a4a955d8b 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -848,6 +848,19 @@

+ +

Sets the number of dirty I/O scheduler threads to create when threading + support has been enabled. The valid range is 0-1024. By default, the number + of dirty I/O scheduler threads created is 10, same as the default number of + threads in the async thread pool + . +

+

This option is ignored if the emulator doesn't have threading support + enabled. Currently, this option is experimental and is supported only + if the emulator was configured and built with support for dirty schedulers + enabled (it's disabled by default). +

+

Scheduling specific flags.

-- cgit v1.2.3 From dba1d881f3232a939c6620f5fd6b4a97ff454bee Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 1 Jul 2014 13:58:47 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 68875fe56f..5f39822712 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,23 @@

This document describes the changes made to the ERTS application.

+
Erts 6.1.1 + +
Fixed Bugs and Malfunctions + + +

+ Fixed ETHR_FORCE_INLINE which caused the build to break + on some platforms without adequate thread support + (VxWorks).

+

+ Own Id: OTP-12010

+
+
+
+ +
+
Erts 6.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 61fefeb9d96b4899efbc945138b23b73cb9b6ac9 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Fri, 20 Jun 2014 10:55:29 +0100 Subject: erlang:statistics(runtime) returns milliseconds Specify in the documentation that erlang:statistics(runtime) returns milliseconds. --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 9ad42374bf..84168397f6 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4968,7 +4968,7 @@ true

Note that the run-time is the sum of the run-time for all threads in the Erlang run-time system and may therefore be greater - than the wall-clock time.

+ than the wall-clock time. The time is returned in milliseconds.

 > statistics(runtime).
 {1690,1620}
-- 
cgit v1.2.3


From de2fb97f15ac98aa1d1c5533aacca378334f4778 Mon Sep 17 00:00:00 2001
From: Anthony Ramine 
Date: Tue, 1 Jul 2014 00:58:26 +0200
Subject: Fix handling of broken symlinks in filelib

This fixes a bug introduced in f11aabdc9fec593c31e6c4f3fa25c1707e9c35df where
filelib:eval_read_file_info/2 was made to use file:read_link_info/1 to never
follow symlinks. This fixed wildcard/1 but broke every other function using
eval_read_file_info/2.

Reported-by: Louis-Philippe Gauthier
Reported-by: Danil Zagoskin
---
 erts/doc/src/erl_prim_loader.xml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'erts/doc')

diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml
index 6751deda4d..171f84decc 100644
--- a/erts/doc/src/erl_prim_loader.xml
+++ b/erts/doc/src/erl_prim_loader.xml
@@ -147,6 +147,22 @@
           See code(3) about archive files.

+ + + Get information about a link or file + +

This function works like + read_file_info/1 + except that if Filename is a symbolic link, + information about the link will be returned in the file_info + record and the type field of the record will be set to + symlink.

+

If Filename is not a symbolic link, this function + returns exactly the same result as read_file_info/1. + On platforms that do not support symbolic links, this function + is always equivalent to read_file_info/1.

+
+
Set the path of the loader -- cgit v1.2.3 From 41d2dc56d5d2a3be1ba59c6999e1003360b1e308 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 10 Jul 2014 10:45:27 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 5f39822712..086d29c668 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,25 @@

This document describes the changes made to the ERTS application.

+
Erts 6.1.2 + +
Fixed Bugs and Malfunctions + + +

+ OTP-11850 fixed filelib:wildcard/1 to work with broken + symlinks. This correction, however, introduced problems + since symlinks were no longer followed for functions like + filelib:ensure_dir/1, filelib:is_dir/1, + filelib:file_size/1, etc. This is now corrected.

+

+ Own Id: OTP-12054 Aux Id: seq12660

+
+
+
+ +
+
Erts 6.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From e5ecd0d0924af44aaed9f59f61ef8430c8e1f355 Mon Sep 17 00:00:00 2001 From: Derek Brown Date: Mon, 21 Jul 2014 15:15:40 -0400 Subject: Fix minor grammatical errors in epmd docs Small grammar changes. --- erts/doc/src/epmd.xml | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 963d35c3c8..25f819ab50 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -58,12 +58,12 @@ of the IP address and a port number. The name of the node is an atom on the form of . The job of the daemon is to keep track of which - node name listens on which address. Hence, map + node name listens on which address. Hence, maps symbolic node names to machine addresses.

The TCP/IP epmd daemon actually only keeps track of - the Name (first) part of an Erlang node name, the Host - part (whatever is after the is implicit in the + the Name (first) part of an Erlang node name. The Host + part (whatever is after the ) is implicit in the node name where the epmd daemon was actually contacted, as is the IP address where the Erlang node can be reached. Consistent and correct TCP naming services are @@ -77,12 +77,12 @@

The daemon is started automatically by the erl command if the node is to be distributed and there is no running instance present. If automatically launched, - environment variables has to be used to alter the behavior of + environment variables have to be used to alter the behavior of the daemon. See the Environment variables section below.

-

If the -daemon argument is not given, the +

If the -daemon argument is not given, runs as a normal program with the controlling terminal of the shell in which it is started. Normally, it should run as a daemon.

@@ -122,7 +122,7 @@ comma-separated list of IP addresses and on the loopback address (which is implicitly added to the list if it has not been specified). This can also be set using the - environment variable, see the + environment variable. See the section Environment variables below.

@@ -130,7 +130,7 @@

Let this instance of epmd listen to another TCP port than default 4369. This can also be set using the - environment variable, see the + environment variable. See the section Environment variables below

@@ -153,7 +153,7 @@

With relaxed command checking, the epmd daemon can be killed from the localhost with i.e. epmd -kill even if there are active nodes registered. Normally only daemons with an empty node database can be killed with the epmd -kill command.

-

The epmd -stop command (and the corresponding messages to epmd, as can be given using erl_interface/ei) is normally always ignored, as it opens up for strange situation when two nodes of the same name can be alive at the same time. A node unregisters itself by just closing the connection to epmd, why the stop command was only intended for use in debugging situations.

+

The epmd -stop command (and the corresponding messages to epmd, as can be given using erl_interface/ei) is normally always ignored, as it opens up the possibility of a strange situation where two nodes of the same name can be alive at the same time. A node unregisters itself by just closing the connection to epmd, which is why the stop command was only intended for use in debugging situations.

With relaxed command checking enabled, you can forcibly unregister live nodes.

@@ -166,7 +166,7 @@
DbgExtra options -

These options are purely for debugging and testing epmd clients, they should not be used in normal operation.

+

These options are purely for debugging and testing epmd clients. They should not be used in normal operation.

@@ -177,9 +177,9 @@ -

To simulate a busy server you can insert a delay between epmd - gets notified about that a new connection is requested and - when the connections gets accepted.

+

To simulate a busy server you can insert a delay between when epmd + gets notified that a new connection is requested and + when the connection gets accepted.

@@ -191,15 +191,15 @@
Interactive options -

These options make epmd run as an interactive command displaying the results of sending queries ta an already running instance of epmd. The epmd contacted is always on the local node, but the -port option can be used to select between instances if several are running using different port on the host.

+

These options make epmd run as an interactive command, displaying the results of sending queries to an already running instance of epmd. The epmd contacted is always on the local node, but the -port option can be used to select between instances if several are running using different ports on the host.

Contacts the epmd listening on the given TCP port number (default 4369). This can also be set using the - environment variable, see the + environment variable. See the section Environment - variables below

+ variables below.

@@ -210,7 +210,7 @@

Kill the currently running epmd.

Killing the running epmd is only allowed if epmd - -names show an empty database or + -names shows an empty database or -relaxed_command_check was given when the running instance of epmd was started. Note that -relaxed_command_check is given when starting the @@ -228,7 +228,7 @@

This command can only be used when contacting epmd instances started with the -relaxed_command_check flag. Note that relaxed command checking has to be enabled for - the epmd daemon contacted, When running epmd + the epmd daemon contacted. When running epmd interactively, -relaxed_command_check has no effect.

@@ -259,7 +259,7 @@

If set prior to start, the epmd daemon will behave as if the -relaxed_command_check option was given at - start-up. If consequently setting this option before starting + start-up. Consequently, if this option is set before starting the Erlang virtual machine, the automatically started epmd will accept the -kill and -stop commands without restrictions.

@@ -287,8 +287,8 @@ remote hosts. However, only the query commands are answered (and acted upon) if the query comes from a remote host. It is always an error to try to register a nodename if the client is not a process - located on the same host as the epmd instance is running on, - why such requests are considered hostile and the connection is + located on the same host as the epmd instance is running on- + such requests are considered hostile and the connection is immediately closed.

The queries accepted from remote nodes are:

@@ -307,3 +307,4 @@ + -- cgit v1.2.3 From 65e335e255cb76d979f605ed34700e4e02041139 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 22 Jul 2014 18:01:29 +0200 Subject: Update release notes --- erts/doc/src/notes.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 8c008c493e..2fe8879b93 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,27 @@

This document describes the changes made to the ERTS application.

+
Erts 5.10.4.1 + +
Known Bugs and Problems + + +

+ When using gen_tcp:connect and the fd option with + port and/or ip, the port and + ip options were ignored. This has been fixed so + that if port and/or ip is specified + together with fd a bind is requested for that + fd. If port and/or ip is not + specified bind will not be called.

+

+ Own Id: OTP-12061

+
+
+
+ +
+
Erts 5.10.4
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 62081266545df8f5eda8e2043f33055cfe575126 Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Fri, 25 Jul 2014 09:11:35 +0200 Subject: fix xml file merge messup --- erts/doc/src/notes.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 50de3c5d4d..5c4bb3ed25 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -940,6 +940,12 @@ Thanks to Matwey V. Kornilov

Own Id: OTP-11829

+ + +
+ +
+
Erts 5.10.4.1
Known Bugs and Problems -- cgit v1.2.3 From 5e72adfd8b56f50416d66a018028e2e6895032e0 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 14 Aug 2014 21:32:53 +0200 Subject: Fix +swct doc --- erts/doc/src/erl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 5bde285311..f856b9ab86 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1186,7 +1186,7 @@ utilization.

- +sws very_eager|eager|medium|lazy|very_lazy + +swct very_eager|eager|medium|lazy|very_lazy

Set scheduler wake cleanup threshold. Default is medium. -- cgit v1.2.3 From a46f30f38f0e757e9aa335e1452879db608d8489 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 27 Jun 2014 14:47:26 +0200 Subject: Properly support maps in match_specs --- erts/doc/src/match_spec.xml | 57 ++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index 334b47d34c..b4cc8e9f78 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -76,22 +76,26 @@ { GuardFunction, ConditionExpression, ... } BoolFunction ::= | - | | | - | | | - | | | - | | | - | | | | - | + | | + | | + | | + | | + | | + | | + | | + | | + | | + ConditionExpression ::= ExprMatchVariable | { GuardFunction } | { GuardFunction, ConditionExpression, ... } | TermConstruct ExprMatchVariable ::= MatchVariable (bound in the MatchHead) | | - TermConstruct = {{}} | {{ ConditionExpression, ... }} | - | [ConditionExpression, ...] | NonCompositeTerm | Constant - - NonCompositeTerm ::= term() (not list or tuple) - + TermConstruct = {{}} | {{ ConditionExpression, ... }} | + | [ConditionExpression, ...] | + | #{term() => ConditionExpression, ...} | + NonCompositeTerm | Constant + NonCompositeTerm ::= term() (not list or tuple or map) Constant ::= {, term()} GuardFunction ::= BoolFunction | | @@ -134,22 +138,26 @@ { GuardFunction, ConditionExpression, ... } BoolFunction ::= | - | | | - | | | - | | | - | | | - | | | | - | + | | + | | + | | + | | + | | + | | + | | + | | + | | + ConditionExpression ::= ExprMatchVariable | { GuardFunction } | { GuardFunction, ConditionExpression, ... } | TermConstruct ExprMatchVariable ::= MatchVariable (bound in the MatchHead) | | TermConstruct = {{}} | {{ ConditionExpression, ... }} | - | [ConditionExpression, ...] | NonCompositeTerm | Constant - - NonCompositeTerm ::= term() (not list or tuple) - + | [ConditionExpression, ...] | #{} | + #{term() => ConditionExpression, ...} | NonCompositeTerm | + Constant + NonCompositeTerm ::= term() (not list or tuple or map) Constant ::= {, term()} GuardFunction ::= BoolFunction | | @@ -172,9 +180,10 @@ Functions allowed in all types of match specifications

The different functions allowed in work like this:

-

is_atom, is_float, is_integer, is_list, is_number, is_pid, is_port, is_reference, is_tuple, is_binary, is_function: Like the corresponding guard tests in - Erlang, return or . -

+

is_atom, is_float, is_integer, is_list, is_number, is_pid, is_port, + is_reference, is_tuple, is_map, is_binary, is_function: Like the + corresponding guard tests in Erlang, return or + .

is_record: Takes an additional parameter, which SHALL be the result of )]]>, like in . -- cgit v1.2.3 From 4ec6f6875469f32bc499876605df2542a4c13532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 16 Jun 2014 16:37:26 +0200 Subject: erts: Document erlang:get_keys/0 --- erts/doc/src/erlang.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 3d8ef9a97d..97fe6d2915 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1376,6 +1376,19 @@ true alive; otherwise the atom nocookie.

+ + + Return a list of all keys from the process dictionary + +

Returns a list of keys all keys present in the process dictionary.

+
+> put(dog, {animal,1}),
+put(cow, {animal,2}),
+put(lamb, {animal,3}),
+get_keys().
+[dog,cow,lamb]
+
+
Return a list of keys from the process dictionary -- cgit v1.2.3 From e167bca85a86cc7a149d53da5cdd08b0905e71a6 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Thu, 29 May 2014 22:10:06 -0400 Subject: add enif_schedule_nif() to NIF API In the #erlang IRC channel Anthony Ramine once mentioned the idea of allowing a NIF to use an emulator trap, similar to a BIF trap, to schedule another NIF for execution. This is exactly how dirty NIFs were implemented for Erlang/OTP 17.0, so this commit refactors and generalizes that dirty NIF code to support a new enif_schedule_nif() API function. The enif_schedule_nif() function allows a long-running NIF to be broken into separate NIF invocations. The NIF first executes part of the long-running task, then calls enif_schedule_nif() to schedule a NIF for later execution to continue the task. Any number of NIFs can be scheduled in this manner, one after another. Since the emulator regains control between invocations, this helps avoid problems caused by native code tying up scheduler threads for too long. The enif_schedule_nif() function also replaces the original experimental dirty NIF API. The function takes a flags parameter that a caller can use to indicate the NIF should be scheduled onto either a dirty CPU scheduler thread, a dirty I/O scheduler thread, or scheduled as a regular NIF on a regular scheduler thread. With this change, the original experimental enif_schedule_dirty_nif(), enif_schedule_dirty_nif_finalizer() and enif_dirty_nif_finalizer() API functions are no longer needed and have been removed. Explicit scheduling of a dirty NIF finalization function is no longer necessary; if an application wants similar functionality, it can have a dirty NIF just invoke enif_schedule_nif() to schedule a non-dirty NIF to complete its task. Lift the restriction that dirty NIFs can't call enif_make_badarg() to raise an exception. This was a problem with the original dirty NIF API because it forced developers to get and check all incoming arguments in a regular NIF, and then schedule the dirty NIF which then had to get all the arguments again. Now, the argument checking can be done in the dirty NIF and it can call enif_make_badarg() itself to flag incorrect arguments. Extend the ErlNifFunc struct with a new flags field that allows NIFs to be declared as dirty. The default value for this field is 0, indicating a regular NIF, so it's backwards compatible with all existing statically initialized ErlNifFunc struct instances, and so such instances require no code changes. Defining the flags field with a value of ERL_NIF_DIRTY_JOB_CPU_BOUND indicates that the NIF should execute on a dirty CPU scheduler thread, or defining it with a value of ERL_NIF_DIRTY_JOB_IO_BOUND indicates that the NIF should execute on a dirty I/O scheduler thread. Any other flags field value causes a NIF library loading error. Extend the ErlNifEntry struct with a new options field that indicates whether a NIF library was built with support for optional features such as dirty NIFs. When a NIF library is loaded, the runtime checks the options field to ensure compatibility. If a NIF library built with dirty NIF support is loaded into a runtime that does not support dirty NIFs, and the library defines one or more ErlNifFunc entries with non-zero flags fields indicating dirty NIFs, a NIF library loading error results. There is no error if a NIF library built with dirty NIF support is loaded into a runtime that does not support dirty NIFs but the library does not have any dirty NIFs. It is also not an error if a library without dirty NIF support is loaded into a runtime built with dirty NIF support. Add documentation and tests for enif_schedule_nif(). --- erts/doc/src/erl_nif.xml | 141 +++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 79 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 6b1f4cccf8..1d33b334bb 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -168,16 +168,18 @@ ok

As mentioned in the warning text at the beginning of this document it is of vital importance that a native function - does return relatively fast. It is hard to give an exact maximum amount + return relatively quickly. It is hard to give an exact maximum amount of time that a native function is allowed to work, but as a rule of thumb - a well behaving native function should return to its caller before a + a well-behaving native function should return to its caller before a millisecond has passed. This can be achieved using different approaches. - If you have full control over the code that are to execute in the native + If you have full control over the code to execute in the native function, the best approach is to divide the work into multiple chunks of - work and call the native function multiple times. Function + work and call the native function multiple times, either directly from Erlang code + or by having a native function schedule a future NIF call via the + enif_schedule_nif function. Function enif_consume_timeslice can be - used this facilitate such work division. In some cases, however, this might not - be possible, e.g. when calling third party libraries. Then you typically want + used to help with such work division. In some cases, however, this might not + be possible, e.g. when calling third-party libraries. Then you typically want to dispatch the work to another thread, return from the native function, and wait for the result. The thread can send the result back to the calling thread using message passing. Information @@ -342,29 +344,31 @@ ok libraries might however fail if deprecated features are used.

- Dirty NIFs -

Note that the dirty NIF functionality - is experimental and that you have to enable support for dirty - schedulers when building OTP in order to try the functionality out. Native functions + Long-running NIFs +

Native functions must normally run quickly, as explained earlier in this document. They generally should execute for no more than a millisecond. But not all native functions can execute so quickly; for example, functions that encrypt large blocks of data or perform lengthy file system operations can often run for tens of seconds or more.

-

A NIF that cannot execute in a millisecond or less is called a "dirty NIF" since - it performs work that the Erlang runtime cannot handle cleanly. Applications - that make use of such functions must indicate to the runtime that the functions are +

If the functionality of a long-running NIF can be split so that its work can be + achieved through a series of shorter NIF calls, the application can either make that series + of NIF calls from the Erlang level, or it can call a NIF that first performs a chunk of the + work, then invokes the enif_schedule_nif + function to schedule another NIF call to perform the next chunk. The final call scheduled + in this manner can then return the overall result. Breaking up a long-running function in + this manner enables the VM to regain control between calls to the NIFs, thereby avoiding + degraded responsiveness, scheduler load balancing problems, and other strange behaviours.

+

A NIF that cannot be split and cannot execute in a millisecond or less is called a "dirty NIF" + because it performs work that the Erlang runtime cannot handle cleanly. + Note that the dirty NIF functionality described here is experimental and that you have to + enable support for dirty schedulers when building OTP in order to try the functionality out. + Applications that make use of such functions must indicate to the runtime that the functions are dirty so they can be handled specially. To schedule a dirty NIF for execution, the - application calls enif_schedule_dirty_nif, - passing to it a pointer to the dirty NIF to be executed and indicating with a flag + appropriate flags value can be set for the NIF in its ErlNifFunc + entry, or the application can call enif_schedule_nif, + passing to it a pointer to the dirty NIF to be executed and indicating with the flags argument whether it expects the operation to be CPU-bound or I/O-bound.

-

All dirty NIFs must ultimately invoke the - enif_schedule_dirty_nif_finalizer as their final action, passing to it the - result they wish to return to the original caller. A finalizer function can either - receive the result and return it directly, or it can return a different value instead. - For convenience, the NIF API provides the - enif_dirty_nif_finalizer function that applications can use as a finalizer; - it simply returns its result argument.

Dirty NIF support is available only when the emulator is configured with dirty schedulers enabled. This feature is currently disabled by default. To determine whether the dirty NIF API is available, native code can check to see if the C preprocessor macro @@ -498,6 +502,7 @@ typedef struct { const char* name; unsigned arity; ERL_NIF_TERM (*fptr)(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); + unsigned flags; } ErlNifFunc;

Describes a NIF by its name, arity and implementation. @@ -508,7 +513,17 @@ typedef struct { will thus denote the Nth argument to the NIF. Note that the argc argument allows for the same C function to implement several Erlang functions with different arity (but - same name probably).

+ same name probably). For a regular NIF, flags is 0 (and + so its value can be omitted for statically initialized ErlNifFunc + instances), or it can be used to indicate that the NIF is a dirty NIF that should be executed + on a dirty scheduler thread (note that the dirty NIF functionality + described here is experimental and that you have to enable + support for dirty schedulers when building OTP in order to try the + functionality out). If the dirty NIF is expected to be + CPU-bound, its flags field should be set to + ERL_NIF_DIRTY_JOB_CPU_BOUND, or for I/O-bound jobs, + ERL_NIF_DIRTY_JOB_IO_BOUND.

ErlNifBinary @@ -672,18 +687,6 @@ typedef enum { See also the warning text at the beginning of this document.

- ERL_NIF_TERMenif_dirty_nif_finalizer(ErlNifEnv* env, ERL_NIF_TERM result) - Simple dirty NIF result finalizer - -

A convenience function that a dirty NIF can use as a finalizer that simply - return its result argument as its return value. This function is provided - for dirty NIFs with results that should be returned directly to the original caller.

-

This function is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. To determine whether - the dirty NIF API is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

-
-
intenif_equal_tids(ErlNifTid tid1, ErlNifTid tid2)

Same as erl_drv_equal_tids. @@ -811,9 +814,9 @@ typedef enum { built with threading support, dirty scheduler threads are available and enif_have_dirty_schedulers() returns true. If the emulator was built without threading support, enif_have_dirty_schedulers() returns false.

-

If dirty scheduler threads are not available in the emulator, calls to - enif_schedule_dirty_nif and enif_schedule_dirty_nif_finalizer result in - the NIF and finalizer functions being called directly within the calling thread.

+

If dirty scheduler threads are not available in the emulator, a call to + enif_schedule_nif with its flags argument set to indicate that the specified + NIF is to be executed on a dirty scheduler thread results in a badarg exception.

This function is available only when the emulator is configured with dirty schedulers enabled. This feature is currently disabled by default. To determine whether the dirty NIF API is available, native code can check to see if the C preprocessor macro @@ -873,8 +876,8 @@ typedef enum {

Check to see if the current NIF is executing on a dirty scheduler thread. If the emulator is built with threading support, calling enif_is_on_dirty_scheduler from within a dirty NIF returns true. It returns false when the calling NIF is a regular - NIF or a NIF finalizer, both of which run on normal scheduler threads, or when the emulator - is built without threading support.

+ NIF running on a normal scheduler thread, or when the emulator is built without threading + support.

This function is available only when the emulator is configured with dirty schedulers enabled. This feature is currently disabled by default. To determine whether the dirty NIF API is available, native code can check to see if the C preprocessor macro @@ -1245,46 +1248,27 @@ typedef enum {

Same as erl_drv_rwlock_tryrwlock.

- ERL_NIF_TERMenif_schedule_dirty_nif(ErlNifEnv* env, int flags, ERL_NIF_TERM (*fp)(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]), int argc, const ERL_NIF_TERM argv[]) - Schedule a dirty NIF for execution + ERL_NIF_TERMenif_schedule_nif(ErlNifEnv* env, const char* fun_name, int flags, ERL_NIF_TERM (*fp)(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]), int argc, const ERL_NIF_TERM argv[]) + Schedule a NIF for execution -

Schedule dirty NIF fp to execute a long-running operation. The flags - argument must be set to either ERL_NIF_DIRTY_JOB_CPU_BOUND if the job is expected to - be primarily CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will be - I/O-bound. The argc and argv arguments can either be the originals passed - into the calling NIF, or they can be values created by the calling NIF. The calling - NIF must use the return value of enif_schedule_dirty_nif as its own return value.

-

Be aware that enif_schedule_dirty_nif, as its name implies, only schedules the - dirty NIF for future execution. The calling NIF does not block waiting for the dirty NIF to - execute and return, which means that the calling NIF can't expect to receive the dirty NIF +

Schedule NIF fp to execute. This function allows an application to break up long-running + work into multiple regular NIF calls or to schedule a dirty NIF + to execute on a dirty scheduler thread (note that the dirty NIF functionality described here is + experimental and that you have to enable support for dirty schedulers when building OTP in + order to try the functionality out).

+

The fun_name argument provides a name for the NIF being scheduled for execution. If it cannot + be converted to an atom, enif_schedule_nif returns a badarg exception.

+

The flags argument must be set to 0 for a regular NIF, or if the emulator was built the + experimental dirty scheduler support enabled, flags can be set to either ERL_NIF_DIRTY_JOB_CPU_BOUND + if the job is expected to be primarily CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will + be I/O-bound.

+

The argc and argv arguments can either be the originals passed into the calling NIF, or + they can be values created by the calling NIF.

+

The calling NIF must use the return value of enif_schedule_nif as its own return value.

+

Be aware that enif_schedule_nif, as its name implies, only schedules the + NIF for future execution. The calling NIF does not block waiting for the scheduled NIF to + execute and return, which means that the calling NIF can't expect to receive the scheduled NIF return value and use it for further operations.

-

A dirty NIF may not invoke the enif_make_badarg - to raise an exception. If it wishes to return an exception, the dirty NIF should pass a - regular result indicating the exception details to its finalizer, and allow the finalizer - to raise the exception on its behalf.

-

This function is available only when the emulator is configured with dirty schedulers - enabled. This feature is currently disabled by default. To determine whether the dirty NIF API - is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

-
-
- ERL_NIF_TERMenif_schedule_dirty_nif_finalizer(ErlNifEnv* env, ERL_NIF_TERM result, ERL_NIF_TERM (*fp)(ErlNifEnv* env, ERL_NIF_TERM result)) - Schedule a dirty NIF finalizer - -

When a dirty NIF finishes executing, it must schedule a finalizer function to return - its result to the original NIF caller. The dirty NIF passes result as the value it - wants the finalizer to use as the return value. The fp argument is a pointer to the - finalizer function. The NIF API provides the - enif_dirty_nif_finalizer function that can be used as a finalizer that simply - returns its result argument. You are also free to write your own custom finalizer - that uses result to derive a different return value, or ignores result - entirely and returns a completely different value.

-

Without exception, all dirty NIFs must invoke enif_schedule_dirty_nif_finalizer - to complete their execution.

-

This function is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. To determine whether - the dirty NIF API is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

ErlNifPid *enif_self(ErlNifEnv* caller_env, ErlNifPid* pid) @@ -1384,4 +1368,3 @@ typedef enum {

erlang:load_nif/2

- -- cgit v1.2.3 From 12d3d25535225934cb2190c82c1b5dae005f1cda Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 11 Sep 2014 17:47:32 +0200 Subject: erts: Remove enif_have_dirty_schedulers() and add 'dirty_scheduler_support' to ErlNifSysInfo --- erts/doc/src/erl_driver.xml | 5 +++++ erts/doc/src/erl_nif.xml | 25 +++++-------------------- 2 files changed, 10 insertions(+), 20 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index ad37813ac0..4a1aab75c7 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -546,6 +546,7 @@ typedef struct ErlDrvSysInfo { int scheduler_threads; int nif_major_version; int nif_minor_version; + int dirty_scheduler_support; } ErlDrvSysInfo; @@ -610,6 +611,10 @@ typedef struct ErlDrvSysInfo { nif_minor_version The value of ERL_NIF_MINOR_VERSION when the runtime system was compiled. + dirty_scheduler_support + A value != 0 if the runtime system has support for dirty scheduler threads; + otherwise 0. + ErlDrvBinary diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 1d33b334bb..3de94be9ff 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -374,9 +374,8 @@ ok the dirty NIF API is available, native code can check to see if the C preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined. Also, if the Erlang runtime was built without threading support, dirty schedulers are disabled. To check at runtime for the presence - of dirty scheduler threads, code can call the - enif_have_dirty_schedulers() API function, which returns true if dirty - scheduler threads are present, false otherwise.

+ of dirty scheduler threads, code can use the + enif_system_info() API function.

@@ -807,22 +806,6 @@ typedef enum { and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

- intenif_have_dirty_schedulers() - Runtime check for the presence of dirty scheduler threads - -

Check at runtime for the presence of dirty scheduler threads. If the emulator is - built with threading support, dirty scheduler threads are available and - enif_have_dirty_schedulers() returns true. If the emulator was built without - threading support, enif_have_dirty_schedulers() returns false.

-

If dirty scheduler threads are not available in the emulator, a call to - enif_schedule_nif with its flags argument set to indicate that the specified - NIF is to be executed on a dirty scheduler thread results in a badarg exception.

-

This function is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. To determine whether - the dirty NIF API is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

-
-
intenif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin) Inspect the content of a binary

Initialize the structure pointed to by bin with @@ -1261,7 +1244,9 @@ typedef enum {

The flags argument must be set to 0 for a regular NIF, or if the emulator was built the experimental dirty scheduler support enabled, flags can be set to either ERL_NIF_DIRTY_JOB_CPU_BOUND if the job is expected to be primarily CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will - be I/O-bound.

+ be I/O-bound. If dirty scheduler threads are not available in the emulator, a try to schedule such a job + will result in a badarg exception.

+

The argc and argv arguments can either be the originals passed into the calling NIF, or they can be values created by the calling NIF.

The calling NIF must use the return value of enif_schedule_nif as its own return value.

-- cgit v1.2.3 From 950d808c97a4c5b579f4f1cc16b95f2d419d3505 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 15 Sep 2014 12:02:14 +0200 Subject: Update release notes --- erts/doc/src/notes.xml | 170 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 5c4bb3ed25..743369951f 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,176 @@

This document describes the changes made to the ERTS application.

+
Erts 6.2 + +
Fixed Bugs and Malfunctions + + +

+ General documentation updates.

+

+ Own Id: OTP-12052

+
+ +

A bug in the VM code implementing sending of signals + to ports could cause the receiving port queue to remain + in a busy state forever. When this state had been + reached, processes sending command signals to the port + either got suspended forever, or, if the nosuspend + feature was used, always failed to send to the port. This + bug was introduced in ERTS version 5.10.

+

In order for this bug to be triggered on a port, one + had to at least once utilize the nosuspend + functionality when passing a signal to the port. This by + either calling

port_command(Port, + Data, [nosuspend | Options]), + erlang:send(Port, {PortOwner, + {command, Data}}, [nosuspend | Options]), + erlang:send_nosuspend(Port, + {PortOwner, {command, Data}}), or + erlang:send_nosuspend(Port, + {PortOwner, {command, Data}}, Options). + +

Thanks Vasily Demidenok for reporting the issue, and + Sergey Kudryashov for providing a testcase.

+

+ Own Id: OTP-12082 Aux Id: OTP-10336

+
+ +

+ Fix size overflow bug at memory allocation. A memory + allocation call, with an insane size close to the entire + address space, could return successfully as if it had + allocated just a few bytes. (Thanks to Don A. Bailey for + reporting)

+

+ Own Id: OTP-12091

+
+ +

+ Fix various issues where negating a signed integer would + trigger undefined behaviour. This fixes issues in the + enif_make_int64 interface and some edge cases inside the + erlang runtime system.

+

+ Own Id: OTP-12097

+
+ +

+ The documentation erroneously listed the +swct command line + argument under +sws.

+

+ Own Id: OTP-12102 Aux Id: OTP-10994

+
+ +

+ Profiling messages could be delivered out of order when + profiling on runnable_procs and/or + runnable_ports using erlang:system_profile/2. + This bug was introduced in ERTS version 5.10.

+

+ Own Id: OTP-12105 Aux Id: OTP-10336

+
+ +

+ Various logging fixes, including: Add run queue index to + the process dump in crash dumps.
Add thread index to + enomem slogan when crashing.
Remove error logger + message for sending messages to old instances of the same + node.

+

+ Own Id: OTP-12115

+
+ +

+ Fix compiler warnings reported by LLVM

+

+ Own Id: OTP-12138

+
+ +

+ Correct conversion of MIN_SMALL by + list_to_integer/1 and binary_to_integer/1. + The bug produced an unnormalized bignum which can cause + strange behavior such as comparing different to a correct + MIN_SMALL integer. The value MIN_SMALL is + -(1 bsl 27) = -134217728 on a 32-bit VM and -(1 + bsl 59) = -576460752303423488 on a 64-bit VM. (Thanks + to Jesper Louis Andersen, Mikael Pettersson and Anthony + Ramine for report, patch and optimization suggestion)

+

+ Own Id: OTP-12140

+
+ +

+ Fix bug in term_to_binary that reallocates binary + with inconsistent size information. Bug has never been + confirmed to be the cause of any faulty behavior.

+

+ Own Id: OTP-12141

+
+ +

+ Real_path method used while prim loading archive files + was not taking into account the fact that windows + directory symlinks can be across different drives.

+

+ Own Id: OTP-12155

+
+
+
+ + +
Improvements and New Features + + +

+ Add log2 histogram to lcnt for lock wait time

+

+ Own Id: OTP-12059

+
+ +

+ Introduced enif_schedule_nif() + to the NIF API.

+

+ The enif_schedule_nif() function allows a + long-running NIF to be broken into separate NIF + invocations without the help of a wrapper function + written in Erlang. The NIF first executes part of the + long-running task, then calls enif_schedule_nif() + to schedule a NIF for later execution to continue the + task. Any number of NIFs can be scheduled in this manner, + one after another. Since the emulator regains control + between invocations, this helps avoid problems caused by + native code tying up scheduler threads for too long.

+

+ The enif_schedule_nif() function also replaces the + enif_schedule_dirty_nif() in the experimental + dirty NIF API. Note that the only incompatible changes + made are in the experimental dirty NIF API.

+

+ See the NIF + documentation for more information.

+

+ Thanks to Steve Vinoski.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12128

+
+
+
+ +
+
Erts 6.1.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6084a42a24fca52a5de2bc487c0cd2be46dcc21f Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 26 Aug 2014 17:26:31 +0200 Subject: Introduce support for eager check I/O scheduling --- erts/doc/src/erl.xml | 17 +++++++++++++++++ erts/doc/src/erlang.xml | 11 +++++++++++ 2 files changed, 28 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 528a2d95aa..967226056e 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1065,6 +1065,23 @@

For more information, see erlang:system_info(cpu_topology).

+ +secio true|false + +

Enable or disable eager check I/O scheduling. The default + is currently false, but will most likely be changed + to true in OTP 18. The behaviour before this flag + was introduced corresponds to +secio false.

+

The flag effects when schedulers will check for I/O + operations possible to execute, and when such I/O operations + will execute. As the name of the parameter implies, + schedulers will be more eager to check for I/O when + true is passed. This however also implies that + execution of outstanding I/O operation will not be + prioritized to the same extent as when false is + passed.

+

erlang:system_info(eager_check_io) + returns the value of this parameter used when starting the VM.

+
+sfwi Interval

Set scheduler forced wakeup interval. All run queues will diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e3ef48a6c1..e02e4cbbc9 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5611,6 +5611,7 @@ ok + Information about the system

Returns various information about the current system @@ -5740,6 +5741,16 @@ ok The return value will always be false since the elib_malloc allocator has been removed.

+ eager_check_io + +

+ Returns the value of the erl + +secio command line + flag which is either true or false. See the + documentation of the command line flag for information about + the different values. +

+
ets_limit

Returns the maximum number of ETS tables allowed. This limit -- cgit v1.2.3 From cb604704efd28fafd0f8edce03db00f7fef53909 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 23 Sep 2014 18:06:44 +0200 Subject: Change default to "eager check I/O" Conflicts: erts/emulator/beam/erl_process.c --- erts/doc/src/erl.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 141754e4f9..f3ada61f3e 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1144,9 +1144,9 @@ +secio true|false

Enable or disable eager check I/O scheduling. The default - is currently false, but will most likely be changed - to true in OTP 18. The behaviour before this flag - was introduced corresponds to +secio false.

+ is currently true. The default was changed from false + to true as of erts version 7.0. The behaviour before this + flag was introduced corresponds to +secio false.

The flag effects when schedulers will check for I/O operations possible to execute, and when such I/O operations will execute. As the name of the parameter implies, -- cgit v1.2.3 From 024ad413bd20219e92c7642e4c29689886bf96ce Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Fri, 17 Oct 2014 15:50:41 -0400 Subject: Clarify docs for driver_async() return value The documentation for driver_async() still referred to the return value of the function as a "handle", which is no longer meaningful since driver_async_cancel() was deprecated and removed. Modify the documentation to simply indicate that the driver_async() return value will be -1 if it fails. --- erts/doc/src/erl_driver.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 4a1aab75c7..77fc906aca 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -2033,7 +2033,8 @@ ERL_DRV_MAP int sz entry function is called. If ready_async is null in the driver entry, the async_free function is called instead.

-

The return value is a handle to the asynchronous task.

+

The return value is -1 if the driver_async call + fails.

As of erts version 5.5.4.3 the default stack size for threads in the async-thread pool is 16 kilowords, -- cgit v1.2.3 From 0aa4dc4f66815aa4b40e8b3b2d8b9a24c180debe Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Fri, 17 Oct 2014 17:21:37 -0400 Subject: Clarify the use of SIGUSR1 for forcing crash dumps The crash_dump document mentions indirectly that delivering a SIGUSR1 to a running emulator process can force it to crash dump. Clarify that text to make it clear SIGUSR1 can be used for that purpose, and also add a similar note about using SIGUSR1 to the erl documentation. --- erts/doc/src/crash_dump.xml | 5 +++-- erts/doc/src/erl.xml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index d3de29b876..2b5fc877c3 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -115,8 +115,9 @@ sockets/pipes can be used simultaneously by Erlang (due to limitations in the Unix call). The number of open regular files is not affected by this. - "Received SIGUSR1" - The SIGUSR1 signal was sent to the - Erlang machine (Unix only). + "Received SIGUSR1" - Sending the SIGUSR1 signal to a + Erlang machine (Unix only) forces a crash dump. This slogan reflects + that the Erlang machine crash-dumped due to receiving that signal. "Kernel pid terminated (Who) (Exit-reason)" - The kernel supervisor has detected a failure, usually that the diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index f856b9ab86..e85519185f 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -525,7 +525,8 @@ core dump and no crash dump if an internal error is detected.

Calling erlang:halt/1 with a string argument will still - produce a crash dump.

+ produce a crash dump. On Unix systems, sending an emulator process + a SIGUSR1 signal will also force a crash dump.

-- cgit v1.2.3 From 1bc59d68f5d22650fa18aa064ed8e50fc9a6a216 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 2 Nov 2014 19:49:55 +0300 Subject: Expose NIF version This patch allows checking for NIF API version in a way similar to driver version. E.g. by calling erlang:system_info(nif_version). Signed-off-by: Peter Lemenkov --- erts/doc/src/erlang.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 111756407f..483d81cfb6 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6144,6 +6144,11 @@ ok erlang:system_info(multi_scheduling), and erlang:system_info(schedulers).

+ nif_version + +

Returns a string containing the erlang NIF version + used by the runtime system. It will be on the form "<major ver>.<minor ver>".

+
otp_release

Returns a string containing the OTP release number of the -- cgit v1.2.3 From f482c5cc6dc4c23d39319586c3e1049e859a6f01 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 4 Nov 2014 12:21:27 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 743369951f..7bc39fd351 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,31 @@

This document describes the changes made to the ERTS application.

+
Erts 6.2.1 + +
Fixed Bugs and Malfunctions + + +

+ Fix bug when an migrated empty memory carrier is reused + just before it should be destroyed by the thread that + created it.

+

+ Own Id: OTP-12249

+
+ +

+ Repair run_erl terminal window size adjustment sent from + to_erl. This was broken in OTP 17.0 which could lead to + strange cursor behaviour in the to_erl shell.

+

+ Own Id: OTP-12275 Aux Id: seq12739

+
+
+
+ +
+
Erts 6.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 3b7508f6e75fd304736145528b53652f839a9b46 Mon Sep 17 00:00:00 2001 From: Sina Samavati Date: Mon, 10 Nov 2014 16:01:53 +0330 Subject: Fix a typo in the zlib documentation --- erts/doc/src/zlib.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index 11a7437f5a..da8ccdecdf 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -302,7 +302,7 @@ list_to_binary([B1,B2]) Decompress data

inflate/2 decompresses as much data as possible. - It may some introduce some output latency (reading + It may introduce some output latency (reading input without producing any output).

If a preset dictionary is needed at this point (see inflateSetDictionary below), inflate/2 throws a -- cgit v1.2.3 From 08504087f66ab23e39c082782524e2d1e531e3e7 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 11 Nov 2014 15:16:03 +0100 Subject: Remove comments about unicode atoms in OTP 18 There was once a plan to implement support for unicode atoms in OTP 18. This plan has been stopped until further notice, and the information about this is now removed from the documentation. --- erts/doc/src/erl_ext_dist.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index fa083db4c7..a6e7dddbed 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -126,9 +126,8 @@ However, only characters that can be encoded using Latin1 (ISO-8859-1) are currently supported in atoms. The support for UTF-8 encoded atoms in the external format has been implemented in order to be able to support - all Unicode characters in atoms in some future release. Full - support for Unicode atoms will not happen before OTP-R18, and might - be introduced even later than that. Until full Unicode support for + all Unicode characters in atoms in some future release. + Until full Unicode support for atoms has been introduced, it is an error to pass atoms containing characters that cannot be encoded in Latin1, and the behavior is undefined.

-- cgit v1.2.3 From a8377a44bb81ab86a694c57f2f10527cf51612d4 Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Tue, 2 Dec 2014 19:13:16 +0100 Subject: fix eacces spelling --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 483d81cfb6..cba2c07959 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2840,7 +2840,7 @@ os_prompt% raised. The error reason may differ between operating systems. Typically the error enoent is raised when one tries to run a program that is not found and - eaccess is raised when the given file is not + eacces is raised when the given file is not executable.

{fd, In, Out} -- cgit v1.2.3 From 6e3057ddddb77835664f5264a7da62452dc3d9c1 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 11 Sep 2014 18:26:00 +0200 Subject: erts: Allow cpu_timestamp tracing for Linux --- erts/doc/src/erlang.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index f9e8717847..37431cbf1b 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6829,7 +6829,9 @@ ok only allowed with PidSpec==all. If the host machine operating system does not support high resolution CPU time measurements, trace/3 exits with - badarg.

+ badarg. Note that most operating systems do + not synchronize this value across cores, so be prepared + that time might seem to go backwards when using this option.

arity -- cgit v1.2.3 From 7f3486a5ddc02a366f2945dfd009c4a2697a2b98 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 9 Dec 2014 15:21:47 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 252 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 252 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 7bc39fd351..c896ee0cae 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,258 @@

This document describes the changes made to the ERTS application.

+
Erts 6.3 + +
Fixed Bugs and Malfunctions + + +

+ Fix HiPE debug lock checking on OS X 64bit

+

+ Position-independent code is mandatory on OS X. We use + r11 as an intermediate register to fill + BIF_P->hipe.bif_callee. This fixes the following error + when doing `make debug FLAVOR=smp`:

+

+ clang -cc1as: fatal error: error in backend: 32-bit + absolute addressing is not supported in 64-bit mode

+

+ Own Id: OTP-12188

+
+ +

+ Fix race bug that could cause VM crash in + erlang:port_get_data/1 if the port was closed by a + concurrent process. Also fix fatal bug if + port_set_data/2 is called with a non-immediate + data term. Both bugs exist since R16B01.

+

+ Own Id: OTP-12208

+
+ +

+ Correct make variable SSL_DED_LD_RUNTIME_LIBRARY_PATH + when erl_xcomp_sysroot ends with a slash.

+

+ Own Id: OTP-12216 Aux Id: seq12700

+
+ +

+ Fix two cases of unreachable code caused by false use of + assigment operators.

+

+ Own Id: OTP-12222

+
+ +

+ Fix bug when hipe compiled code makes tail call to a BIF + that disables GC while trapping (sush as binary_to_list, + list_to_binary, binary_to_term, term_to_binary).

+

+ Own Id: OTP-12231

+
+ +

+ Fix bug when a migrated empty memory carrier is reused + just before it should be destroyed by the thread that + created it.

+

+ Own Id: OTP-12249

+
+ +

+ Prevents compile-time errors in NIFs, when the compiler + is instructed to treat missing field initializers as + errors, by adding an initializer for the new options + field which was added to ErlNifEntry for 17.3.

+

+ Own Id: OTP-12266

+
+ +

+ Fixed CPU topology detection on FreeBSD systems where + Erlang/OTP is compiled by new C compilers (including, but + possibly not limited to, gcc 4.9 and clang).

+

+ Own Id: OTP-12267

+
+ +

+ Use C99 function isfinite() instead of finite() when + available on non GCC compilers.

+

+ Own Id: OTP-12268

+
+ +

+ Fix bug on windows where an incorrect number of links + could be returned when doing file:read_file_info on a + directory.

+

+ Own Id: OTP-12269

+
+ +

+ Fix rare bug when purging module on VM started with + +Meamin.

+

+ Own Id: OTP-12273

+
+ +

+ Repair run_erl terminal window size adjustment sent from + to_erl. This was broken in OTP 17.0 which could lead to + strange cursor behaviour in the to_erl shell.

+

+ Own Id: OTP-12275 Aux Id: seq12739

+
+ +

+ Fixed bug on windows causing gen_tcp/udp to return an + error when given an fd to work with.

+

+ Own Id: OTP-12289

+
+ +

+ Fix various internal erts issues where negating a signed + integer in C would trigger undefined behavior. This fixes + issues when dividing with bignums and list_to_integer.

+

+ Own Id: OTP-12290

+
+ +

+ When flushing output to stdout on windows, the emulator + could sometimes hang indefinitely waiting for the flush + to complete. This has been fixed.

+

+ Own Id: OTP-12291

+
+ +

+ Fix so that non-smp emulators with dirty scheduler + support shows the correct number of dirty schedulers when + calling erlang:system_info(system_version).

+

+ Own Id: OTP-12295

+
+ +

+ Add nif_version to erlang:system_info/1 in + order to get the NIF API version of the runtime system in + a way similar to driver_version.

+

+ Own Id: OTP-12298

+
+ +

+ Fix bug that could cause the return value from dirty NIF + with zero arity to be treated as garbage, leading to VM + crash.

+

+ Own Id: OTP-12300

+
+ +

+ Improve allocation carrier migration search logic. This + will reduce the risk of failed migrations that could lead + to excess memory consumption. It will also improve smp + performance due to reduced memory contention on the + migration pool.

+

+ Own Id: OTP-12323

+
+
+
+ + +
Improvements and New Features + + +

Introduced support for eager check I/O.

+

By default eager check I/O will be disabled, but this + will most likely be changed in OTP 18. When eager check + I/O is enabled, schedulers will more frequently check for + I/O work. Outstanding I/O operations will however not be + prioritized to the same extent as when eager check I/O is + disabled.

+

Eager check I/O can be enabled using the erl + command line argument: +secio true

+

Characteristics impact when enabled:

+ Lower latency and smoother management of externally + triggered I/O operations. A slightly reduced + priority of externally triggered I/O operations. + +

+ Own Id: OTP-12117

+
+ +

+ Fix erts .app-file

+

+ Own Id: OTP-12189

+
+ +

+ Add configure option --with-ssl-incl=PATH to support + OpenSSL installations with headers and libraries at + different places.

+

+ Own Id: OTP-12215 Aux Id: seq12700

+
+ +

+ Optimization of atomic memory operations with release + barrier semantics on 32-bit PowerPC when using the + implementation included in OTP.

+

+ Own Id: OTP-12250

+
+ +

+ Minor adjustment of scheduler activation code making sure + that an activation of a scheduler is not prevented by its + run-queue being non-empty. (Thanks to Songlu Cai)

+

+ Own Id: OTP-12287

+
+ +

+ Improved support for atomic memory operations provided by + the libatomic_ops + library. Most importantly support for use of native + double word atomics when implemented by + libatomic_ops (for example, implemented for ARM).

+

+ The $ERL_TOP/HOWTO/INSTALL.md + document now also more clearly describes when you want to + build together with a libatomic_ops installation.

+

+ Own Id: OTP-12302

+
+ +

+ Add configure option --with-ssl-rpath to control which + runtime library path to use for dynamic linkage toward + OpenSSL.

+

+ Own Id: OTP-12316 Aux Id: seq12753

+
+ +

+ Added systemd notify support to epmd

+

+ Own Id: OTP-12321

+
+
+
+ +
+
Erts 6.2.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From ffd0153e6dffcc29cf79d0191860047dba0438bb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 4 Dec 2014 11:09:06 +0100 Subject: erts: Improve crash dumps This commit improves crash dumps in several ways: * Suspends schedulers to get a current snapshot * Dumps information about scheduler * Dumps stack trace of current running process (including Garbing processes) --- erts/doc/src/crash_dump.xml | 88 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index 2b5fc877c3..8291bf38b7 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -55,10 +55,12 @@ emulator or the operating system can be reconfigured to avoid the crash, which is why interpreting the crash dump correctly is important.

+

On systems that support OS signals, it is also possible to stop + the runtime system and generate a crash dump by sending the SIGUSR1.

The erlang crash dump is a readable text file, but it might not be very easy to read. Using the Crashdump Viewer tool in the application will simplify the task. This is an - HTML based tool for browsing Erlang crash dumps.

+ wx-widget based tool for browsing Erlang crash dumps.

@@ -66,8 +68,9 @@

The first part of the dump shows the creation time for the dump, a slogan indicating the reason for the dump, the system version, of the node from which the dump originates, the compile time of - the emulator running the originating node and the number of - atoms in the atom table. + the emulator running the originating node, the number of + atoms in the atom table and the runtime system thread that caused + the crash dump to happen.

@@ -169,6 +172,60 @@
+
+ + Scheduler information +

Under the tag =scheduler information about the current state + and statistics of the schedulers in the runtime system is displayed. + On OSs that do allow instant suspension of other threads, the data within + this section will reflect what the runtime system looks like at the moment + when the crash happens.

+

The following fields can exist for a process:

+ + =scheduler:id + Header, states the scheduler identifier. + Scheduler Sleep Info Flags + If empty the scheduler was doing some work. + If not empty the scheduler is either in some state of sleep, + or suspended. This entry is only present in a SMP enabled emulator + Scheduler Sleep Info Aux Work + If not empty, a scheduler internal auxiliary work is scheduled + to be done. + Current Port + The port identifier of the port that is currently being + executed by the scheduler. + Current Process + The process identifier of the process that is currently being + executed by the scheduler. If there is such a process this entry is + followed by the State,Internal State, + Program Counter, CP of that same process. See + Process Information for a + description what the different entries mean. Keep in mind that + this is a snapshot of what the entries are exactly when the crash + dump is starting to be generated. Therefore they will most likely + be different (and more telling) then the entries for the same + processes found in the =proc section. If there is no currently + running process, only the Current Process entry will be printed. + + Current Process Limited Stack Trace + This entry only shows up if there is a current process. It is very + similar to =proc_stack, + except that only the function frames are printed (i.e. the stack variables + are omited). It is also limited to only print the top and bottom part + of the stack. If the stack is small (less that 512 slots) then the + entire stack will be printed. If not, an entry stating + skipping ## slots will be printed where ## is + replaced by the number of slots that has been skipped. + Run Queue + Displays statistics about how many processes and ports + of different priorities are scheduled on this scheduler. + ** crashed ** + This entry is normally not printed. It signifies that getting + the rest of the information about this scheduler failed for some reason. + + +
+
Memory information @@ -314,6 +371,9 @@ The number of live argument registers. The argument registers, if any are live, will follow. These may contain the arguments of the function if they are not yet moved to the stack. + Internal State + A more detailed internal represantation of the state of + this process.

See also the section about process data.

@@ -339,18 +399,38 @@ Name The name of the table, regardless of whether it is a or not. - Buckets + Hash table, Buckets This occurs if the table is a hash table, i.e. if it is not an . + Hash table, Chain Length + Only applicable for hash tables. Contains statistics about the + hash table, such as the max, min and avg chain length. Having a max much + larger than the avg, and a std dev much larger that + the expected std dev is a sign that the hashing of the terms is + behaving badly for some reason. Ordered set (AVL tree), Elements This occurs only if the table is an . (The number of elements is the same as the number of objects in the table.) + Fixed + If the table is fixed using ets:safe_fixtable or some internal + mechanism. Objects The number of objects in the table Words The number of words (usually 4 bytes/word) allocated to data in the table. + Type + The type of the table, i.e. set, bag, + dublicate_bag or ordered_set. + Compressed + If this table was compressed. + Protection + The protection of this table. + Write Concurrency + If write_concurrency was enabled for this table. + Read Concurrency + If read_concurrency was enabled for this table.
-- cgit v1.2.3 From cd450ec99350bff295c42252b191687fee415c7a Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 30 Jan 2015 16:57:04 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index c896ee0cae..af0d4d7377 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,65 @@

This document describes the changes made to the ERTS application.

+
Erts 6.3.1 + +
Fixed Bugs and Malfunctions + + +

+ Fix getifaddrs realloc pointer error

+

+ When a buffer was exhausted and subsequently reallocated, + we could get an unsafe pointer pointing to faulty memory.

+

+ For this to occur we would need to have a large number of + interfaces and a reallocation of memory to a lower + addresses.

+

+ The symptom would be garbage returned from + erlang:port_control(Port, 25, []) + (prim_inet:getifaddrs(Port) resulting in a badarg) or a + segmentation fault.

+

+ Own Id: OTP-12445

+
+ +

+ Don't close all file descriptors twice in child_setup

+

+ The commit c2b4eab25c907f453a394d382c04cd04e6c06b49 + introduced an error in which child_setup erroneously + tried to close all file descriptors twice.

+

+ Use closefrom() if available when closing all file + descriptors.

+

+ The function closefrom() was only used in the vfork() + case before but is now also used in the fork() case if + available.

+

+ Own Id: OTP-12446

+
+ +

+ During a crashdump all file descriptors are closed to + ensure the closing of the epmd port and to reserve a file + descriptor for the crashdump file.

+

+ If a driver (third party library) cannot handle closing + of sockets this could result in a segmentation fault in + which case a crashdump would not be produced. This is now + fixed by only closing inets sockets via an emergency + close callback to the driver and thus closing the epmd + socket.

+

+ Own Id: OTP-12447

+
+
+
+ +
+
Erts 6.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From b24651c3bb6fef59c0e92c24e69151d1a92c4b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D1=80=D0=BE?= =?UTF-8?q?=D1=85=D0=BE=D1=80=D0=BE=D0=B2?= Date: Mon, 19 Jan 2015 05:06:53 +0300 Subject: Add zlib limited output buffer size functionality This functionality may be useful for compressed streams with high compression ratio (in case of gzip it may be up to x1000), when small amount of compressed data will produce large amount of uncompressed output. This may lead to DoS attacks, because server easily goes out of memory. Example of such high compression ratio stream: ``` dd if=/dev/zero of=sparse.bin bs=1MB count=100 # 100mb of zeroes gzip sparse.bin # 95kb sparse.bin.gz $ erl > {ok, Compressed} = file:read_file("sparse.bin.gz"), > 97082 = size(Compressed), > Uncompressed = zlib:gunzip(Compressed), > 100000000 = iolist_size(Uncompressed). ``` --- erts/doc/src/zlib.xml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index da8ccdecdf..673b743e2e 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -311,6 +311,53 @@ list_to_binary([B1,B2]) compressor.

+ + + Decompress data with limited output size + +

Like inflate/2, but decompress no more data than + will fit in the buffer configured via setBufSize/2. + Is is useful when decompressing a stream with a high compression + ratio such that a small amount of compressed input may expand up to + 1000 times. + It returns {more, Decompressed}, when there is more output + available, and inflateChunk/1 should be used to read it. + It may introduce some output latency (reading + input without producing any output).

+

If a preset dictionary is needed at this point (see + inflateSetDictionary below), inflateChunk/2 throws a + {need_dictionary,Adler} exception where Adler is + the adler32 checksum of the dictionary chosen by the + compressor.

+ +
+walk(Compressed, Handler) ->
+    Z = zlib:open(),
+    zlib:inflateInit(Z),
+    % Limit single uncompressed chunk size to 512kb
+    zlib:setBufSize(Z, 512 * 1024),
+    loop(Z, Handler, zlib:inflateChunk(Z, Compressed)),
+    zlib:inflateEnd(Z),
+    zlib:close(Z).
+
+loop(Z, Handler, {more, Uncompressed}) ->
+    Handler(Uncompressed),
+    loop(Z, Handler, zlib:inflateChunk(Z));
+loop(Z, Handler, Uncompressed) ->
+    Handler(Uncompressed).
+        
+
+
+ + + Read next uncompressed chunk + +

Read next chunk of uncompressed data, initialized by + inflateChunk/2.

+

This function should be repeatedly called, while it returns + {more, Decompressed}.

+
+
Initialize the decompression dictionary -- cgit v1.2.3 From 7d82a632f4837764ac79dfb4986d102060bd3080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 3 Mar 2015 18:55:22 +0100 Subject: Update zlib:zwindowbits/0 type to accept 8 and -8 Commit 7e8f5a776cbfa376e03369d058a90c8dd9f217fc (importing R11B-3) updated zlib, which had changed what values it accepts for window bits from 9-15 to 8-15. From deflate.c: - windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_HUFFMAN_ONLY) { + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } + if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ In inflate.c 8 was already an accepted value. This commit updates OTP to also accept the values 8 and -8. --- erts/doc/src/zlib.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index da8ccdecdf..b46baad7b5 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -99,7 +99,7 @@ list_to_binary([Compressed|Last]) -

Normally in the range -15..-9 | 9..15.

+

Normally in the range -15..-8 | 8..15.

@@ -149,7 +149,7 @@ list_to_binary([Compressed|Last]) currently the only supported method is deflated.

The WindowBits parameter is the base two logarithm of the window size (the size of the history buffer). It - should be in the range 9 through 15. Larger values + should be in the range 8 through 15. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit/2. A negative WindowBits @@ -288,7 +288,7 @@ list_to_binary([B1,B2])

Initialize decompression session on zlib stream.

The WindowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). - It should be in the range 9 through 15. + It should be in the range 8 through 15. The default value is 15 if inflateInit/1 is used. If a compressed stream with a larger window size is given as input, inflate() will throw the data_error -- cgit v1.2.3 From 93f0ff928b89dce4e62e4017065d87fcc5cf4cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 4 Mar 2015 17:28:37 +0100 Subject: erts: Document option 'hpds' --- erts/doc/src/erl.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index d11f6b0c6d..f08467bfc6 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -588,6 +588,11 @@

Sets the default binary virtual heap size of processes to the size .

+ + +

Sets the initial process dictionary size of processes to the size + .

+

Enables or disables the kernel poll functionality if -- cgit v1.2.3 From cdf87da805533282e5efb214a4dd9fc6e3049266 Mon Sep 17 00:00:00 2001 From: Nick Mills Date: Sat, 7 Mar 2015 16:32:32 -0500 Subject: Correct typo in erlang(3) documentation --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index cba2c07959..0e5909a52d 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1356,7 +1356,7 @@ true Return a value from the process dictionary -

Returns the value Valassociated with Key in +

Returns the value Val associated with Key in the process dictionary, or undefined if Key does not exist.

-- 
cgit v1.2.3


From f0cfce64b6a061ffeafeda254734f0b1f2f452fd Mon Sep 17 00:00:00 2001
From: Steve Vinoski 
Date: Sun, 1 Mar 2015 12:33:20 -0500
Subject: Ensure NIF term creation disallows illegal values

Add a check to enif_make_double to see if its double argument is
infinity or NaN, returning a badarg exception if it is. Change the
erl_nif documentation to specify that enif_make_double returns a
badarg exception if its double argument is either infinity or NaN. Add
tests to nif_SUITE for this change.

Add checks to the enif_make* functions for atoms to prevent the
creation of atoms whose name lengths are greater than the allowed
maximum atom length. The enif_make_atom and enif_make_atom_len
functions now return a badarg exception if the input string is too
long. The enif_make_existing_atom and enif_make_existing_atom_len
functions return false if the input string is too long. Change the
erl_nif documentation to reflect the changes to these functions. Add
tests to nif_SUITE for these changes.

Add a field to ErlNifEnv to track that a NIF has raised an exception
via enif_make_badarg. If a NIF calls enif_make_badarg but then ignores
its return value and instead tries to return a non-exception term as
its return value, the runtime still raises a badarg. This is needed to
prevent enif_make_badarg values resulting from calls to
enif_make_double, enif_make_atom, or enif_make_atom_len from being
erroneously stored within other terms and returned from a NIF. Calling
enif_make_badarg but not returning its return value has been
documented as being illegal ever since enif_make_badarg was added, but
the runtime has not enforced it until now. Add tests for regular and
dirty NIFs to ensure that calls to enif_make_badarg result in badarg
exceptions even if a NIF fails to return the result of
enif_make_badarg as its return value. Add documentation to
enif_make_badarg to specify that calling it raises a badarg even if a
NIF ignores its return value.
---
 erts/doc/src/erl_nif.xml | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

(limited to 'erts/doc')

diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index 3de94be9ff..feba6daaa0 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -898,12 +898,14 @@ typedef enum {
     ERL_NIF_TERMenif_make_atom(ErlNifEnv* env, const char* name)
       Create an atom term
       

Create an atom term from the null-terminated C-string name - with iso-latin-1 encoding.

+ with iso-latin-1 encoding. If the length of name exceeds the maximum length + allowed for an atom, enif_make_atom returns a badarg exception.

ERL_NIF_TERMenif_make_atom_len(ErlNifEnv* env, const char* name, size_t len) Create an atom term

Create an atom term from the string name with length len. - Null-characters are treated as any other characters.

+ Null-characters are treated as any other characters. If len is greater than the maximum length + allowed for an atom, enif_make_atom returns a badarg exception.

ERL_NIF_TERMenif_make_badarg(ErlNifEnv* env) Make a badarg exception. @@ -911,8 +913,10 @@ typedef enum { an associated exception reason in env. If enif_make_badarg is called, the term it returns must be returned from the function that called it. No other return value - is allowed. Also, the term returned from enif_make_badarg may - be passed only to + is allowed. Once a NIF or any function it calls invokes enif_make_badarg, + the runtime ensures that a badarg exception is raised when the NIF + returns, even if the NIF attempts to return a non-exception term instead. + Also, the term returned from enif_make_badarg may be passed only to enif_is_exception and not to any other NIF API function.

@@ -931,7 +935,9 @@ typedef enum { ERL_NIF_TERMenif_make_double(ErlNifEnv* env, double d) Create a floating-point term -

Create a floating-point term from a double.

+

Create a floating-point term from a double. If the double argument is + not finite or is NaN, enif_make_double returns a badarg exception.

+
intenif_make_existing_atom(ErlNifEnv* env, const char* name, ERL_NIF_TERM* atom, ErlNifCharEncoding encode) Create an existing atom term @@ -939,7 +945,8 @@ typedef enum { the null-terminated C-string name with encoding encode. If the atom already exists store the term in *atom and return true, otherwise - return false.

+ return false. If the length of name exceeds the maximum length + allowed for an atom, enif_make_existing_atom returns false.

intenif_make_existing_atom_len(ErlNifEnv* env, const char* name, size_t len, ERL_NIF_TERM* atom, ErlNifCharEncoding encoding) Create an existing atom term @@ -947,7 +954,9 @@ typedef enum { string name with length len and encoding encode. Null-characters are treated as any other characters. If the atom already exists store the term - in *atom and return true, otherwise return false.

+ in *atom and return true, otherwise return false. If len is greater + than the maximum length allowed for an atom, enif_make_existing_atom_len + returns false.

ERL_NIF_TERMenif_make_int(ErlNifEnv* env, int i) Create an integer term -- cgit v1.2.3 From 6487aac5977cf470bc6a2cd0964da2850ee38717 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 30 Oct 2014 23:57:01 +0100 Subject: Introduce a new time API The old time API is based on erlang:now/0. The major issue with erlang:now/0 is that it was intended to be used for so many unrelated things. This tied these unrelated operations together and unnecessarily caused performance, scalability as well as accuracy, and precision issues for operations that do not need to have such issues. The new API spreads different functionality over multiple functions in order to improve on this. The new API consists of a number of new BIFs: - erlang:convert_time_unit/3 - erlang:monotonic_time/0 - erlang:monotonic_time/1 - erlang:system_time/0 - erlang:system_time/1 - erlang:time_offset/0 - erlang:time_offset/1 - erlang:timestamp/0 - erlang:unique_integer/0 - erlang:unique_integer/1 - os:system_time/0 - os:system_time/1 and a number of extensions of existing BIFs: - erlang:monitor(time_offset, clock_service) - erlang:system_flag(time_offset, finalize) - erlang:system_info(os_monotonic_time_source) - erlang:system_info(time_offset) - erlang:system_info(time_warp_mode) - erlang:system_info(time_correction) - erlang:system_info(start_time) See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information. --- erts/doc/src/Makefile | 2 + erts/doc/src/erl.xml | 47 +- erts/doc/src/erlang.xml | 775 +++++++++++++++++++++++++++----- erts/doc/src/time_correction.xml | 923 +++++++++++++++++++++++++++++++-------- 4 files changed, 1447 insertions(+), 300 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index e8b856c3ff..a83aa9b875 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -177,6 +177,8 @@ release_docs_spec: docs $(INSTALL_DIR) "$(RELSYSDIR)/doc/html" $(INSTALL_DATA) $(HTMLDIR)/* \ "$(RELSYSDIR)/doc/html" + $(INSTALL_DATA) $(ERL_TOP)/erts/example/time_compat.erl \ + "$(RELSYSDIR)/doc/html" $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)" $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3" $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3" diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index d11f6b0c6d..19a8e1f789 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -495,24 +495,35 @@ , not (). Note also that is used instead of on Windows.

- - -

Disable compensation for sudden changes of system time.

-

Normally, will not immediately reflect - sudden changes in the system time, in order to keep timers - (including ) working. Instead, the time - maintained by is slowly adjusted towards - the new system time. (Slowly means in one percent adjustments; - if the time is off by one minute, the time will be adjusted - in 100 minutes.)

-

When the option is given, this slow adjustment - will not take place. Instead will always - reflect the current system time. Note that timers are based - on . If the system time jumps, timers - then time out at the wrong time.

-

NOTE: You can check whether the adjustment is enabled or - disabled by calling - erlang:system_info(tolerant_timeofday).

+ + +

Enable or disable + time correction:

+ + true +

Enable time correction. This is the default if + time correction is supported on the specific platform.

+ + false +

Disable time correction.

+
+

For backwards compatibility, the boolean value can be omitted. + This is interpreted as +c false. +

+
+ + +

Set + time warp mode: +

+ + no_time_warp +

No Time Warp Mode (the default)

+ single_time_warp +

Single Time Warp Mode

+ multi_time_warp +

Multi Time Warp Mode

+
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 483d81cfb6..3cbfd372ce 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -58,7 +58,71 @@ -

See now/0.

+

See erlang:timestamp/0.

+
+
+ + + +

Currently supported time unit representations:

+ + PartsPerSecond :: integer() >= 1 +

Time unit expressed in parts per second. That is, + the time unit equals 1/PartsPerSecond second.

+ + seconds +

Symbolic representation of the time unit + represented by the integer 1.

+ + milli_seconds +

Symbolic representation of the time unit + represented by the integer 1000.

+ + micro_seconds +

Symbolic representation of the time unit + represented by the integer 1000000.

+ + nano_seconds +

Symbolic representation of the time unit + represented by the integer 1000000000.

+ + native +

Symbolic representation of the native time unit + used by the Erlang runtime system.

+ +

The native time unit is determined at + runtime system start, and will remain the same until + the runtime system terminates. If a runtime system + is stopped and then started again (even on the same + machine), the native time unit of the new + runtime system instance may differ from the + native time unit of the old runtime system + instance.

+ +

One can get an approximation of the native + time unit by calling erlang:convert_time_unit(1, + seconds, native). The result equals the number + of whole native time units per second. In case + the number of native time units per second does + not add up to a whole number, the result will be + rounded downwards.

+ + +

The value of the native time unit gives + you more or less no information at all about the + quality of time values. It sets an upper bound for + the resolution as well as for the precision, but it + gives absolutely no information at all about the + accuracy.

+
+
+ +
+ +

The time_unit/0 type may be extended. Use + erlang:convert_time_unit/3 + in order to convert time values between time units.

+
@@ -584,6 +648,22 @@
+ + + Convert time unit of a time value + +

Converts the Time value of time unit + FromUnit to the corresponding + ConvertedTime value of time unit + ToUnit. The result is rounded + using the floor function.

+ +

You may lose accuracy and precision when converting + between time units. In order to minimize such loss, collect all + data at native time unit and do the conversion on the end + result.

+
+
Compute crc32 (IEEE 802.3) checksum @@ -2191,14 +2271,15 @@ os_prompt%
- Return an almost unique reference + Return a unique reference -

Returns an almost unique reference.

-

The returned reference will re-occur after approximately 2^82 - calls; therefore it is unique enough for practical purposes.

-
-> make_ref().
-#Ref<0.0.0.135>
+

Return a unique + reference. The reference is unique among + connected nodes.

+

Known issue: When a node is restarted multiple + times with the same node name, references created + on a newer node can be mistaken for a reference + created on an older node with the same node name.

@@ -2499,97 +2580,178 @@ os_prompt% - + + + + + Start monitoring -

The calling process starts monitoring Item which is - an object of type Type.

-

Currently only processes can be monitored, i.e. the only - allowed Type is process, but other types may be - allowed in the future.

-

Item can be:

- - pid() - -

The pid of the process to monitor.

-
- {RegName, Node} - -

A tuple consisting of a registered name of a process and - a node name. The process residing on the node Node - with the registered name RegName will be monitored.

-
- RegName - -

The process locally registered as RegName will be - monitored.

-
-
- -

When a process is monitored by registered name, the process - that has the registered name at the time when - monitor/2 is called will be monitored. +

Send a monitor request of type Type to the + entity identified by Item. The caller of + monitor/2 will later be notified by a monitor message on the + following format if the monitored state is changed:

+ {Tag, MonitorRef, Type, Object, Info} +

The monitor request is an asynchronous signal. That is, it + takes time before the signal reach its destination.

+

Currently valid Types:

+ + process + +

Monitor the existence of the process identified by + Item. Currently valid + Items in combination with the + process Type:

+ + pid() + +

The process identifier of the process to monitor.

+
+ {RegisteredName, Node} + +

A tuple consisting of a registered name of a process and + a node name. The process residing on the node Node + with the registered name {RegisteredName, Node} will + be monitored.

+
+ RegisteredName + +

The process locally registered as RegisteredName + will become monitored.

+
+
+

When a process is monitored by registered name, the + process that has the registered name at the time when the + monitor request reach its destination will be monitored. The monitor will not be effected, if the registered name is - unregistered.

-
-

A 'DOWN' message will be sent to the monitoring - process if Item dies, if Item does not exist, - or if the connection is lost to the node which Item - resides on. A 'DOWN' message has the following pattern:

- -{'DOWN', MonitorRef, Type, Object, Info} -

where MonitorRef and Type are the same as - described above, and:

- - Object - -

A reference to the monitored object:

- - the pid of the monitored process, if Item was - specified as a pid. - {RegName, Node}, if Item was specified as - {RegName, Node}. - {RegName, Node}, if Item was specified as - RegName. Node will in this case be the - name of the local node (node()). - -
- Info - -

Either the exit reason of the process, noproc - (non-existing process), or noconnection (no - connection to Node).

-
-
- -

If/when monitor/2 is extended (e.g. to - handle other item types than process), other - possible values for Object, and Info in the - 'DOWN' message will be introduced.

-
-

The monitoring is turned off either when the 'DOWN' - message is sent, or when - demonitor/1 - is called.

-

If an attempt is made to monitor a process on an older node - (where remote process monitoring is not implemented or one - where remote process monitoring by registered name is not - implemented), the call fails with badarg.

-

Making several calls to monitor/2 for the same - Item is not an error; it results in as many, completely - independent, monitorings.

+ unregistered, or unregistered and later registered on another + process.

+

The monitor is triggered either when the monitored process + terminates, is non existing, or if the connection to it is + lost. In the case the connection to it is lost, we do not know + if it still exist or not. After this type of monitor has been + triggered, the monitor is automatically removed.

+

When the monitor is triggered a 'DOWN' message will + be sent to the monitoring process. A 'DOWN' message has + the following pattern:

+ {'DOWN', MonitorRef, Type, Object, Info} +

where MonitorRef and Type are the same as + described above, and:

+ + Object + +

equals:

+ + Item + If Item was specified by a + pid. + {RegisteredName, Node} + If Item was specified as + RegisteredName, or {RegisteredName, Node} + where Node corresponds to the node that the + monitored process resides on. + +
+ Info + +

Either the exit reason of the process, noproc + (non-existing process), or noconnection (no + connection to the node where the monitored process + resides).

+
+

The monitoring is turned off either when the 'DOWN' + message is sent, or when + demonitor/1 + is called.

+

If an attempt is made to monitor a process on an older node + (where remote process monitoring is not implemented or one + where remote process monitoring by registered name is not + implemented), the call fails with badarg.

+ +

The format of the 'DOWN' message changed in the 5.2 + version of the emulator (OTP release R9B) for monitor + by registered name. The Object element of + the 'DOWN' message could in earlier versions + sometimes be the pid of the monitored process and sometimes + be the registered name. Now the Object element is + always a tuple consisting of the registered name and + the node name. Processes on new nodes (emulator version 5.2 + or greater) will always get 'DOWN' messages on + the new format even if they are monitoring processes on old + nodes. Processes on old nodes will always get 'DOWN' + messages on the old format.

+
+ + time_offset + +

Monitor changes in + time offset + between + Erlang + monotonic time and + Erlang + system time. There is only one valid + Item in combination with the + time_offset Type, namely the atom + clock_service. Note that the atom clock_service is + not the registered name of a process. In this specific + case it serves as an identifier of the runtime system internal + clock service at current runtime system instance.

+ +

The monitor is triggered when the time offset is changed. + This either if the time offset value is changed, or if the + offset is changed from preliminary to final during + finalization + of the time offset when the + single + time warp mode is used. When a change from preliminary + to final time offset is made, the monitor will be triggered once + regardless of whether the time offset value was changed due to + the finalization or not.

+ +

If the runtime system is in + multi + time warp mode, the time offset will be changed when + the runtime system detects that the + OS system + time has changed. The runtime system will, however, + not detect this immediately when it happens. A task checking + the time offset is scheduled to execute at least once a minute, + so under normal operation this should be detected within a + minute, but during heavy load it might take longer time.

+ +

The monitor will not be automatically removed + after it has been triggered. That is, repeated changes of + the time offset will trigger the monitor repeatedly.

+ +

When the monitor is triggered a 'CHANGE' message will + be sent to the monitoring process. A 'CHANGE' message has + the following pattern:

+ {'CHANGE', MonitorRef, Type, Item, NewTimeOffset} +

where MonitorRef, Type, and + Item are the same as described above, and + NewTimeOffset is the new time offset.

+ +

When the 'CHANGE' message has been received you are + guaranteed not to retrieve the old time offset when calling + erlang:time_offset(). + Note that you may observe the change of the time offset + when calling erlang:time_offset() before you + get the 'CHANGE' message.

+ +
+ +

Making several calls to monitor/2 for the same + Item and/or Type is not + an error; it results in many, completely independent, + monitorings.

+

The monitor functionality is expected to be extended. That is, + other Types and Items + are expected to be supported in the future.

-

The format of the 'DOWN' message changed in the 5.2 - version of the emulator (OTP release R9B) for monitor by registered name. The Object element of - the 'DOWN' message could in earlier versions - sometimes be the pid of the monitored process and sometimes - be the registered name. Now the Object element is - always a tuple consisting of the registered name and - the node name. Processes on new nodes (emulator version 5.2 - or greater) will always get 'DOWN' messages on - the new format even if they are monitoring processes on old - nodes. Processes on old nodes will always get 'DOWN' - messages on the old format.

+

If/when monitor/2 is extended, other + possible values for Tag, Object, and + Info in the monitor message will be introduced.

@@ -2639,6 +2801,51 @@ os_prompt% option list is malformed.

+ + + Current Erlang monotonic time + +

Returns the current + Erlang + monotonic time in native + time unit. This + is a monotonically increasing time since some unspecified point in + time.

+ +

This is a + monotonically increasing time, but not a + strictly monotonically increasing + time. That is, consecutive calls to + erlang:monotonic_time/0 may produce the same result.

+ +

Different runtime system instances will use different + unspecified points in time as base for their Erlang monotonic clocks. + That is, it is pointless comparing monotonic times from + different runtime system instances. Different runtime system instances + may also place this unspecified point in time different relative + runtime system start. It may be placed in the future (time at start + will be a negative value), the past (time at start will be a + positive value), or the runtime system start (time at start will + be zero). The monotonic time as of runtime system start can be + retrieved by calling + erlang:system_info(start_time).

+
+
+ + + Current Erlang monotonic time + +

Returns the current + Erlang + monotonic time converted + into the Unit passed as argument.

+ +

Same as calling + erlang:convert_time_unit(erlang:monotonic_time(), + native, Unit) + however optimized for commonly used Units.

+
+
Stop execution with a given reason @@ -2734,6 +2941,13 @@ os_prompt% Elapsed time since 00:00 GMT +

This function is deprecated! Do not use it! + See the users guide chapter + Time and Time Correction + for more information. Specifically the + Dos and Dont's + section for information on what to use instead of erlang:now/0. +

Returns the tuple {MegaSecs, Secs, MicroSecs} which is the elapsed time since 00:00 GMT, January 1, 1970 (zero hour) on the assumption that the underlying OS supports this. @@ -2746,10 +2960,6 @@ os_prompt%

It can only be used to check the local time of day if the time-zone info of the underlying operating system is properly configured.

-

If you do not need the return value to be unique and - monotonically increasing, use - os:timestamp/0 - instead to avoid some overhead.

@@ -5496,6 +5706,35 @@ ok

Returns the old value of the flag.

+ + + + Finalize the Time Offset + +

Finalizes the time offset + when the single + time warp mode is being used. If another time warp mode than + the "single time warp mode" is used, the time offset state will be left + unchanged.

+

Returns the old state identifier. That is, if:

+ +

preliminary is returned, finalization was + performed and the time offset is now final.

+ +

final is returned, the time offset was + already in the final state. This either due to another + erlang:system_flag(time_offset, finalize) call, or + due to the + no + time warp mode being used.

+ +

volatile is returned, the time offset + cannot be finalized due to the + multi + time warp mode being used.

+
+
+
@@ -5776,6 +6015,15 @@ ok + + + + + + + + + Information about the system

Returns various information about the current system @@ -6163,6 +6411,57 @@ ok documentation of versions in the system principles guide.

+ os_monotonic_time_source + +

Returns a list containing information about the source of + OS + monotonic time that is used by the runtime system.

+

In case [] is returned, no OS monotonic time is + available. The list contains two-tuples with Keys + as first element, and Values as second element. The + order if these tuples is undefined. Currently the following + tuples may be part of the list, but more tuples may be + introduced in the future:

+ + {function, Function} +

Function is the name of the funcion + used. This tuple always exist if OS monotonic time is + available to the runtime system.

+ + {clock_id, ClockId} +

This tuple only exist if Function + can be used with different clocks. ClockId + corresponds to the clock identifer used when calling + Function.

+ + {resolution, OsMonotonicTimeResolution} +

Highest possible resolution of current + OS monotonic time source as parts per second. If + no resolution information can be retreived from + the OS, OsMonotonicTimeResolution will be + set to the resolution of the time unit of + Functions return value. That is, the actual + resolution may be lower than + OsMonotonicTimeResolution. Also note that + the resolution does not say anything about the + accuracy, and that the precision might not align + with the resolution. You do, however, know that the + precision won't be higher than + OsMonotonicTimeResolution.

+ + {parallel, Parallel} +

Parallel equals yes if + Function is called in parallel from multiple + threads. If it is not called in parallel, because + calls needs to be serialized, Parallel equals + no.

+ + {time, OsMonotonicTime} +

OsMonotonicTime equals current OS + monotonic time in native + time unit.

+
+
port_parallelism

Returns the default port parallelism scheduling hint used. For more information see the @@ -6288,6 +6587,11 @@ ok

Returns true if the emulator has been compiled with smp support; otherwise, false.

+ start_time +

The Erlang monotonic + time in native + time unit at the + time when current Erlang runtime system instance started.

system_version

Returns a string containing version number and @@ -6311,12 +6615,64 @@ ok (driver_async()) as an integer.

+ time_correction +

Returns a boolean value indicating whether + time correction + is enabled or not. +

+ time_offset +

Returns the state of the time offset:

+ + preliminary +

The time offset is preliminary, and will be changed + at a later time when being finalized. The preliminary time offset + is used during the preliminary phase of the + single + time warp mode.

+ + final +

The time offset is final. This + either due to the use of the + no + time warp mode, or due to the time offset having + been finalized when using the + single + time warp mode.

+ + volatile +

The time offset is volatile. That is, it may + change at any time. This due to the + multi + time warp mode being used.

+
+
+ time_warp_mode +

Returns a value identifying the + time warp + mode being used:

+ + no_time_warp +

The no + time warp mode is being used.

+ + single_time_warp +

The single + time warp mode is being used.

+ + multi_time_warp +

The multi + time warp mode is being used.

+
+
tolerant_timeofday -

Returns whether compensation for sudden changes of system - time is enabled or disabled.

-

See also +c - command line flag.

+

Returns whether a pre erts-7.0 backwards compatible compensation + for sudden changes of system time is enabled or disabled. + Such compensation is enabled when the + time offset is + final, and + time correction + is enabled.

trace_control_word @@ -6595,7 +6951,44 @@ ok
+ + + Current Erlang system time + +

Returns current + Erlang system time + in native + time unit.

+

Calling erlang:system_time() is equivalent to: + erlang:monotonic_time() + + + erlang:time_offset().

+ +

This time is not a monotonically increasing time + in the general case. For more information, see the documentation of + time warp modes in the + ERTS User's Guide.

+
+
+ + + Current Erlang system time + +

Returns current + Erlang system time + converted into the Unit passed as argument.

+ +

Calling erlang:system_time(Unit) is equivalent to: + erlang:convert_time_unit(erlang:system_time(), + native, Unit).

+ +

This time is not a monotonically increasing time + in the general case. For more information, see the documentation of + time warp modes in the + ERTS User's Guide.

+
+
Encode a term to an Erlang external term format binary @@ -6671,6 +7064,88 @@ ok {9,42,44} + + + Current time offset + +

Returns the current time offset between + Erlang monotonic time + and + Erlang system time in + native time unit. + Current time offset added to an Erlang monotonic time gives + corresponding Erlang system time.

+ +

The time offset may or may not change during operation depending + on the time + warp mode used.

+ + +

A change in time offset may be observed at slightly + different points in time by different processes.

+ +

If the runtime system is in + multi + time warp mode, the time offset will be changed when + the runtime system detects that the + OS system + time has changed. The runtime system will, however, + not detect this immediately when it happens. A task checking + the time offset is scheduled to execute at least once a minute, + so under normal operation this should be detected within a + minute, but during heavy load it might take longer time.

+
+
+
+ + + Current time offset + +

Returns the current time offset between + Erlang monotonic time + and + Erlang system time + converted into the Unit passed as argument.

+ +

Same as calling + erlang:convert_time_unit(erlang:time_offset(), native, Unit) + however optimized for commonly used Units.

+
+
+ + + + Current Erlang System time + +

Returns current + Erlang system time + on the format {MegaSecs, Secs, MicroSecs}. This format is + the same that os:timestamp/0 + and the now deprecated erlang:now/0 + uses. The reason for the existence of erlang:timestamp() is + purely to simplify usage for existing code that assumes this timestamp + format. Current Erlang system time can more efficiently be retrieved in + the time unit of your choice using + erlang:system_time/1.

+ +

The erlang:timestamp() BIF is equivalent to:

+timestamp() -> + ErlangSystemTime = erlang:system_time(micro_seconds), + MegaSecs = ErlangSystemTime div 1000000000000, + Secs = ErlangSystemTime div 1000000 - MegaSecs*1000000, + MicroSecs = ErlangSystemTime rem 1000000, + {MegaSecs, Secs, MicroSecs}. +

It however use a native implementation which does + not build garbage on the heap and with slightly better + performance.

+ +

This time is not a monotonically increasing time + in the general case. For more information, see the documentation of + time warp modes in the + ERTS User's Guide.

+
+ +
Tail of a list @@ -7435,6 +7910,100 @@ ok a valid date and time.

+ + + Get a unique integer value + +

Generates and returns an + integer + unique on current runtime system instance. The same as calling + erlang:unique_integer([]).

+
+
+ + + Get a unique integer value + +

Generates and returns an + integer + unique on current runtime system + instance. The integer is unique in the + sense that this BIF, using the same set of + modifiers, will not return the same integer more + than once on the current runtime system instance. + Each integer value can of course be constructed + by other means.

+ +

By default, i.e. when [] is passed as + ModifierList, both negative and + positive integers will be returned. This is order + to be able to utilize the range of integers that do + not need to be heap allocated as much as possible. + By default the returned integers are also only + guaranteed to be unique, i.e., any integer returned + may be either smaller, or larger than previously + returned integers.

+ +

Currently valid Modifiers:

+ + + positive +

Return only positive integers.

+

Note that by passing the positive modifier + you will get heap allocated integers (big-nums) + quicker.

+
+ + monotonic +

Return + strictly + monotonically increasing integers + corresponding to creation time. That is, the integer + returned will always be larger than previously + returned integers on the current runtime system + instance.

+

These values can be used when ordering events + on the runtime system instance. That is, if both + X = erlang:unique_integer([monotonic]) and + Y = erlang:unique_integer([monotonic]) are + executed by different processes (or the same + process) on the same runtime system instance and + X < Y we know that X was created + before Y.

+

Strictly monotonically increasing values + are inherently quite expensive to generate and scales + poorly. This since the values needs to be + synchronized. That is, do not pass the monotonic + modifier unless you really need strictly monotonically + increasing values.

+
+ +
+ +

All currently valid Modifiers + can be combined. Repeated (valid) + Modifiers in the ModifierList + are ignored.

+ +

Note that the set of integers returned by + unique_integer/1 using diffrent sets of + Modifiers will overlap. + For example, by calling unique_integer([monotonic]), + and unique_integer([positive, monotonic]) + repeatedly, you will eventually see some integers being + returned by both calls.

+ +

Failures:

+ + badarg + if ModifierList is not a + proper list. + badarg + if Modifier is not a + valid modifier. + +
+
Remove a link, if there is one, to another process or port diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index 7f7c28fc30..3bc3d04186 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -21,8 +21,8 @@ - Time and time correction in Erlang - Patrik Nyblom + Time and Time Correction in Erlang + @@ -31,6 +31,176 @@ PA1 time_correction.xml
+ +
+ New Extended Time Functionality +

As of OTP 18 (ERTS version 7.0) the time functionality of + Erlang has been extended. This both includes a + new API + for time, as well as + time warp + modes which alters the behavior of the system when + system time changes.

+

The default + time warp mode has the same behavior as before, and the + old API will still work, so you are not required to change + anything unless you want to. However, you are strongly + encouraged to use the new API instead of the old API based + on erlang:now/0. + erlang:now/0 has been deprecated since it is and forever + will be a scalability bottleneck. By using the new API you will + automatically get scalability and performance improvements. This + will also enable you to use the + multi time warp mode + which improves accuracy, and precision of time measurements.

+
+ +
+ Some Terminology +

In order to make it easier to understand this document we first + define some terminology. This is a mixture of our own terminology + (Erlang/OS system time, Erlang/OS monotonic time, time warp) + and globally accepted terminology.

+ + +
+ Monotonically Increasing +

In a monotonically increasing sequence of values, all values + that have a predecessor are either larger than, or equal to its + predecessor.

+
+ + +
+ Strictly Monotonically Increasing +

In a strictly monotonically increasing sequence of values, + all values that have a predecessor are larger than its + predecessor.

+
+ + +
+ UT1 +

Universal Time. Based on the rotation of the earth. Conceptually + mean solar time at 0° longitude.

+
+ + +
+ UTC +

Coordinated Universal Time. UTC almost align with + UT1, however, UTC uses the + SI definition of a second which is not exactly of the same length + as the second used by UT1. This means that UTC slowly drifts from + UT1. In order to keep UTC relatively in sync with UT1, leap seconds + are inserted, and potentially also deleted. That is, an UTC day may + be 86400, 86401, or 86399 seconds long.

+
+ + +
+ POSIX Time +

Time since + Epoch. + Epoch is defined to be 00:00:00 UTC, + January 1, 1970. + A day in POSIX time + is defined to be exactly 86400 seconds long. Strangely enough + Epoch is defined to be a time in UTC, and UTC have another + definition of how long a day is. Quoting the Open Group + "POSIX time is therefore not necessarily UTC, despite its appearance". The effect of this is that when an UTC leap second is + inserted, POSIX time either stops for a second, or repeats the + last second. If an UTC leap second would be deleted (has never + happened yet), POSIX time would make a one second leap forward.

+
+ + +
+ OS System Time +

The operating systems view of + POSIX time. It can be + retrieved by calling + os:system_time(). + This may or may not be an accurate view of POSIX time. This time + may typically be adjusted both backwards and forwards without + limitation. That is, huge leaps both backwards and forwards in time + may be observed.

+
+ + +
+ OS Monotonic Time +

A monotonically increasing time provided by the operating + system. This time does not leap and have a relatively steady + frequency although not completely correct. However, it is not + uncommon that the OS monotonic time stops if the system is + suspended. This time typically increase since some unspecified + point in time that is not connected to + OS system time. Note that + this type of time is not necessarily provided by all operating + systems.

+
+ + +
+ Erlang System Time +

The Erlang runtime systems view of + POSIX time. It can be + retrieved by calling + erlang:system_time(). + This time may or may not be an accurate view of POSIX time, and may + or may not align with OS system + time. The time + warp mode determines how it behaves when OS system + time suddenly change.

+
+ + +
+ Erlang Monotonic Time +

A monotonically increasing time provided by the + Erlang runtime system. The Erlang monotonic time increase since + some unspecified point in time. It can be retrieved by calling + erlang:monotonic_time(). + The accuracy, and precision of Erlang monotonic time heavily + depends on the accuracy and precision of + OS monotonic time, + the accuracy and precision of + OS system time as well + as on the + time warp mode + used. On a system that is lacking OS monotonic time, the Erlang + monotonic time can only guarantee monotonicity and can more or less + not give any other guarantees. The frequency adjustments made to + the Erlang monotonic time depends on the time warp mode + used.

+ +

Internally in the runtime system the Erlang monotonic + time is the "time engine" that is used for more or less + everything that has anything to do with time. All timers + regardless of it is a receive ... after timer, BIF timer, + or a timer in the timer module are triggered + relative Erlang monotonic time. Even + Erlang system + time is based on Erlang monotonic time. + By adding current Erlang monotonic time with current time + offset you get current Erlang system time. Current time + offset can be retrieved by calling + erlang:time_offset/0. +

+
+ + +
+ Time Warp +

A time warp is a leap forwards or backwards in time.

+
+ +
+ +
+ Introduction +

Time is vital to an Erlang program and, more importantly, correct time is vital to an Erlang program. As Erlang is a language with soft real time properties and we have the possibility to express @@ -83,192 +253,587 @@ microsecond resolution or much less, but generally it has a drift that is not to be ignored.

-

So we have this monotonic ticking and we have the wall clock - time. Two unreliable times that together can give us an estimate of - an actual wall clock time that does not jump around and that - monotonically moves forward. If the tick counter has a high - resolution, this is fairly easy to do, if the counter has a low - resolution, it's more expensive, but still doable down to - frequencies of 50-60 Hz (of the tick counter).

- -

So the corrected time is the nearest approximation of an atomic - clock that is available on the computer. We want it to have the - following properties:

- - Monotonic - The clock should not move backwards - Intervals should be near the truth - We want the actual time (as measured by an atomic clock or - an astronomer) that passes between two time stamps, T1 and T2, to be as - near to T2 - T1 as possible. - Tight coupling to the wall clock - We want a timer that is to be fired when the wall clock - reaches a time in the future, to fire as near to that point in - time as possible - -

To meet all the criteria, we have to utilize both times in such a - way that Erlangs "corrected time" moves slightly slower or slightly - faster than the wall clock to get in sync with it. The word - "slightly" means a maximum of 1% difference to the wall clock time, - meaning that a sudden change in the wall clock of one minute, takes - 100 minutes to fix, by letting all "corrected time" move 1% slower - or faster.

- -

Needless to say, correcting for a faulty handling of daylight - saving time may be disturbing to a user comparing wall clock - time to for example calendar:now_to_local_time(erlang:now()). But - calendar:now_to_local_time/1 is not supposed to be used for presenting wall - clock time to the user.

- -

Time correction is not perfect, but it saves you from the havoc - of clocks jumping around, which would make timers in your program - fire far to late or far to early and could bring your whole system - to it's knees (or worse) just because someone detected a small error - in the wall clock time of the server where your program runs. So - while it might be confusing, it is still a really good feature of - Erlang and you should not throw it away using time functions which - may give you higher benchmark results, not unless you really know - what you're doing.

+
+
- What does time correction mean in my system? -

Time correction means that Erlang estimates a time from current - and previous settings of the wall clock, and it uses a fairly - exact tick counter to detect when the wall clock time has jumped - for some reason, slowly adjusting to the new value.

- -

In practice, this means that the difference between two calls - to time corrected functions, like erlang:now(), might differ up to - one percent from the corresponding calls to non time corrected - functions (like os:timestamp()). Furthermore, if comparing - calendar:local_time/0 to calendar:now_to_local_time(erlang:now()), - you might temporarily see a difference, depending on how well kept your - system is.

- -

It is important to understand that it is (to the program) - always unknown if it is the wall clock time that moves in the - wrong pace or the Erlang corrected time. The only way to determine - that, is to have an external source of universally correct time. If - some such source is available, the wall clock time can be kept - nearly perfect at all times, and no significant difference will be - detected between erlang:now/0's pace and the wall clock's.

- -

Still, the time correction will mean that your system keeps - it's real time characteristics very well, even when the wall clock - is unreliable.

+ Time Correction +

If time correction is enabled, the Erlang runtime system + will make use of both + OS system time + and OS monotonic time, + in order to make adjustments of the frequency of the Erlang + monotonic clock. Time correction will ensure that + Erlang monotonic time + will not warp, and that the frequency is relatively accurate. + The type of adjustments made to the frequency depends on the + time warp mode used. This will be discussed in more details in + the time warp modes + section below.

+ +

By default time correction will be enabled if support for + it on the specific platform exist. Support for it includes + both an OS monotonic time provided by the OS, and an + implementation in the Erlang runtime system utilizing the + OS monotonic time. You can check if your system has support + for OS monotonic time by calling + erlang:system_info(os_monotonic_time_source), + and you can check if time correction is enabled on your + system by calling + erlang:system_info(time_correction).

+ +

Time correction is enabled or disabled by passing the + +c [true|false] + command line argument to erl.

+ +

If time correction is disabled, Erlang monotonic time + may warp forwards, it may stop and even freeze for extended + periods of time, and there are no guarantees that the frequency + of the Erlang monotonic clock is accurate or stable.

+ +

You typically never want to disable time correction. + Previously there was a performance penalty associated with time + correction, but nowadays it is most often the other way around. + By disabling time correction you are likely to get bad scalability, + bad performance, and bad time measurements.

+ + +
- Where does Erlang use corrected time? -

For all functionality where real time characteristics are - desirable, time correction is used. This basically means:

- - erlang:now/0 - The infamous erlang:now/0 function uses time correction so - that differences between two "now-timestamps" will correspond to - other timeouts in the system. erlang:now/0 also holds other - properties, discussed later. - receive ... after - Timeouts on receive uses time correction to determine a - stable timeout interval. - The timer module - As the timer module uses other built in functions which - deliver corrected time, the timer module itself works with - corrected time. - erlang:start_timer/3 and erlang:send_after/3 - The timer BIF's work with corrected time, so that they - will not fire prematurely or too late due to changes in the wall - clock time. - - -

All other functionality in the system where erlang:now/0 or any - other time corrected functionality is used, will of course - automatically benefit from it, as long as it's not "optimized" to - use some other time stamp function (like os:timestamp/0).

- -

Modules like calendar and functions like erlang:localtime/0 use - the wall clock time as it is currently set on the system. They - will not use corrected time. However, if you use a now-value and - convert it to local time, you will get a corrected local time - value, which may or may not be what you want. Typically older code - tend to use erlang:now/0 as a wall clock time, which is usually - correct (at least when testing), but might surprise you when - compared to other times in the system.

+ Time Warp Safe Code +

Time warp safe code is code that is able to handle + a time warp of + Erlang system time. +

+ +

erlang:now/0 + behaves very bad when Erlang system time warps. When Erlang + system time do a time warp backwards, the values returned + from erlang:now/0 will freeze (if you disregard the + micro second increments made due to the actual call) until + OS system time reach the point of the last value returned by + erlang:now/0. This freeze might continue for very + long periods of time. It might take years, decades, + and even longer than this until the freeze stops.

+ +

All uses of erlang:now/0 are not necessarily + time warp unsafe. If you do not use it to get time, it + will be time warp safe. However all uses of + erlang:now/0 are suboptimal from a performance + and scalability perspective. So you really want to replace + the usage of it with other functionality. For examples + of how to replace the usage of erlang:now/0, + see the Dos and Donts + section.

+ +
- What is erlang:now/0 really? -

erlang:now/0 is a function designed to serve multiple purposes - (or a multi-headed beast if you're a VM designer). It is expected - to hold the following properties:

- - Monotonic - erlang:now() never jumps backwards - it always moves - forward - Interval correct - The interval between two erlang:now() calls is expected to - correspond to the correct time in real life (as defined by an - atomic clock, or better) - Absolute correctness - The erlang:now/0 value should be possible to convert to an - absolute and correct date-time, corresponding to the real world - date and time (the wall clock) - System correspondence - The erlang:now/0 value converted to a date-time is - expected to correspond to times given by other programs on the - system (or by functions like os:timestamp/0) - Unique - No two calls to erlang:now on one Erlang node should - return the same value - -

All these requirements are possible to uphold at the same - time if (and only if):

- - The wall clock time of the system is perfect - The system (Operating System) time needs to be perfectly - in sync with the actual time as defined by an atomic clock or - a better time source. A good installation using NTP, and that is - up to date before Erlang starts, will have properties that for - most users and programs will be near indistinguishable from the - perfect time. Note that any larger corrections to the time done - by hand, or after Erlang has started, will partly (or - temporarily) invalidate some of the properties, as the time is - no longer perfect. - Less than one call per microsecond to erlang:now/0 is - done - This means that at any microsecond interval in - time, there can be no more than one call to erlang:now/0 in the - system. However, for the system not to loose it's properties - completely, it's enough that it on average is no more than one - call per microsecond (in one Erlang node). - -

The uniqueness property of erlang:now/0 is the most limiting - property. It means that erlang:now() maintains a global state and - that there is a hard-to-check property of the system that needs to - be maintained. For most applications this is still not a problem, - but a future system might very well manage to violate the - frequency limit on the calls globally. The uniqueness property is - also quite useless, as there are globally unique references that - provide a much better unique value to programs. However the - property will need to be maintained unless a really subtle - backward compatibility issue is to be introduced.

+ Time Warp Modes + +

Current Erlang system + time is determined by adding current + Erlang monotonic time + with current + time offset. The + time offset is managed differently depending on which time + warp mode you use. The time warp mode is set by passing the + +C + [no_time_warp|single_time_warp|multi_time_warp] + command line argument to erl.

+ + +
+ No Time Warp Mode +

The time offset is determined at runtime system start + and will after this not change. This is the default behavior. + Not because it is the best mode (which it isn't). It is + default only because this is how the runtime system always + has behaved until ERTS version 7.0, and you have to ensure + that your Erlang code that may execute during a time warp is + time warp safe + before you can enable other modes.

+ +

Since the time offset is not allowed to change, time + correction needs to adjust the frequency of the Erlang + monotonic clock in order to smoothly align Erlang system + time with OS system time. A big downside of this approach + is that we on purpose will use a faulty frequency on the + Erlang monotonic clock if adjustments are needed. This + error may be as big as 1%. This error will show up in all + time measurements in the runtime system.

+ +

If time correction is not enabled, the Erlang monotonic + time will freeze when the OS system time leap backwards. + The freeze of the monotonic time will continue until + OS system time catch up. The freeze may continue for + a very long time. When OS system time leaps forwards, + Erlang monotonic time will also leap forward.

+
+ + +
+ Single Time Warp Mode +

This mode is more or less a backwards compatibility mode + as of its introduction.

+

On an embedded system it is not uncommon that the system + has no power supply at all, not even a battery, when it is + shut off. The system clock on such a system will typically + be way off when the system boots. If the + no time warp mode + is used, and the Erlang runtime system is started before + the OS system time has been corrected, the Erlang system + time may be wrong for a very long time, even centuries or + more.

+

If you for some reason need to use Erlang code that + is not + time warp safe, + and you need to start the Erlang runtime system before the OS + system time has been corrected, you may want to use the single + time warp mode. Note that there are limitations to when you can + execute time warp unsafe code using this mode. If it is possible + to only utilize time warp safe code, it is much better to use + the multi time warp + mode instead. +

+ +

Using the single time warp mode, the time offset is + handled in two phases:

+ + + Preliminary Phase + +

The preliminary phase starts when the runtime + system starts. A preliminary time offset based on + current OS system time is determined. This offset will + from now on be fixed during the whole preliminary phase.

+ +

If time correction is enabled, the Erlang + monotonic clock will only use the OS monotonic time as + time source during this phase. That is, during the + preliminary phase changes in OS system time will have + no effect on Erlang system time and/or Erlang + monotonic time what so ever.

+ +

If time correction is disabled, changes in OS system + time will effect the monotonic clock the same way as + when the no time warp + mode is used.

+
+ + Final Phase + + +

The final phase begin when the user finalize the time + offset by calling + erlang:system_flag(time_offset, finalize). + The finalization can only be performed once. +

+ +

During finalization, the time offset is adjusted and + fixated so that current Erlang system time align with + current OS system time. Since the time offset + may be changed, the Erlang system time may do + a time warp at this point. The time offset will from + now on be fixed until the runtime system terminates. + If time correction has been enabled, the time correction + also begins when this phase begins. When the system is + in the final phase it behaves exactly as in the + no time warp + mode.

+ +
+
+ +

In order for this to work properly there are two + requirements that the user needs to ensure are + satisfied:

+ + + Forward Time Warp +

The time warp made when finalizing the time offset + can only be done forwards without encountering problems. + This implies that the user has to ensure that the OS + system time is set to a time earlier or equal to actual + POSIX time before starting the Erlang runtime system. If + you are not completely sure the OS system time is correct, + set it to a time that is guaranteed to be earlier than + actual POSIX time before starting the Erlang runtime + system just to be safe.

+ + Finalize Correct OS System Time +

The OS system time needs to be correct when the + the user finalizes the time offset.

+
+ +

If these requirements are not fulfilled, the system + may behave very bad. +

+ +

Assuming that the requirements above are fulfilled, + time correction is enabled, and that the OS system time + is adjusted using some time adjustment protocol like NTP + or similar, only small adjustments of the Erlang monotonic + time should be needed in order to keep system times + aligned after finilization. As long as the system is not + suspended, the largest adjustments needed should be for + inserted (or deleted) leap seconds.

+ +

In order to be able to use this mode you have + to ensure that all Erlang code that will execute in + both phases are + time warp + safe.

+

Code that only execute in the final phase does not have + to be able to cope with the time warp.

+ +
+ + +
+ Multi Time Warp Mode + +

Multi time warp mode in combination with time + correction is the preferred configuration. This since, + on almost all platforms, the Erlang runtime system will have + better performance, will scale better, will behave better, + and since the accuracy, and precision of time measurements + will be better. Only Erlang runtime systems executing on + ancient platforms will benefit from another configuration.

+ +

The time offset may change at any time without limitations. + That is, Erlang system time may perform time warps both + forwards and backwards at any time. Since we align + the Erlang system time with the OS system time by changing + the time offset, we can enable a time correction that tries + to adjust the frequency of the Erlang monotonic clock to be as + correct as possible. This will make time measurements using + the Erlang monotonic time more accurate and precise.

+ +

If time correction is disabled, Erlang monotonic time + will leap forward if OS system time leaps forward. If the + OS system time leaps backwards, Erlang monotonic time will + stop briefly but it does not freeze for extended periods + of time. This since the time offset is changed in order to + align Erlang system time with OS system time.

+ +

In order to be able to use this mode you have + to ensure that all Erlang code that will execute on the + runtime system is + time warp + safe.

+
+ +
- Should I use erlang:now/0 or os:timestamp/0 -

The simple answer is to use erlang:now/0 for everything where - you want to keep real time characteristics, but use os:timestamp - for things like logs, user communication and debugging (typically - timer:ts uses os:timestamp, as it is a test tool, not a real world - application API). The benefit of using os:timestamp/0 is that it's - faster and does not involve any global state (unless the operating - system has one). The downside is that it will be vulnerable to wall - clock time changes.

+ The New Time API + +

The old time API is based on + erlang:now/0. + The major issue with erlang:now/0 is that it was + intended to be used for so many unrelated things. This + tied these unrelated operations together and unnecessarily + caused performance, scalability as well as accuracy, and + precision issues for operations that do not need to have + such issues. The new API spreads different functionality + over multiple functions in order to improve on this.

+ +

In order to be backwards compatible erlang:now/0 will + remain as is, but you are strongly discouraged from using + it. A lot of uses of erlang:now/0 will also + prevent you from using the new + multi time warp + mode which is an important part of this + new time functionality improvement.

+ +

Some of the new BIFs on some systems, perhaps surprisingly, + return negative integer values on a newly started run time + system. This is not a bug, but a memory usage optimization.

+ +

The new API consists of a number of new BIFs:

+ +

erlang:convert_time_unit/3

+

erlang:monotonic_time/0

+

erlang:monotonic_time/1

+

erlang:system_time/0

+

erlang:system_time/1

+

erlang:time_offset/0

+

erlang:time_offset/1

+

erlang:timestamp/0

+

erlang:unique_integer/0

+

erlang:unique_integer/1

+

os:system_time/0

+

os:system_time/1

+
+

and a number of extensions of existing BIFs:

+ +

erlang:monitor(time_offset, clock_service)

+

erlang:system_flag(time_offset, finalize)

+

erlang:system_info(os_monotonic_time_source)

+

erlang:system_info(time_offset)

+

erlang:system_info(time_warp_mode)

+

erlang:system_info(time_correction)

+

erlang:system_info(start_time)

+
+ + +
+ The New Erlang Monotonic Time +

The Erlang monotonic time as such is new as of ERTS + version 7.0. It has been introduced in order to be able + to detach time measurements such as elapsed time from + calender time. It is very common that one is interested + in measuring elapsed time or specifying a time relative + to another point in time without having any need to know + what the involved times are in UTC or any other + globally defined time scale. By introducing a time scale + that has a local definition of where it starts, it is + possible to manage time that do not concern calender + time on that time scale. Erlang monotonic time use + such a time scale with a locally defined start.

+ +

The introduction of Erlang monotonic time gives us + the possibility to adjust the two Erlang times (Erlang + monotonic time and Erlang system time) separately. By + doing this, accuracy of elapsed time does not have to + suffer just because the system time happened to be + wrong at some point in time. Separate adjustments + of the two times are only performed in the time warp + modes, and only fully separated in the + multi + time warp mode. All other modes than the + multi time warp mode are there for backwards + compatibility reasons, and when using these the + accuracy of Erlang monotonic time suffer since + the adjustments of Erlang monotonic time in these + modes are more or less tied to the Erlang system + time.

+ +

The adjustment of system time could have been made + smother than using a time warp approach, but we think + that would be a bad choice. Since we are able to + express and measure time that aren't connected to + calender time by the use of Erlang monotonic time, it + is better to expose the change in Erlang system time + immediately. This since it makes it possible for the + Erlang applications executing on the system to react + on the change in system time as soon as possible. This + is also more or less exactly how most OSes handle this + (OS monotonic time and OS system time). By adjusting + system time smoothly we would just hide the fact that + system time changed and make it harder for the Erlang + applications to react to the change in a sensible way.

+ +

In order to be able to react to a change in Erlang + system time you have to be able to detect that it + happened. The change in Erlang system time occurs when + current time offset is changed. We have therefore + introduced the possibility to monitor the time offset + using + erlang:monitor(time_offset, clock_service). A process monitoring the time + offset will be sent a message on the following format + when the time offset is changed:

+ {'CHANGE', MonitorReference, time_offset, clock_service, NewTimeOffset} +
+ + +
+ Unique Values +

Besides reporting time erlang:now/0 also + produce unique and strictly monotonically increasing + values. In order to detach this functionality from + time measurements we have introduced + erlang:unique_integer(). +

+
+ + +
+ Dos and Don'ts +

Previously erlang:now/0 was the only option for doing + quite a lot of things. We will look at a few different things + erlang:now/0 could be used for, and how you want to do + this using the new API:

+ + +
+ Retrieve Erlang System Time + +

+ use erlang:now/0 in order to retrieve current Erlang + system time. +

+
+ +

+ use + erlang:system_time/1 + in order to retrieve current Erlang system time on the + time unit + of your choice.

+

If you want the same format as returned by erlang:now/0, use + erlang:timestamp/0. +

+
+
+ + +
+ Measure Elapsed Time + +

+ take timestamps with erlang:now/0 and calculate + the difference in time with + timer:now_diff/2. +

+
+ +

+ take timestamps with + erlang:monotonic_time/0 + and calculate the time difference using ordinary subtraction. + The result will be in native + time unit. + If you want to convert the + result to another time unit you can do this using + erlang:convert_time_unit/3. +

+

Another easier way of doing this is to use + erlang:monotonic_time/1 + with desired time unit. However, you may lose accuracy, + and precision this way. +

+
+
+ + +
+ Determine Order of Events + +

+ determine the order of events by saving a timestamp + with erlang:now/0 when the event happens. +

+
+ +

+ determine the order of events by saving the integer + returned by + erlang:unique_integer([monotonic]) + when the event happens. These integers will be strictly + monotonically ordered on current runtime system instance + corresponding to creation time. +

+
+
+ + +
+ Determine Order of Events With Time of the Event + +

+ determine the order of events by saving a timestamp + with erlang:now/0 when the event happens. +

+
+ +

+ determine the order of events by saving a tuple + containing + monotonic time + and a strictly + monotonically increasing integer like this:

+ +Time = erlang:monotonic_time(), +UMI = erlang:unique_integer([monotonic]), +EventTag = {Time, UMI} +

These tuples will be strictly monotonically ordered + on the current runtime system instance according to + creation time. Note that it is important that the + monotonic time is in the first element (the most + significant element when comparing 2-tuples). Using + the monotonic time in the tuples, you can calculate time + between events.

+

If you are interested in the Erlang system time at the + time when the event occurred you can also save the time + offset before or after saving the events using + erlang:time_offset/0. + Erlang monotonic time added with the time + offset corresponds to Erlang system time.

+

If you are executing in a mode where time offset + may change and you want to be able to get the actual + Erlang system time when the event occurred you can + save the time offset as a third element in the tuple + (the least significant element when comparing 3-tuples).

+
+
+ + +
+ Create a Unique Name + +

+ use the values returned from erlang:now/0 + in order to create a name unique on the current + runtime system instance. +

+
+ +

+ use the value returned from + erlang:unique_integer/0 + in order to create a name unique on the current runtime system + instance. If you only want positive integers, you can use + erlang:unique_integer([positive]). +

+
+
+ + +
+ Seed Random Number Generation With a Unique Value + +

+ seed random number generation using erlang:now(). +

+
+ +

+ seed random number generation using a combination of + erlang:monotonic_time(), + erlang:time_offset(), + erlang:unique_integer(), and other functionality. +

+
+
+ +

To sum this section up: Don't use erlang:now/0!

+
+ +
- Turning off time correction -

If, for some reason, time correction causes trouble and you are - absolutely confident that the wall clock on the system is nearly - perfect, you can turn off time correction completely by giving the - +c option to erl. The probability for this being a - good idea, is very low.

+ Supporting Both New and Old OTP Releases +

Your code may be required to be able to run on a variety + of OTP installations of different OTP releases. If so, you + can not just use the new API out of the box, since it will + not be available on old pre OTP 18 releases. The solution + is not to avoid using the new API, since your + code then won't be able to benefit from the scalability + and accuracy improvements made. Instead you want to use the + new API when available, and fall back on erlang:now/0 + when it is not available. Fortunately almost all of the new + API can easily be implemented using existing primitives + (except for + erlang:system_info(start_time), and + erlang:system_info(os_monotonic_time_source)). + By wrapping the API with functions that fall back on + erlang:now/0 when the new API is not available, + and using these wrappers instead of using the API directly + the problem is solved. These wrappers can for example + be implemented as in + $ERL_TOP/erts/example/time_compat.erl.

- -- cgit v1.2.3 From d07319f790eb38c867bd04a23de674e2393825ff Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Sun, 22 Mar 2015 20:20:28 +0100 Subject: Better support for poor os monotonic sources --- erts/doc/src/erlang.xml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 3cbfd372ce..98c0ef5f81 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6449,6 +6449,15 @@ ok precision won't be higher than OsMonotonicTimeResolution.

+ {extended, Extended} +

Extended equals yes if + the range of time values has been extended; + otherwise, Extended equals no. The + range needs to be extended if Function + returns values that wrap fast. This typically + is the case when the return value is a 32-bit + value.

+ {parallel, Parallel}

Parallel equals yes if Function is called in parallel from multiple -- cgit v1.2.3 From 052695858c07477db480d25d2d858540088d04c3 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 24 Mar 2015 10:27:20 +0100 Subject: Documentation adjustments --- erts/doc/src/erlang.xml | 33 ++++++++++++++++++++++----------- erts/doc/src/time_correction.xml | 29 +++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 13 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 98c0ef5f81..7cb417ac92 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -110,10 +110,17 @@

The value of the native time unit gives you more or less no information at all about the - quality of time values. It sets an upper bound for - the resolution as well as for the precision, but it - gives absolutely no information at all about the - accuracy.

+ quality of time values. It sets a limit for + the + resolution + as well as for the + precision + of time values, + but it gives absolutely no information at all about the + accuracy + of time values. The resolution of the native time + unit and the resolution of time values may differ + significantly.

@@ -6435,18 +6442,22 @@ ok Function.

{resolution, OsMonotonicTimeResolution} -

Highest possible resolution of current - OS monotonic time source as parts per second. If - no resolution information can be retreived from - the OS, OsMonotonicTimeResolution will be +

Highest possible + resolution + of current OS monotonic time source as parts per + second. If no resolution information can be retreived + from the OS, OsMonotonicTimeResolution will be set to the resolution of the time unit of Functions return value. That is, the actual resolution may be lower than OsMonotonicTimeResolution. Also note that the resolution does not say anything about the - accuracy, and that the precision might not align - with the resolution. You do, however, know that the - precision won't be higher than + accuracy, + and that the + precision + might not align with the resolution. You do, + however, know that the precision won't be + better than OsMonotonicTimeResolution.

{extended, Extended} diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index 3bc3d04186..ed658ff58c 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -114,6 +114,29 @@ happened yet), POSIX time would make a one second leap forward.

+ +
+ Time Resolution +

The shortest time interval that can be distinguished when + reading time values.

+
+ + +
+ Time Precision +

The shortest time interval that can be be distinguished + repeatedly and reliably when reading time values. Precision + is limited by the + resolution, but + resolution and precision might differ significantly.

+
+ + +
+ Time Accuracy +

The correctness of time values.

+
+
OS System Time @@ -162,8 +185,10 @@ Erlang runtime system. The Erlang monotonic time increase since some unspecified point in time. It can be retrieved by calling erlang:monotonic_time(). - The accuracy, and precision of Erlang monotonic time heavily - depends on the accuracy and precision of + The + accuracy, and + precision of Erlang + monotonic time heavily depends on the accuracy and precision of OS monotonic time, the accuracy and precision of OS system time as well -- cgit v1.2.3 From c20482023b70768bd84d25f1e34dbbc2fe09cf31 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 24 Mar 2015 15:28:11 +0100 Subject: Better OS system time implementation --- erts/doc/src/erlang.xml | 55 ++++++++++++++++++++++++++++++++++++++++ erts/doc/src/time_correction.xml | 14 +++++++--- 2 files changed, 65 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 7cb417ac92..bd5efb712c 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6031,6 +6031,8 @@ ok + + Information about the system

Returns various information about the current system @@ -6482,6 +6484,59 @@ ok time unit.

+ os_system_time_source + +

Returns a list containing information about the source of + OS + system time that is used by the runtime system.

+

The list contains two-tuples with Keys + as first element, and Values as second element. The + order if these tuples is undefined. Currently the following + tuples may be part of the list, but more tuples may be + introduced in the future:

+ + {function, Function} +

Function is the name of the funcion + used.

+ + {clock_id, ClockId} +

This tuple only exist if Function + can be used with different clocks. ClockId + corresponds to the clock identifer used when calling + Function.

+ + {resolution, OsSystemTimeResolution} +

Highest possible + resolution + of current OS system time source as parts per + second. If no resolution information can be retreived + from the OS, OsSystemTimeResolution will be + set to the resolution of the time unit of + Functions return value. That is, the actual + resolution may be lower than + OsSystemTimeResolution. Also note that + the resolution does not say anything about the + accuracy, + and that the + precision + might not align with the resolution. You do, + however, know that the precision won't be + better than + OsSystemTimeResolution.

+ + {parallel, Parallel} +

Parallel equals yes if + Function is called in parallel from multiple + threads. If it is not called in parallel, because + calls needs to be serialized, Parallel equals + no.

+ + {time, OsSystemTime} +

OsSystemTime equals current OS + system time in native + time unit.

+
+
port_parallelism

Returns the default port parallelism scheduling hint used. For more information see the diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index ed658ff58c..979a37d7ff 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -147,7 +147,9 @@ This may or may not be an accurate view of POSIX time. This time may typically be adjusted both backwards and forwards without limitation. That is, huge leaps both backwards and forwards in time - may be observed.

+ may be observed. You can get information about the Erlang runtime + system's source of OS system time by calling + erlang:system_info(os_system_time_source).

@@ -161,7 +163,9 @@ point in time that is not connected to OS system time. Note that this type of time is not necessarily provided by all operating - systems.

+ systems. You can get information about the Erlang runtime + system's source of OS monotonic time by calling + erlang:system_info(os_monotonic_time_source).

@@ -597,6 +601,7 @@

erlang:monitor(time_offset, clock_service)

erlang:system_flag(time_offset, finalize)

erlang:system_info(os_monotonic_time_source)

+

erlang:system_info(os_system_time_source)

erlang:system_info(time_offset)

erlang:system_info(time_warp_mode)

erlang:system_info(time_correction)

@@ -852,8 +857,9 @@ EventTag = {Time, UMI} when it is not available. Fortunately almost all of the new API can easily be implemented using existing primitives (except for - erlang:system_info(start_time), and - erlang:system_info(os_monotonic_time_source)). + erlang:system_info(start_time), + erlang:system_info(os_monotonic_time_source), and + erlang:system_info(os_system_time_source)). By wrapping the API with functions that fall back on erlang:now/0 when the new API is not available, and using these wrappers instead of using the API directly -- cgit v1.2.3 From 89987ada3c997fd9f1e1f8c8ed73da0394bda4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 4 Mar 2015 17:28:37 +0100 Subject: erts: Document option 'hpds' --- erts/doc/src/erl.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index d11f6b0c6d..f08467bfc6 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -588,6 +588,11 @@

Sets the default binary virtual heap size of processes to the size .

+ + +

Sets the initial process dictionary size of processes to the size + .

+

Enables or disables the kernel poll functionality if -- cgit v1.2.3 From 62870c998955e1498e71bfc90607885e96ecaa27 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 31 Mar 2015 12:24:04 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index af0d4d7377..a2b4ae49a4 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,98 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4 + +
Fixed Bugs and Malfunctions + + +

+ Fix missing quotation in the LM_FIND_EMU_CC + autoconf macro which could cause build failures.

+

+ Own Id: OTP-12388

+
+ +

+ Fix erroneous printout of monitors in crashdump file.

+

+ Own Id: OTP-12537

+
+ +

+ The runtime system without SMP support could crash in the + BIF port_control/3 if the port that was being + accessed died during the call to the BIF.

+

+ Own Id: OTP-12544 Aux Id: Seq12777

+
+ +

+ Avoid corrupt oversized integer to be created from binary + matching. Instead throw system_limit exception which is + the correct behavior. A peculiar symptom of this bug was + that bitwise operations (band, bor, bxor) on such + oversized integers could return the empty list []. + Credit: Mikael Pettersson, Nico Kruber

+

+ Own Id: OTP-12556

+
+ +

+ A race condition when calling port_info/1 could + cause a memory fault has been fixed.

+

+ Own Id: OTP-12587

+
+ +

+ Fix comparison of exact terms. An overflow that could + cause faulty comparisons has been fixed. Comparison of + exact terms is exclusively used within Maps.

+

+ Own Id: OTP-12623

+
+ +

+ Fix bug in list_to_integer/1 for very long lists + that could cause VM crash.

+

+ Own Id: OTP-12624

+
+
+
+ + +
Improvements and New Features + + +

+ Introduced a runtime system internal 64-bit API for + atomic memory operations.

+

+ Own Id: OTP-12351

+
+ +

+ Add command line argument option for the initial size of + process dictionaries.

+

+ Use '+hpds <size>' to set initial process + dictionary size for spawned processes.

+

+ Own Id: OTP-12535 Aux Id: seq12809

+
+ +

+ Fix documentation on $char for Unicode

+

+ Own Id: OTP-12545

+
+
+
+ +
+
Erts 6.3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 9f903f6031ff40e415c8807aca19f699d0b553f1 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 13 Apr 2015 18:30:18 +0200 Subject: erts: Clearify erl_nif documentation about badarg exception Also state that maximum atom length is 255 characters. --- erts/doc/src/erl_nif.xml | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index feba6daaa0..afeec69f02 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -899,26 +899,34 @@ typedef enum { Create an atom term

Create an atom term from the null-terminated C-string name with iso-latin-1 encoding. If the length of name exceeds the maximum length - allowed for an atom, enif_make_atom returns a badarg exception.

+ allowed for an atom (255 characters), enif_make_atom invokes + enif_make_badarg. +

ERL_NIF_TERMenif_make_atom_len(ErlNifEnv* env, const char* name, size_t len) Create an atom term

Create an atom term from the string name with length len. Null-characters are treated as any other characters. If len is greater than the maximum length - allowed for an atom, enif_make_atom returns a badarg exception.

+ allowed for an atom (255 characters), enif_make_atom invokes + enif_make_badarg. +

ERL_NIF_TERMenif_make_badarg(ErlNifEnv* env) Make a badarg exception. -

Make a badarg exception to be returned from a NIF, and set - an associated exception reason in env. If - enif_make_badarg is called, the term it returns must - be returned from the function that called it. No other return value - is allowed. Once a NIF or any function it calls invokes enif_make_badarg, - the runtime ensures that a badarg exception is raised when the NIF - returns, even if the NIF attempts to return a non-exception term instead. - Also, the term returned from enif_make_badarg may be passed only to - enif_is_exception and - not to any other NIF API function.

+

Make a badarg exception to be returned from a NIF, and associate + it with the environment env. Once a NIF or any function + it calls invokes enif_make_badarg, the runtime ensures that a + badarg exception is raised when the NIF returns, even if the NIF + attempts to return a non-exception term instead. + The return value from enif_make_badarg may only be used as + return value from the NIF that invoked it (direct or indirectly) + or be passed to + enif_is_exception, but + not to any other NIF API function.

+

In earlier versions (older than erts-7.0, OTP 18) the return value + from enif_make_badarg had to be returned from the NIF. This + requirement is now lifted as the return value from the NIF is ignored + if enif_make_badarg has been invoked.

ERL_NIF_TERMenif_make_binary(ErlNifEnv* env, ErlNifBinary* bin) Make a binary term. @@ -936,8 +944,9 @@ typedef enum { ERL_NIF_TERMenif_make_double(ErlNifEnv* env, double d) Create a floating-point term

Create a floating-point term from a double. If the double argument is - not finite or is NaN, enif_make_double returns a badarg exception.

-
+ not finite or is NaN, enif_make_double invokes + enif_make_badarg. +

intenif_make_existing_atom(ErlNifEnv* env, const char* name, ERL_NIF_TERM* atom, ErlNifCharEncoding encode) Create an existing atom term @@ -946,7 +955,8 @@ typedef enum { encode. If the atom already exists store the term in *atom and return true, otherwise return false. If the length of name exceeds the maximum length - allowed for an atom, enif_make_existing_atom returns false.

+ allowed for an atom (255 characters), enif_make_existing_atom + returns false.

intenif_make_existing_atom_len(ErlNifEnv* env, const char* name, size_t len, ERL_NIF_TERM* atom, ErlNifCharEncoding encoding) Create an existing atom term @@ -955,8 +965,8 @@ typedef enum { encode. Null-characters are treated as any other characters. If the atom already exists store the term in *atom and return true, otherwise return false. If len is greater - than the maximum length allowed for an atom, enif_make_existing_atom_len - returns false.

+ than the maximum length allowed for an atom (255 characters), + enif_make_existing_atom_len returns false.

ERL_NIF_TERMenif_make_int(ErlNifEnv* env, int i) Create an integer term -- cgit v1.2.3 From 80e15112a6e31e053ad0670096c23bda2fc341e4 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 14 Apr 2015 15:18:33 +0200 Subject: erts: Add enif_has_pending_exception --- erts/doc/src/erl_nif.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index afeec69f02..5c912e0fe3 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -806,6 +806,12 @@ typedef enum { and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

+ intenif_has_pending_exception(ErlNifEnv* env) + Check if an exception has been raised. +

Return true if a pending exception is associated + with the environment env. The only possible exception is currently + badarg (see enif_make_badarg).

+
intenif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin) Inspect the content of a binary

Initialize the structure pointed to by bin with @@ -923,6 +929,8 @@ typedef enum { or be passed to enif_is_exception, but not to any other NIF API function.

+

See also: enif_has_pending_exception. +

In earlier versions (older than erts-7.0, OTP 18) the return value from enif_make_badarg had to be returned from the NIF. This requirement is now lifted as the return value from the NIF is ignored -- cgit v1.2.3 From 308b03e8afa14e03973330942e7aacf0cc925bf2 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 14 Apr 2015 15:43:40 +0200 Subject: erts: Remove old docs about experimental NIF versions. --- erts/doc/src/erl_nif.xml | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 5c912e0fe3..4bad8b253c 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -66,34 +66,6 @@ -

The NIF concept is officially supported from R14B. NIF source code - written for earlier experimental versions might need adaption to run on R14B - or later versions:

- - No incompatible changes between R14B and R14A. - Incompatible changes between R14A and R13B04: - - Environment argument removed for enif_alloc, - enif_realloc, enif_free, enif_alloc_binary, - enif_realloc_binary, enif_release_binary, - enif_alloc_resource, enif_release_resource, - enif_is_identical and enif_compare. - Character encoding argument added to enif_get_atom - and enif_make_existing_atom. - Module argument added to enif_open_resource_type - while changing name spaces of resource types from global to module local. - - - Incompatible changes between R13B04 and R13B03: - - The function prototypes of the NIFs have changed to expect argc and argv - arguments. The arity of a NIF is by that no longer limited to 3. - enif_get_data renamed as enif_priv_data. - enif_make_string got a third argument for character encoding. - - - -

A minimal example of a NIF library can look like this:

-- cgit v1.2.3 From 512f099b247b17b3145e90293167a4ba373b9471 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 6 May 2015 10:46:46 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index a2b4ae49a4..35e6e55e72 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,22 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4.1 + +
Fixed Bugs and Malfunctions + + +

+ The VTS mode in Common Test has been modified to use a + private version of the Webtool application (ct_webtool).

+

+ Own Id: OTP-12704 Aux Id: OTP-10922

+
+
+
+ +
+
Erts 6.4
Fixed Bugs and Malfunctions -- cgit v1.2.3 From edce22eb43c40359ccbd0924412cf13692744779 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 26 Mar 2015 22:46:29 +0100 Subject: Misc time improvements - Possibility to chose different clock sources - Improved mach clock usage - Improved linux clock_gettime() usage - ... --- erts/doc/src/time_correction.xml | 87 ++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 40 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index 979a37d7ff..8af98acc19 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -137,6 +137,14 @@

The correctness of time values.

+ +
+ Time Warp +

A time warp is a leap forwards or backwards in time. That + is, the difference of time values taken before and after the + time warp will not correspond to the actual elapsed time.

+
+
OS System Time @@ -146,7 +154,7 @@ os:system_time(). This may or may not be an accurate view of POSIX time. This time may typically be adjusted both backwards and forwards without - limitation. That is, huge leaps both backwards and forwards in time + limitation. That is, time warps may be observed. You can get information about the Erlang runtime system's source of OS system time by calling erlang:system_info(os_system_time_source).

@@ -159,12 +167,12 @@ system. This time does not leap and have a relatively steady frequency although not completely correct. However, it is not uncommon that the OS monotonic time stops if the system is - suspended. This time typically increase since some unspecified - point in time that is not connected to - OS system time. Note that - this type of time is not necessarily provided by all operating - systems. You can get information about the Erlang runtime - system's source of OS monotonic time by calling + suspended. This time typically increase since some + unspecified point in time that is not connected to + OS system time. Note + that this type of time is not necessarily provided by all + operating systems. You can get information about the Erlang + runtime system's source of OS monotonic time by calling erlang:system_info(os_monotonic_time_source).

@@ -177,9 +185,11 @@ erlang:system_time(). This time may or may not be an accurate view of POSIX time, and may or may not align with OS system - time. The time - warp mode determines how it behaves when OS system - time suddenly change.

+ time. The runtime system works towards aligning the two + system times. Depending on time + warp mode used, this may be achieved by letting the Erlang + system time perform a time + warp.

@@ -219,12 +229,6 @@

- -
- Time Warp -

A time warp is a leap forwards or backwards in time.

-
-
@@ -332,7 +336,7 @@
Time Warp Safe Code

Time warp safe code is code that is able to handle - a time warp of + a time warp of Erlang system time.

@@ -378,11 +382,11 @@

The time offset is determined at runtime system start and will after this not change. This is the default behavior. Not because it is the best mode (which it isn't). It is - default only because this is how the runtime system always - has behaved until ERTS version 7.0, and you have to ensure - that your Erlang code that may execute during a time warp is - time warp safe - before you can enable other modes.

+ default only because this is how the runtime system + always has behaved up until ERTS version 7.0, and you have to + ensure that your Erlang code that may execute during a time + warp is time warp + safe before you can enable other modes.

Since the time offset is not allowed to change, time correction needs to adjust the frequency of the Erlang @@ -422,9 +426,9 @@ system time has been corrected, you may want to use the single time warp mode. Note that there are limitations to when you can execute time warp unsafe code using this mode. If it is possible - to only utilize time warp safe code, it is much better to use - the multi time warp - mode instead. + to only utilize time warp safe code, it is much better + to use the multi time + warp mode instead.

Using the single time warp mode, the time offset is @@ -438,12 +442,14 @@ current OS system time is determined. This offset will from now on be fixed during the whole preliminary phase.

-

If time correction is enabled, the Erlang - monotonic clock will only use the OS monotonic time as - time source during this phase. That is, during the - preliminary phase changes in OS system time will have - no effect on Erlang system time and/or Erlang - monotonic time what so ever.

+

If time correction is enabled, adjustments to the + Erlang monotonic clock will be made to keep its + frequency as correct as possible, but no + adjustments will be made trying to align Erlang system + time and OS system time. That is, during the preliminary + Erlang system time and OS system time might diverge + from each other, and no attempt to prevent this will + be made.

If time correction is disabled, changes in OS system time will effect the monotonic clock the same way as @@ -462,15 +468,16 @@

During finalization, the time offset is adjusted and fixated so that current Erlang system time align with - current OS system time. Since the time offset - may be changed, the Erlang system time may do - a time warp at this point. The time offset will from - now on be fixed until the runtime system terminates. - If time correction has been enabled, the time correction - also begins when this phase begins. When the system is - in the final phase it behaves exactly as in the - no time warp - mode.

+ current OS system time. Since the time offset may + change during the finalization, the Erlang system time + may do a time warp at this point. The time offset will + from now on be fixed until the runtime system terminates. + If time correction has been enabled, the time + correction will from now on also make adjustments + in order to align Erlang system time with OS system + time. When the system is in the final phase it behaves + exactly as in the no + time warp mode.

-- cgit v1.2.3 From 5f1ce6aefcc860906506ced26fe666faf3e82235 Mon Sep 17 00:00:00 2001 From: Nate Bartley Date: Thu, 7 May 2015 10:32:43 -0700 Subject: Fixing typo --- erts/doc/src/init.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index 09b5493341..c5a1a92b92 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -248,7 +248,7 @@ evaluation), Erlang stops with an error message. Here is an example that seeds the random number generator:

-% erl -eval '{X,Y,Z}' = now(), random:seed(X,Y,Z).'
+% erl -eval '{X,Y,Z} = now(), random:seed(X,Y,Z).'

This example uses Erlang as a hexadecimal calculator:

 % erl -noshell -eval 'R = 16#1F+16#A0, io:format("~.16B~n", [R])' \\
-- 
cgit v1.2.3


From 849a2ed2db2bd54422ec9284468f80cc86978974 Mon Sep 17 00:00:00 2001
From: Rickard Green 
Date: Mon, 11 May 2015 17:56:03 +0200
Subject: Timer fixes, documentation, and test cases

---
 erts/doc/src/erlang.xml | 249 ++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 207 insertions(+), 42 deletions(-)

(limited to 'erts/doc')

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index ba5f80a9c1..6ca57566aa 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -536,29 +536,69 @@
       
     
     
-      
+      
       Cancel a timer
       
-        

Cancels a timer, where TimerRef was returned by - either - erlang:send_after/3 - or - erlang:start_timer/3. - If the timer is there to be removed, the function returns - the time in milliseconds left until the timer would have expired, - otherwise false (which means that TimerRef was - never a timer, that it has already been cancelled, or that it - has already delivered its message).

+

Cancels a timer. TimerRef needs to refer to + a timer that was created by either + erlang:send_after(), + or erlang:start_timer().

+

Currently available Options:

+ + {async, Async} + +

Asynchronous request for cancellation. Async + defaults to false. That is the operation will be + performed synchronously. When Async is set to + true the cancel operation will be performed + asynchronously. That is, cancel_timer() will send + a request for cancellation to the timer service that + manages the timer, and then return ok.

+ {info, Info} + +

Request information about the Result of the + cancellation. Info defaults to true. That + is information will be given. When Info is set to + false no information about the result of the cancel + operation will be given. When the operation is performed + synchronously the Result will returned from + cancel_timer(). When the operation is performed + asynchronously, a message on the form + {cancel_timer, TimerRef, Result} + will be sent to the caller of cancel_timer() when + the operation has been performed.

+
+

When the Result equals false a timer + corresponding to TimerRef could not be found. This + can be either because the timer had expired, been canceled, or because + TimerRef do not correspond to a timer. When the + Result is an integer, it represents + the time in milli seconds left before the timer will expire.

+

The timer service that manages the timer may be co-located + with another scheduler than the scheduler that the calling process + is executing on. In this case communication with the timer + service will be performed using asynchronous signals. If the calling + process is in critical path and can do other things while waiting + for the result of this operation, you want to use the {async, true} + option.

See also - erlang:send_after/3, - erlang:start_timer/3, + erlang:send_after/4, + erlang:start_timer/4, and - erlang:read_timer/1.

+ erlang:read_timer/2.

Note: Cancelling a timer does not guarantee that the message has not already been delivered to the message queue.

- + + + Cancel a timer + +

Cancels a timer. The same as calling + erlang:cancel_timer(TimerRef, + [{async, false}, {info, true}]).

+
+
Check if a module has old code @@ -4505,23 +4545,54 @@ os_prompt%
- - Number of milliseconds remaining for a timer - -

TimerRef is a timer reference returned by - erlang:send_after/3 - or - erlang:start_timer/3. - If the timer is active, the function returns the time in - milliseconds left until the timer will expire, otherwise - false (which means that TimerRef was never a - timer, that it has been cancelled, or that it has already - delivered its message).

+ + Read the state of a timer + +

Read the state of a timer. TimerRef + needs to refer to a timer that was created by either + erlang:send_after(), + or erlang:start_timer().

+

Currently available Options:

+ + {async, Async} + +

Asynchronous request. Async defaults to false. That + is the operation will be performed synchronously, and the Result + will returned from read_timer(). When Async is set to + true, read_timer() will send a request for the + Result to a timer service that manages the timer and then + return ok. A message on the format + {read_timer, TimerRef, Result} + will be sent to the caller of read_timer() when + the operation has been processed.

+
+

When the Result equals false a timer + corresponding to TimerRef could not be found. This + can be either because the timer had expired, been canceled, or because + TimerRef do not correspond to a timer. When the + Result is an integer, it represents + the time in milli seconds left before the timer will expire.

+

The timer service that manages the timer may be co-located + with another scheduler than the scheduler that the calling process + is executing on. In this case communication with the timer + service will be performed using asynchronous signals. If the calling + process is in critical path and can do other things while waiting + for the result of this operation, you want to use the {async, true} + option.

See also - erlang:send_after/3, - erlang:start_timer/3, + erlang:send_after/4, + erlang:start_timer/4, and - erlang:cancel_timer/1.

+ erlang:cancel_timer/2.

+
+
+ + + Read the state of a timer + +

Read the state of a timer. The same as calling + erlang:read_timer(TimerRef, + [{async, false}]).

@@ -4669,6 +4740,63 @@ true + + + Start a timer + +

Starts a timer. When the timer expires, the message + Msg will be sent to + Dest.

+

If Dest is a pid() it has to + be a pid() of a local process, dead or alive.

+

Currently available Options:

+ + {abs, Abs} + +

Absolute timeout. When Abs is false + the Time value will be interpreted + as a time in milli-seconds relative current + Erlang + monotonic time. When Abs is true the + Time value will be interpreted as an absolute + Erlang monotonic time of milli second time unit. Abs + defaults to false.

+
+
+

The absolute time when the timer is set to expire needs + to be in the range between + erlang:system_info(start_time) + and + erlang:system_info(end_time). + If a negative relative time is specified the time is not + allowed to be negative.

+

If Dest is an atom(), it is supposed to be the name of + a registered process. The process referred to by the name is + looked up at the time of delivery. No error is given if + the name does not refer to a process.

+

If Dest is a pid(), the timer will be automatically + canceled if the process referred to by the pid() is not alive, + or when the process exits. This feature was introduced in + erts version 5.4.11. Note that timers will not be + automatically canceled when Dest is an atom().

+

See also + erlang:send_timer/4, + erlang:cancel_timer/2, + and + erlang:read_timer/2.

+

Failure: badarg if the arguments does not satisfy + the requirements specified above.

+
+
+ + + Start a timer + +

Starts a timer. The same as calling + erlang:send_after(Time, + Dest, Msg, [{abs, false}]).

+
+
0 <= Time <= 4294967295 @@ -4690,9 +4818,9 @@ true automatically canceled when Dest is an atom.

See also erlang:start_timer/3, - erlang:cancel_timer/1, + erlang:cancel_timer/2, and - erlang:read_timer/1.

+ erlang:read_timer/2.

Failure: badarg if the arguments does not satisfy the requirements specified above.

@@ -5100,15 +5228,35 @@ true
- - 0 <= Time <= 4294967295 + Start a timer -

Starts a timer which will send the message - {timeout, TimerRef, Msg} to Dest - after Time milliseconds.

-

If Dest is a pid() it has to be a pid() of a local process, dead or alive.

-

The Time value can, in the current implementation, not be greater than 4294967295.

+

Starts a timer. When the timer expires, the message + {timeout, TimerRef, Msg} + will be sent to Dest.

+

If Dest is a pid() it has to + be a pid() of a local process, dead or alive.

+

Currently available Options:

+ + {abs, Abs} + +

Absolute timeout. When Abs is false + the Time value will be interpreted + as a time in milli-seconds relative current + Erlang + monotonic time. When Abs is true the + Time value will be interpreted as an absolute + Erlang monotonic time of milli second time unit. Abs + defaults to false.

+
+
+

The absolute time when the timer is set to expire needs + to be in the range between + erlang:system_info(start_time) + and + erlang:system_info(end_time). + If a negative relative time is specified the time is not + allowed to be negative.

If Dest is an atom(), it is supposed to be the name of a registered process. The process referred to by the name is looked up at the time of delivery. No error is given if @@ -5119,14 +5267,23 @@ true erts version 5.4.11. Note that timers will not be automatically canceled when Dest is an atom().

See also - erlang:send_after/3, - erlang:cancel_timer/1, + erlang:send_after/4, + erlang:cancel_timer/2, and - erlang:read_timer/1.

+ erlang:read_timer/2.

Failure: badarg if the arguments does not satisfy the requirements specified above.

+ + + Start a timer + +

Starts a timer. The same as calling + erlang:start_timer(Time, + Dest, Msg, [{abs, false}]).

+
+
Information about context switches @@ -6236,6 +6393,14 @@ ok (i.e. system_info(dynamic_trace) returns dtrace or systemtap).

+ end_time +

The last Erlang monotonic + time in native + time unit that + can be represented internally in the current Erlang runtime system + instance. The time between the + start time and + the end time is at least a quarter of a millennium.

elib_malloc

This option will be removed in a future release. -- cgit v1.2.3 From e09dd66dc4d89c62ddfd8c19791f9678d5d787c6 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 12 May 2015 18:18:55 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 502 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 502 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 35e6e55e72..c85cbe543d 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,508 @@

This document describes the changes made to the ERTS application.

+
Erts 7.0 + +
Fixed Bugs and Malfunctions + + +

+ Fix issuing with spaces and quoting in the arguments when + using erlang:open_port spawn_executable on windows. The + behavior now mimics how unix works. This change implies a + backwards incompatibility for how spawn_executable works + on windows.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11905

+
+ +

+ Fix global call trace when hipe compiled code call beam + compiled functions. Tracing of beam functions should now + alway work regardless who the caller is.

+

+ Own Id: OTP-11939

+
+ +

+ Correct cache alignment for ETS write_concurrency + locks to improve performance by reduced false sharing. + May increase memory footprint for tables with + write_concurrency.

+

+ Own Id: OTP-11974

+
+ +

+ All possibly blocking operations in the fd/spawn and + terminal driver have been converted to non-blocking + operations. Before this fix it was possible for the VM to + be blocked for a long time if the entity consuming + stdout/stderr did not consume it fast enough.

+

+ Own Id: OTP-12239

+
+ +

+ Add missing overhead for offheap binaries created from + external format. This fix can improve the garbage + collection of large binaries originating from + binary_to_term or messages from remote nodes.

+

+ Own Id: OTP-12554

+
+ +

+ Ensure hashing of zero is consistent

+

Erlang treats positive and negative zero as + equal:

+

+ true = 0.0 =:= 0.0/-1

+

However, Erlangs hash functions: hash, phash and + phash2 did not reflect this behaviour. The hash values + produced by the different hash functions would not be + identical for positive and negative zero.

This + change ensures that hash value of positive zero is always + produced regardless of the signedness of the zero float, + i.e.,

+

+ true = erlang:phash2(0.0) =:= + erlang:phash2(0.0/-1)

+

+ Own Id: OTP-12641

+
+ +

+ Ensure NIF term creation disallows illegal floating point + values and too long atoms. Such values will cause a NIF + to throw badarg exception when it returns.

+

+ Own Id: OTP-12655

+
+ +

+ Fixed building of Map results from match_specs

+

+ A faulty "box-value" entered into the heap which could + cause a segmentation fault in the garbage collector if it + was written on a heap fragment.

+

+ Own Id: OTP-12656

+
+ +

+ Fix hipe bug when matching a "writable" binary. The bug + has been seen to sometimes cause a failed binary matching + of a correct utf8 character, but other symptoms are also + possible.

+

+ Own Id: OTP-12667

+
+ +

+ Keep dirty schedulers from waking other schedulers.

+

+ Own Id: OTP-12685

+
+ +

+ Disable floating point exceptions if the VM is compiled + by clang/llvm. This is a known long-standing problem in + clang/llvm.

+

+ Own Id: OTP-12717

+
+ +

+ Fix bug in file:sendfile for FreeBSD causing not + the entire file to be sent.

+

+ Own Id: OTP-12720

+
+
+
+ + +
Improvements and New Features + + +

+ Add md5 and module entries to + ?MODULE:module_info/0/1 and remove obsolete entry + 'import'.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11940

+
+ +

+ Debug function erlang:display/1 shows content of + binaries and bitstrings, not only the length.

+

+ Own Id: OTP-11941

+
+ +

The time functionality of Erlang has been extended. + This both includes a new + API for time, as well as time warp + modes which alters the behavior of the system + when system time changes. You are strongly encouraged + to use the new API instead of the old API based on + erlang:now/0. + erlang:now/0 has been deprecated since it is and + forever will be a scalability bottleneck. For more + information see the Time and Time + Correction chapter of the ERTS User's + Guide.

+

Besides the API changes and time warp modes a lot of + scalability and performance improvements regarding time + management has been made internally in the runtime + system. Examples of such improvements are scheduler + specific timer wheels, scheduler specific BIF timer + management, parallel retrieval of monotonic time and + system time on systems with primitives that are not + buggy.

+

+ Own Id: OTP-11997

+
+ +

erlang:function_exported(M, F, A) will now + return true if M:F/A refers to a BIF.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12099

+
+ +

+ New BIF: erlang:get_keys/0, lists all keys + associated with the process dictionary. Note: + erlang:get_keys/0 is auto-imported.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12151 Aux Id: seq12521

+
+ +

+ Make distributed send of large messages yield to improve + real-time characteristics.

+

+ Own Id: OTP-12232

+
+ +

+ Use high accuracy poll timeouts

+

+ Where available, use poll/select API's that can handle + time resolutions less than 1ms. In the cases where such + API's are not available the timeout is rounded up to the + nearest ms.

+

+ Own Id: OTP-12236

+
+ +

+ The internal group to user_drv protocol has been changed + to be synchronous in order to guarantee that output sent + to a process implementing the user_drv protocol is + printed before replying. This protocol is used by the + standard_output device and the ssh application when + acting as a client.

+

+ This change changes the previous unlimited buffer when + printing to standard_io and other devices that end up in + user_drv to 1KB.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12240

+
+ +

The previously introduced "eager check I/O" feature is + now enabled by default.

+

Eager check I/O can be disabled using the erl + command line argument: +secio false

+

Characteristics impact compared to previous + default:

Lower latency and smoother + management of externally triggered I/O operations. + A slightly reduced priority of externally triggered + I/O operations. +

+ Own Id: OTP-12254 Aux Id: OTP-12117

+
+ +

+ Properly support maps in match_specs

+

+ Own Id: OTP-12270

+
+ +

+ The notice that a crashdump has been written has been + moved to be printed before the crashdump is generated + instead of afterwords. The wording of the notice has also + been changed.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12292

+
+ +

+ New function ets:take/2. Works the same as + ets:delete/2 but also returns the deleted + object(s).

+

+ Own Id: OTP-12309

+
+ +

+ Tracing with cpu_timestamp option has been enabled on + Linux.

+

+ Own Id: OTP-12366

+
+ +

+ ets:info/1,2 now contains information about whether + write_concurrency or read_concurrency is enabled.

+

+ Own Id: OTP-12376

+
+ +

+ Improved usage of gcc's builtins for atomic memory + access. These are used when no other implementation of + atomic memory operations is available. For example, when + compiling for ARM when libatomic_ops is not + available.

+

+ The largest improvement will be seen when compiling with + a gcc with support for the __atomic_* + builtins (using a gcc of at least version 4.7), + but also when only the legacy __sync_* builtins + are available (using a gcc of at least version + 4.1) an improvement can be seen.

+

+ For more information see the "Atomic + Memory Operations and the VM" section of + $ERL_TOP/HOWTO/INSTALL.md.

+

+ Own Id: OTP-12383

+
+ +

+ Introduce math:log2/1 function to math module.

+

+ Own Id: OTP-12411

+
+ +

+ Remove perfctr support

+

+ Development of perfctr in the linux kernel ceased in + 2010. The perfctr support code in the Erlang VM is thus + effectively dead code and therefor removed.

+

+ Own Id: OTP-12508

+
+ +

zlib:inflateChunk/2 has been added. It works + like zlib:inflate/2, but decompresses no more data + than will fit in the buffer configured by + zlib:setBufSize/2.

+

+ Own Id: OTP-12548

+
+ +

+ Use linear search for small select_val arrays

+

+ Own Id: OTP-12555

+
+ +

+ New BIF ets:update_counter/4 with a default object as + argument, which will be inserted in the table if the key + was not found.

+

+ Own Id: OTP-12563

+
+ +

+ Export missing types from zlib module

+

+ Own Id: OTP-12584

+
+ +

+ Use persistent hashmaps for large Maps

Maps will use a + persistent hashmap implementation when the number of + pairs in a Map becomes sufficiently large. The change + will occur when a Map reaches 33 pairs in size but this + limit might change in the future.

+

The most significant impact for the user by this + change is speed, and to a lesser degree memory + consumption and introspection of Maps. Memory consumption + size is probalistic but lesser than gb_trees or + dict for instance. Any other impacts will be + transparent for the user except for the following + changes.

+

Semantics of Maps have changed in two incompatible + ways compared to the experimental implementation in OTP + 17:

Hashing of maps is done different by + erlang:phash2/1,2, erlang:phash/1 and + erlang:hash/2. Comparing two maps + with ==, /=, =<, <, >= and >, is done + different if the keys contain floating point + numbers. +

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12585

+
+ +

+ Scalability improvement for erlang:make_ref/0, + and other functionality that create references. Each + scheduler now manage its own set of references. By this + no communication at all is needed when creating + references.

+

+ Previous implementation generated a strictly + monotonically increasing sequence of references + corresponding to creation time on the runtime system + instance. This is not the case with current + implementation. You can only expect reference to be + unique. The Erlang/OTP documentation has never mentioned + anything else but the uniqueness property, so this change + is fully compatible. The only reason we've + marked this as a potential incompatibility is since an + early draft for an Erlang specification mentions strict + monotonicity as a property.

+

+ If you need to create data with a strict monotonicity + property use erlang:unique_integer([monotonic]). + Do not use the deprecated erlang:now().

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12610

+
+ +

+ Enable different abort signal from heart

+

By using environment variable HEART_KILL_SIGNAL, heart + can now use a different signal to kill the old running + Erlang.

+

By default the signal is SIGKILL but SIGABRT may also + be used by setting environment variable: + HEART_KILL_SIGNAL=SIGABRT

+

+ Own Id: OTP-12613 Aux Id: seq12826

+
+ +

+ Update autconf to latest version 2015-03-04

+

+ Own Id: OTP-12646

+
+ +

+ Optimization of timers internally in the VM. This include + process timers (receive ... after), port timers + (driver_set_timer()) as well as BIF timers + (erlang:send_after()/erlang:start_timer()).

+

+ Each scheduler thread now has its own lock-free timer + service instead of one locked central service. This + dramatically improves performance of timer management on + systems with a large amount of schedulers and timers.

+

+ The timer service internal data structure has also been + optimized to be able to handle more timers than before. + That is, each timer service is by its self able to handle + more timers without dramatic performance loss than the + old centralized timer service.

+

+ The API of BIF timers has also been extended. Timeout + values are for example no longer limited to 32-bit + integers. For more information see the documentation of + erlang:start_timer/4, + erlang:send_after/4, + erlang:cancel_timer/2, + and erlang:read_timer/2.

+

+ Own Id: OTP-12650 Aux Id: OTP-11997

+
+ +

+ Specialize instructions from common assembler patterns

+

Specialize common instructions of rem, + band, minus and plus in the beam + loader. This will reduce the number of fetches and thus + lessen the instruction dispatch pressure during runtime + and speed up those operations in some common cases.

+

Specialize move patterns from x-registers to the stack + with a new move_window instruction. This change + will reduce instruction dispatch pressure.

+

+ Own Id: OTP-12690

+
+ +

+ Fix cross compilation for Android.

+

+ Own Id: OTP-12693

+
+ +

+ Fix incorrect use of autoconf macro AC_EGREP_CPP, which + could cause faulty configuration if run from a path + containing the string 'yes'.

+

+ Own Id: OTP-12706

+
+ +

+ Minimal Java version is now 1.6

+

+ Own Id: OTP-12718

+
+ +

+ Send format and args on process exit to error_logger

+

+ Previously, the emulator would generate a whole string + with values and call the error_logger passing + "~s~n". This changes it to a format string + containing ~p with the respective values as + arguments.

+

+ Own Id: OTP-12735

+
+
+
+ +
+
Erts 6.4.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 9a81b28598fadc44bf506354c9227e41aac786f6 Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Wed, 13 May 2015 09:40:16 +0200 Subject: Revert "Prepare release" This reverts commit e09dd66dc4d89c62ddfd8c19791f9678d5d787c6. --- erts/doc/src/notes.xml | 502 ------------------------------------------------- 1 file changed, 502 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index c85cbe543d..35e6e55e72 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,508 +30,6 @@

This document describes the changes made to the ERTS application.

-
Erts 7.0 - -
Fixed Bugs and Malfunctions - - -

- Fix issuing with spaces and quoting in the arguments when - using erlang:open_port spawn_executable on windows. The - behavior now mimics how unix works. This change implies a - backwards incompatibility for how spawn_executable works - on windows.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-11905

-
- -

- Fix global call trace when hipe compiled code call beam - compiled functions. Tracing of beam functions should now - alway work regardless who the caller is.

-

- Own Id: OTP-11939

-
- -

- Correct cache alignment for ETS write_concurrency - locks to improve performance by reduced false sharing. - May increase memory footprint for tables with - write_concurrency.

-

- Own Id: OTP-11974

-
- -

- All possibly blocking operations in the fd/spawn and - terminal driver have been converted to non-blocking - operations. Before this fix it was possible for the VM to - be blocked for a long time if the entity consuming - stdout/stderr did not consume it fast enough.

-

- Own Id: OTP-12239

-
- -

- Add missing overhead for offheap binaries created from - external format. This fix can improve the garbage - collection of large binaries originating from - binary_to_term or messages from remote nodes.

-

- Own Id: OTP-12554

-
- -

- Ensure hashing of zero is consistent

-

Erlang treats positive and negative zero as - equal:

-

- true = 0.0 =:= 0.0/-1

-

However, Erlangs hash functions: hash, phash and - phash2 did not reflect this behaviour. The hash values - produced by the different hash functions would not be - identical for positive and negative zero.

This - change ensures that hash value of positive zero is always - produced regardless of the signedness of the zero float, - i.e.,

-

- true = erlang:phash2(0.0) =:= - erlang:phash2(0.0/-1)

-

- Own Id: OTP-12641

-
- -

- Ensure NIF term creation disallows illegal floating point - values and too long atoms. Such values will cause a NIF - to throw badarg exception when it returns.

-

- Own Id: OTP-12655

-
- -

- Fixed building of Map results from match_specs

-

- A faulty "box-value" entered into the heap which could - cause a segmentation fault in the garbage collector if it - was written on a heap fragment.

-

- Own Id: OTP-12656

-
- -

- Fix hipe bug when matching a "writable" binary. The bug - has been seen to sometimes cause a failed binary matching - of a correct utf8 character, but other symptoms are also - possible.

-

- Own Id: OTP-12667

-
- -

- Keep dirty schedulers from waking other schedulers.

-

- Own Id: OTP-12685

-
- -

- Disable floating point exceptions if the VM is compiled - by clang/llvm. This is a known long-standing problem in - clang/llvm.

-

- Own Id: OTP-12717

-
- -

- Fix bug in file:sendfile for FreeBSD causing not - the entire file to be sent.

-

- Own Id: OTP-12720

-
-
-
- - -
Improvements and New Features - - -

- Add md5 and module entries to - ?MODULE:module_info/0/1 and remove obsolete entry - 'import'.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-11940

-
- -

- Debug function erlang:display/1 shows content of - binaries and bitstrings, not only the length.

-

- Own Id: OTP-11941

-
- -

The time functionality of Erlang has been extended. - This both includes a new - API for time, as well as time warp - modes which alters the behavior of the system - when system time changes. You are strongly encouraged - to use the new API instead of the old API based on - erlang:now/0. - erlang:now/0 has been deprecated since it is and - forever will be a scalability bottleneck. For more - information see the Time and Time - Correction chapter of the ERTS User's - Guide.

-

Besides the API changes and time warp modes a lot of - scalability and performance improvements regarding time - management has been made internally in the runtime - system. Examples of such improvements are scheduler - specific timer wheels, scheduler specific BIF timer - management, parallel retrieval of monotonic time and - system time on systems with primitives that are not - buggy.

-

- Own Id: OTP-11997

-
- -

erlang:function_exported(M, F, A) will now - return true if M:F/A refers to a BIF.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-12099

-
- -

- New BIF: erlang:get_keys/0, lists all keys - associated with the process dictionary. Note: - erlang:get_keys/0 is auto-imported.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-12151 Aux Id: seq12521

-
- -

- Make distributed send of large messages yield to improve - real-time characteristics.

-

- Own Id: OTP-12232

-
- -

- Use high accuracy poll timeouts

-

- Where available, use poll/select API's that can handle - time resolutions less than 1ms. In the cases where such - API's are not available the timeout is rounded up to the - nearest ms.

-

- Own Id: OTP-12236

-
- -

- The internal group to user_drv protocol has been changed - to be synchronous in order to guarantee that output sent - to a process implementing the user_drv protocol is - printed before replying. This protocol is used by the - standard_output device and the ssh application when - acting as a client.

-

- This change changes the previous unlimited buffer when - printing to standard_io and other devices that end up in - user_drv to 1KB.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-12240

-
- -

The previously introduced "eager check I/O" feature is - now enabled by default.

-

Eager check I/O can be disabled using the erl - command line argument: +secio false

-

Characteristics impact compared to previous - default:

Lower latency and smoother - management of externally triggered I/O operations. - A slightly reduced priority of externally triggered - I/O operations. -

- Own Id: OTP-12254 Aux Id: OTP-12117

-
- -

- Properly support maps in match_specs

-

- Own Id: OTP-12270

-
- -

- The notice that a crashdump has been written has been - moved to be printed before the crashdump is generated - instead of afterwords. The wording of the notice has also - been changed.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-12292

-
- -

- New function ets:take/2. Works the same as - ets:delete/2 but also returns the deleted - object(s).

-

- Own Id: OTP-12309

-
- -

- Tracing with cpu_timestamp option has been enabled on - Linux.

-

- Own Id: OTP-12366

-
- -

- ets:info/1,2 now contains information about whether - write_concurrency or read_concurrency is enabled.

-

- Own Id: OTP-12376

-
- -

- Improved usage of gcc's builtins for atomic memory - access. These are used when no other implementation of - atomic memory operations is available. For example, when - compiling for ARM when libatomic_ops is not - available.

-

- The largest improvement will be seen when compiling with - a gcc with support for the __atomic_* - builtins (using a gcc of at least version 4.7), - but also when only the legacy __sync_* builtins - are available (using a gcc of at least version - 4.1) an improvement can be seen.

-

- For more information see the "Atomic - Memory Operations and the VM" section of - $ERL_TOP/HOWTO/INSTALL.md.

-

- Own Id: OTP-12383

-
- -

- Introduce math:log2/1 function to math module.

-

- Own Id: OTP-12411

-
- -

- Remove perfctr support

-

- Development of perfctr in the linux kernel ceased in - 2010. The perfctr support code in the Erlang VM is thus - effectively dead code and therefor removed.

-

- Own Id: OTP-12508

-
- -

zlib:inflateChunk/2 has been added. It works - like zlib:inflate/2, but decompresses no more data - than will fit in the buffer configured by - zlib:setBufSize/2.

-

- Own Id: OTP-12548

-
- -

- Use linear search for small select_val arrays

-

- Own Id: OTP-12555

-
- -

- New BIF ets:update_counter/4 with a default object as - argument, which will be inserted in the table if the key - was not found.

-

- Own Id: OTP-12563

-
- -

- Export missing types from zlib module

-

- Own Id: OTP-12584

-
- -

- Use persistent hashmaps for large Maps

Maps will use a - persistent hashmap implementation when the number of - pairs in a Map becomes sufficiently large. The change - will occur when a Map reaches 33 pairs in size but this - limit might change in the future.

-

The most significant impact for the user by this - change is speed, and to a lesser degree memory - consumption and introspection of Maps. Memory consumption - size is probalistic but lesser than gb_trees or - dict for instance. Any other impacts will be - transparent for the user except for the following - changes.

-

Semantics of Maps have changed in two incompatible - ways compared to the experimental implementation in OTP - 17:

Hashing of maps is done different by - erlang:phash2/1,2, erlang:phash/1 and - erlang:hash/2. Comparing two maps - with ==, /=, =<, <, >= and >, is done - different if the keys contain floating point - numbers. -

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-12585

-
- -

- Scalability improvement for erlang:make_ref/0, - and other functionality that create references. Each - scheduler now manage its own set of references. By this - no communication at all is needed when creating - references.

-

- Previous implementation generated a strictly - monotonically increasing sequence of references - corresponding to creation time on the runtime system - instance. This is not the case with current - implementation. You can only expect reference to be - unique. The Erlang/OTP documentation has never mentioned - anything else but the uniqueness property, so this change - is fully compatible. The only reason we've - marked this as a potential incompatibility is since an - early draft for an Erlang specification mentions strict - monotonicity as a property.

-

- If you need to create data with a strict monotonicity - property use erlang:unique_integer([monotonic]). - Do not use the deprecated erlang:now().

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-12610

-
- -

- Enable different abort signal from heart

-

By using environment variable HEART_KILL_SIGNAL, heart - can now use a different signal to kill the old running - Erlang.

-

By default the signal is SIGKILL but SIGABRT may also - be used by setting environment variable: - HEART_KILL_SIGNAL=SIGABRT

-

- Own Id: OTP-12613 Aux Id: seq12826

-
- -

- Update autconf to latest version 2015-03-04

-

- Own Id: OTP-12646

-
- -

- Optimization of timers internally in the VM. This include - process timers (receive ... after), port timers - (driver_set_timer()) as well as BIF timers - (erlang:send_after()/erlang:start_timer()).

-

- Each scheduler thread now has its own lock-free timer - service instead of one locked central service. This - dramatically improves performance of timer management on - systems with a large amount of schedulers and timers.

-

- The timer service internal data structure has also been - optimized to be able to handle more timers than before. - That is, each timer service is by its self able to handle - more timers without dramatic performance loss than the - old centralized timer service.

-

- The API of BIF timers has also been extended. Timeout - values are for example no longer limited to 32-bit - integers. For more information see the documentation of - erlang:start_timer/4, - erlang:send_after/4, - erlang:cancel_timer/2, - and erlang:read_timer/2.

-

- Own Id: OTP-12650 Aux Id: OTP-11997

-
- -

- Specialize instructions from common assembler patterns

-

Specialize common instructions of rem, - band, minus and plus in the beam - loader. This will reduce the number of fetches and thus - lessen the instruction dispatch pressure during runtime - and speed up those operations in some common cases.

-

Specialize move patterns from x-registers to the stack - with a new move_window instruction. This change - will reduce instruction dispatch pressure.

-

- Own Id: OTP-12690

-
- -

- Fix cross compilation for Android.

-

- Own Id: OTP-12693

-
- -

- Fix incorrect use of autoconf macro AC_EGREP_CPP, which - could cause faulty configuration if run from a path - containing the string 'yes'.

-

- Own Id: OTP-12706

-
- -

- Minimal Java version is now 1.6

-

- Own Id: OTP-12718

-
- -

- Send format and args on process exit to error_logger

-

- Previously, the emulator would generate a whole string - with values and call the error_logger passing - "~s~n". This changes it to a format string - containing ~p with the respective values as - arguments.

-

- Own Id: OTP-12735

-
-
-
- -
-
Erts 6.4.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 4c4d7fa40e5fb59854724ce74b8aa3546525cb90 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Fri, 17 Apr 2015 22:04:31 +0200 Subject: Map error logger warnings to warning messages by default Also fix and document the broken +We option. --- erts/doc/src/erl.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index ea94a4e82b..98d05dc7de 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1322,13 +1322,14 @@

Verbose.

- +

Sets the mapping of warning messages for . Messages sent to the error logger using one of the warning - routines can be mapped either to errors (default), warnings - (), or info reports (). The current - mapping can be retrieved using + routines can be mapped either to errors (), + warnings (), or info reports + (). The default is warnings. + The current mapping can be retrieved using . See error_logger(3) for further information.

-- cgit v1.2.3 From 4034b89a07a97766dba5e6213b1eb4d76ba6df9e Mon Sep 17 00:00:00 2001 From: Zandra Hird Date: Wed, 20 May 2015 15:35:49 +0200 Subject: Revert "Map error logger warnings to warning messages by default" This reverts commit 4c4d7fa40e5fb59854724ce74b8aa3546525cb90. This pr is causing some test failures that were missed at first. --- erts/doc/src/erl.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 98d05dc7de..ea94a4e82b 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1322,14 +1322,13 @@

Verbose.

- +

Sets the mapping of warning messages for . Messages sent to the error logger using one of the warning - routines can be mapped either to errors (), - warnings (), or info reports - (). The default is warnings. - The current mapping can be retrieved using + routines can be mapped either to errors (default), warnings + (), or info reports (). The current + mapping can be retrieved using . See error_logger(3) for further information.

-- cgit v1.2.3 From 441842ce023bf8ef5dc84f2d5061b0b7c79c8130 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Fri, 17 Apr 2015 22:04:31 +0200 Subject: Map error logger warnings to warning messages by default Also fix and document the broken +We option. --- erts/doc/src/erl.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index ea94a4e82b..98d05dc7de 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1322,13 +1322,14 @@

Verbose.

- +

Sets the mapping of warning messages for . Messages sent to the error logger using one of the warning - routines can be mapped either to errors (default), warnings - (), or info reports (). The current - mapping can be retrieved using + routines can be mapped either to errors (), + warnings (), or info reports + (). The default is warnings. + The current mapping can be retrieved using . See error_logger(3) for further information.

-- cgit v1.2.3 From 9e2a3c9f5666676038b98092756e3560f285d4c5 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 13 May 2015 15:58:36 +0200 Subject: Doc fixes --- erts/doc/src/erlang.xml | 358 +++++++++++++++++++++++++----------------------- 1 file changed, 189 insertions(+), 169 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 6ca57566aa..3fea64cef5 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -539,55 +539,94 @@ Cancel a timer -

Cancels a timer. TimerRef needs to refer to - a timer that was created by either - erlang:send_after(), - or erlang:start_timer().

-

Currently available Options:

+

+ Cancels a timer that has been created by either + erlang:start_timer(), + or erlang:send_after(). + TimerRef identifies the timer, and + was returned by the BIF that created the timer. +

+

Currently available Options:

{async, Async} -

Asynchronous request for cancellation. Async - defaults to false. That is the operation will be - performed synchronously. When Async is set to - true the cancel operation will be performed - asynchronously. That is, cancel_timer() will send - a request for cancellation to the timer service that - manages the timer, and then return ok.

+

+ Asynchronous request for cancellation. Async + defaults to false which will cause the + cancellation to be performed synchronously. When + Async is set to true, the cancel + operation will be performed asynchronously. That is, + erlang:cancel_timer() will send an asynchronous + request for cancellation to the timer service that + manages the timer, and then return ok. +

+
{info, Info} -

Request information about the Result of the - cancellation. Info defaults to true. That - is information will be given. When Info is set to - false no information about the result of the cancel - operation will be given. When the operation is performed - synchronously the Result will returned from - cancel_timer(). When the operation is performed - asynchronously, a message on the form - {cancel_timer, TimerRef, Result} - will be sent to the caller of cancel_timer() when - the operation has been performed.

+

+ Request information about the Result + of the cancellation. Info defaults to true + which means that the Result will + be given. When Info is set to false, no + information about the result of the cancellation + will be given. When the operation is performed

+ + synchronously + +

+ If Info is true, the Result will + returned by erlang:cancel_timer(); otherwise, + ok will be returned. +

+
+ asynchronously + +

+ If Info is true, a message on the form + {cancel_timer, TimerRef, + Result} will be sent to the + caller of erlang:cancel_timer() when the + cancellation operation has been performed; otherwise, + no message will be sent. +

+
+
+
-

When the Result equals false a timer - corresponding to TimerRef could not be found. This - can be either because the timer had expired, been canceled, or because - TimerRef do not correspond to a timer. When the - Result is an integer, it represents - the time in milli seconds left before the timer will expire.

-

The timer service that manages the timer may be co-located - with another scheduler than the scheduler that the calling process - is executing on. In this case communication with the timer - service will be performed using asynchronous signals. If the calling - process is in critical path and can do other things while waiting - for the result of this operation, you want to use the {async, true} - option.

+

+ More Options may be added in the future. +

+

+ When the Result equals false, a + timer corresponding to TimerRef could not + be found. This can be either because the timer had expired, + already had been canceled, or because TimerRef + never has corresponded to a timer. If the timer has expired, + the timeout message has been sent, but it does not tell you + whether or not it has arrived at its destination yet. When the + Result is an integer, it represents the + time in milli-seconds left until the timer will expire. +

+ +

+ The timer service that manages the timer may be co-located + with another scheduler than the scheduler that the calling + process is executing on. If this is the case, communication + with the timer service will take much longer time than if it + is located locally. If the calling process is in critical + path, and can do other things while waiting for the result + of this operation, or is not interested in the result of + the operation, you want to use the {async, true} + option. If using the {async, false} option, the calling + process will be blocked until the operation has been + performed. +

+

See also erlang:send_after/4, erlang:start_timer/4, and erlang:read_timer/2.

-

Note: Cancelling a timer does not guarantee that the message - has not already been delivered to the message queue.

@@ -596,7 +635,7 @@

Cancels a timer. The same as calling erlang:cancel_timer(TimerRef, - [{async, false}, {info, true}]).

+ []).

@@ -4548,37 +4587,60 @@ os_prompt% Read the state of a timer -

Read the state of a timer. TimerRef - needs to refer to a timer that was created by either - erlang:send_after(), - or erlang:start_timer().

+

+ Read the state of a timer that has been created by either + erlang:start_timer(), + or erlang:send_after(). + TimerRef identifies the timer, and + was returned by the BIF that created the timer. +

Currently available Options:

{async, Async} -

Asynchronous request. Async defaults to false. That - is the operation will be performed synchronously, and the Result - will returned from read_timer(). When Async is set to - true, read_timer() will send a request for the - Result to a timer service that manages the timer and then - return ok. A message on the format - {read_timer, TimerRef, Result} - will be sent to the caller of read_timer() when - the operation has been processed.

+

+ Asynchronous request for state information. Async + defaults to false which will cause the operation + to be performed synchronously. In this case, the Result + will be returned by erlang:read_timer(). When + Async is set to true, erlang:read_timer() + will send an asynchronous request for the state information + to the timer service that manages the timer, and then return + ok. A message on the format {read_timer, + TimerRef, Result} will be + sent to the caller of erlang:read_timer() when the + operation has been processed. +

+
-

When the Result equals false a timer - corresponding to TimerRef could not be found. This - can be either because the timer had expired, been canceled, or because - TimerRef do not correspond to a timer. When the - Result is an integer, it represents - the time in milli seconds left before the timer will expire.

-

The timer service that manages the timer may be co-located - with another scheduler than the scheduler that the calling process - is executing on. In this case communication with the timer - service will be performed using asynchronous signals. If the calling - process is in critical path and can do other things while waiting - for the result of this operation, you want to use the {async, true} - option.

+

+ More Options may be added in the future. +

+

+ When the Result equals false, a + timer corresponding to TimerRef could not + be found. This can be either because the timer had expired, + had been canceled, or because TimerRef + never has corresponded to a timer. If the timer has expired, + the timeout message has been sent, but it does not tell you + whether or not it has arrived at its destination yet. When the + Result is an integer, it represents the + time in milli-seconds left until the timer will expire. +

+ +

+ The timer service that manages the timer may be co-located + with another scheduler than the scheduler that the calling + process is executing on. If this is the case, communication + with the timer service will take much longer time than if it + is located locally. If the calling process is in critical + path, and can do other things while waiting for the result + of this operation you want to use the {async, true} + option. If using the {async, false} option, the calling + process will be blocked until the operation has been + performed. +

+

See also erlang:send_after/4, erlang:start_timer/4, @@ -4592,7 +4654,7 @@ os_prompt%

Read the state of a timer. The same as calling erlang:read_timer(TimerRef, - [{async, false}]).

+ []).

@@ -4744,48 +4806,14 @@ true Start a timer -

Starts a timer. When the timer expires, the message - Msg will be sent to - Dest.

-

If Dest is a pid() it has to - be a pid() of a local process, dead or alive.

-

Currently available Options:

- - {abs, Abs} - -

Absolute timeout. When Abs is false - the Time value will be interpreted - as a time in milli-seconds relative current - Erlang - monotonic time. When Abs is true the - Time value will be interpreted as an absolute - Erlang monotonic time of milli second time unit. Abs - defaults to false.

-
-
-

The absolute time when the timer is set to expire needs - to be in the range between - erlang:system_info(start_time) - and - erlang:system_info(end_time). - If a negative relative time is specified the time is not - allowed to be negative.

-

If Dest is an atom(), it is supposed to be the name of - a registered process. The process referred to by the name is - looked up at the time of delivery. No error is given if - the name does not refer to a process.

-

If Dest is a pid(), the timer will be automatically - canceled if the process referred to by the pid() is not alive, - or when the process exits. This feature was introduced in - erts version 5.4.11. Note that timers will not be - automatically canceled when Dest is an atom().

-

See also - erlang:send_timer/4, - erlang:cancel_timer/2, - and - erlang:read_timer/2.

-

Failure: badarg if the arguments does not satisfy - the requirements specified above.

+

+ Starts a timer. When the timer expires, the message + Msg will be sent to the process + identified by Dest. Appart from + the format of the message sent to + Dest when the timer expires + erlang:send_after/4 works exactly as + erlang:start_timer/4.

@@ -4793,36 +4821,8 @@ true Start a timer

Starts a timer. The same as calling - erlang:send_after(Time, - Dest, Msg, [{abs, false}]).

-
-
- - - 0 <= Time <= 4294967295 - Start a timer - -

Starts a timer which will send the message Msg - to Dest after Time milliseconds.

-

If Dest is a pid() it has to be a pid() of a local process, dead or alive.

-

The Time value can, in the current implementation, not be greater than 4294967295.

-

If Dest is an atom(), it is supposed to be the name of - a registered process. The process referred to by the name is - looked up at the time of delivery. No error is given if - the name does not refer to a process.

- -

If Dest is a pid(), the timer will be automatically - canceled if the process referred to by the pid() is not alive, - or when the process exits. This feature was introduced in - erts version 5.4.11. Note that timers will not be - automatically canceled when Dest is an atom.

-

See also - erlang:start_timer/3, - erlang:cancel_timer/2, - and - erlang:read_timer/2.

-

Failure: badarg if the arguments does not satisfy - the requirements specified above.

+ erlang:send_after(Time, + Dest, Msg, []).

@@ -5231,41 +5231,59 @@ true Start a timer -

Starts a timer. When the timer expires, the message +

+ Starts a timer. When the timer expires, the message {timeout, TimerRef, Msg} - will be sent to Dest.

-

If Dest is a pid() it has to - be a pid() of a local process, dead or alive.

-

Currently available Options:

+ will be sent to the process identified by + Dest. +

+

Currently available Options:

{abs, Abs} -

Absolute timeout. When Abs is false - the Time value will be interpreted - as a time in milli-seconds relative current - Erlang - monotonic time. When Abs is true the - Time value will be interpreted as an absolute - Erlang monotonic time of milli second time unit. Abs - defaults to false.

+

+ Absolute Time value. Abs + defaults to false which means that the + Time value will be interpreted + as a time in milli-seconds relative current + Erlang + monotonic time. When Abs is set to + true, the Time value will + be interpreted as an absolute Erlang monotonic time of + milli-seconds + time unit. +

-

The absolute time when the timer is set to expire needs - to be in the range between - erlang:system_info(start_time) - and - erlang:system_info(end_time). - If a negative relative time is specified the time is not - allowed to be negative.

-

If Dest is an atom(), it is supposed to be the name of - a registered process. The process referred to by the name is - looked up at the time of delivery. No error is given if - the name does not refer to a process.

-

If Dest is a pid(), the timer will be automatically - canceled if the process referred to by the pid() is not alive, - or when the process exits. This feature was introduced in - erts version 5.4.11. Note that timers will not be - automatically canceled when Dest is an atom().

+

+ More Options may be added in the future. +

+

+ The absolute point in time that the timer is set to expire on + has to be in the interval + [erlang:system_info(start_time), + erlang:system_info(end_time)]. + Further, if a relative time is specified, the Time value + is not allowed to be negative. +

+

+ If Dest is a pid(), it has to + be a pid() of a process created on the current + runtime system instance. This process may or may not + have terminated. If Dest is an + atom(), it will be interpreted as the name of a + locally registered process. The process referred to by the + name is looked up at the time of timer expiration. No error + is given if the name does not refer to a process. +

+

+ If Dest is a pid(), the timer will + be automatically canceled if the process referred to by the + pid() is not alive, or when the process exits. This + feature was introduced in erts version 5.4.11. Note that + timers will not be automatically canceled when + Dest is an atom(). +

See also erlang:send_after/4, erlang:cancel_timer/2, @@ -5281,7 +5299,7 @@ true

Starts a timer. The same as calling erlang:start_timer(Time, - Dest, Msg, [{abs, false}]).

+ Dest, Msg, []).

@@ -6845,7 +6863,9 @@ ok

The Erlang monotonic time in native time unit at the - time when current Erlang runtime system instance started.

+ time when current Erlang runtime system instance started. See also + erlang:system_info(end_time). +

system_version

Returns a string containing version number and -- cgit v1.2.3 From 884afd8efb8672df2889df98b5b94f3dbb53952c Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Mon, 27 Apr 2015 23:39:37 -0400 Subject: Enhance enif_has_pending_exception Sverker Eriksson came up with the following idea: to handle a future ability for NIFs to raise more than just badarg exceptions, modify the recently-added enif_has_pending_exception function to take a second argument: a pointer to ERL_NIF_TERM. If this argument is a null pointer, ignore it. Otherwise, if the first argument, an ErlNifEnv*, has an associated exception, set the pointed-to ERL_NIF_TERM of the second argument to the value of the exception term. Add new tests and documentation for this modification. --- erts/doc/src/erl_nif.xml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 4bad8b253c..155aee2f42 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -778,11 +778,17 @@ typedef enum { and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

- intenif_has_pending_exception(ErlNifEnv* env) + intenif_has_pending_exception(ErlNifEnv* env, ERL_NIF_TERM* reason) Check if an exception has been raised.

Return true if a pending exception is associated - with the environment env. The only possible exception is currently - badarg (see enif_make_badarg).

+ with the environment env. If reason is a null pointer, ignore it. + Otherwise, if there's a pending exception associated with env, set the ERL_NIF_TERM + to which reason points to the value of the exception's term. For example, if + enif_make_badarg is called to set a + pending badarg exception, a subsequent call to enif_has_pending_exception(env, &reason) + will set reason to the atom badarg, then return true.

+

See also: enif_make_badarg.

+
intenif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin) Inspect the content of a binary -- cgit v1.2.3 From 17735c9f3879145f43a3e4be0369b7117b1b7b84 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Wed, 6 May 2015 23:15:04 -0400 Subject: Add enif_raise_exception Add enif_raise_exception function to allow NIFs to raise error exceptions holding any Erlang terms. This does not replace or deprecate the enif_make_badarg function, though, because raising badarg errors is so idiomatic in NIFs. Reimplement enif_make_badarg on top of enif_raise_exception. Add new tests for enif_raise_exception for both normal and dirty NIFs. Add documentation for enif_raise_exception. --- erts/doc/src/erl_nif.xml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 155aee2f42..104d90c937 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -787,7 +787,8 @@ typedef enum { enif_make_badarg is called to set a pending badarg exception, a subsequent call to enif_has_pending_exception(env, &reason) will set reason to the atom badarg, then return true.

-

See also: enif_make_badarg.

+

See also: enif_make_badarg + and enif_raise_exception.

intenif_inspect_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, ErlNifBinary* bin) @@ -902,12 +903,13 @@ typedef enum { it calls invokes enif_make_badarg, the runtime ensures that a badarg exception is raised when the NIF returns, even if the NIF attempts to return a non-exception term instead. - The return value from enif_make_badarg may only be used as - return value from the NIF that invoked it (direct or indirectly) + The return value from enif_make_badarg may be used only as the + return value from the NIF that invoked it (directly or indirectly) or be passed to enif_is_exception, but not to any other NIF API function.

-

See also: enif_has_pending_exception. +

See also: enif_has_pending_exception + and enif_raise_exception

In earlier versions (older than erts-7.0, OTP 18) the return value from enif_make_badarg had to be returned from the NIF. This @@ -1174,6 +1176,19 @@ typedef enum { reload or upgrade.

Was previously named enif_get_data.

+ ERL_NIF_TERMenif_raise_exception(ErlNifEnv* env, ERL_NIF_TERM reason) + Raise a NIF error exception +

Create an error exception with the term reason to be returned from a NIF, + and associate it with the environment env. Once a NIF or any function it calls + invokes enif_raise_exception, the runtime ensures that the exception it creates + is raised when the NIF returns, even if the NIF attempts to return a non-exception + term instead. The return value from enif_raise_exception may be used only as + the return value from the NIF that invoked it (directly or indirectly) or be passed + to enif_is_exception, but + not to any other NIF API function.

+

See also: enif_has_pending_exception + and enif_make_badarg.

+
intenif_realloc_binary(ErlNifBinary* bin, size_t size) Change the size of a binary.

Change the size of a binary bin. The source binary -- cgit v1.2.3 From 264c4d037618a5ca8f55001855cb422d0bb5d136 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 27 May 2015 17:55:08 +0200 Subject: erts: Add docs for map functions in nif API --- erts/doc/src/erl_nif.xml | 129 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 121 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 4bad8b253c..2cc06de0e0 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -461,8 +461,9 @@ ok independent environment with all its terms is valid until you explicitly invalidates it with enif_free_env or enif_send.

-

All elements of a list/tuple must belong to the same environment as the - list/tuple itself. Terms can be copied between environments with +

All contained terms of a list/tuple/map must belong to the same + environment as the list/tuple/map itself. Terms can be copied between + environments with enif_make_copy.

ErlNifFunc @@ -729,7 +730,18 @@ typedef enum { return true, or return false if term is not an integer or is outside the bounds of type long int.

- intenif_get_resource(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifResourceType* type, void** objp) + intenif_get_map_size(ErlNifEnv* env, ERL_NIF_TERM term, size_t *size) + Read the size of a map term +

Set *size to the number of key-value pairs in the map term and + return true, or return false if term is not a map.

+
+ intenif_get_map_value(ErlNifEnv* env, ERL_NIF_TERM map, ERL_NIF_TERM key, ERL_NIF_TERM* value) + Get the value of a key in a map +

Set *value to the value associated with key in the + map map and return true. Return false if map is not a map + or if map does not contain key.

+
+ intenif_get_resource(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifResourceType* type, void** objp) Get the pointer to a resource object

Set *objp to point to the resource object referred to by term.

Return true on success or false if term is not a handle to a resource object @@ -817,6 +829,10 @@ typedef enum { Determine if a term is an exception

Return true if term is an exception.

+ intenif_is_map(ErlNifEnv* env, ERL_NIF_TERM term) + Determine if a term is a map +

Return true if term is a map, false otherwise.

+
intenif_is_number(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is a number (integer or float)

Return true if term is a number.

@@ -986,12 +1002,13 @@ typedef enum {

Create an ordinary list containing the elements of array arr of length cnt. An empty list is returned if cnt is 0.

- intenif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM term, ERL_NIF_TERM *list) - Create the reverse list of the list term. -

Set *list to the reverse list of the list term and return true, - or return false if term is not a list. This function should only be used on + intenif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM list_in, ERL_NIF_TERM *list_out) + Create the reverse of a list +

Set *list_out to the reverse list of the list list_in and return true, + or return false if list_in is not a list. This function should only be used on short lists as a copy will be created of the list which will not be released until after the - nif returns.

+ nif returns.

+

The list_in term must belong to the environment env.

ERL_NIF_TERMenif_make_long(ErlNifEnv* env, long int i) Create an integer term from a long int @@ -1007,6 +1024,36 @@ typedef enum { reallocated.

Return a pointer to the raw binary data and set *termp to the binary term.

+ ERL_NIF_TERMenif_make_new_map(ErlNifEnv* env) + Make an empty map term +

Make an empty map term.

+
+ intenif_make_map_put(ErlNifEnv* env, ERL_NIF_TERM map_in, ERL_NIF_TERM key, ERL_NIF_TERM value, ERL_NIF_TERM* map_out) + Insert key-value pair in map +

Make a copy of map map_in and insert key with + value. If key already exists in map_in, the old + associated value is replaced by value. If successful set + *map_out to the new map and return true. Return false if + map_in is not a map.

+

The map_in term must belong to the environment env.

+
+ intenif_make_map_update(ErlNifEnv* env, ERL_NIF_TERM map_in, ERL_NIF_TERM key, ERL_NIF_TERM new_value, ERL_NIF_TERM* map_out) + Replace value for key in map +

Make a copy of map map_in and replace the old associated + value for key with new_value. If successful set + *map_out to the new map and return true. Return false if + map_in is not a map or if it does no contain key.

+

The map_in term must belong to the environment env.

+
+ intenif_make_map_remove(ErlNifEnv* env, ERL_NIF_TERM map_in, ERL_NIF_TERM key, ERL_NIF_TERM* map_out) + Remove key from map +

If map map_in contains key, make a copy of + map_in in *map_out and remove key and associated + value. If map map_in does not contain key, set + *map_out to map_in. Return true for success or false if + map_in is not a map.

+

The map_in term must belong to the environment env.

+
ERL_NIF_TERMenif_make_pid(ErlNifEnv* env, const ErlNifPid* pid) Make a pid term

Make a pid term from *pid.

@@ -1108,6 +1155,72 @@ typedef enum { Create an integer term from an unsigned long int

Create an integer term from an unsigned long int.

+ intenif_map_iterator_create(ErlNifEnv *env, ERL_NIF_TERM map, ErlNifMapIterator *iter, ErlNifMapIteratorEntry entry) + Create a map iterator +

Create an iterator for the map map by initializing the + structure pointed to by iter. The entry argument determines + the start position of the iterator: ERL_NIF_MAP_ITERATOR_FIRST or + ERL_NIF_MAP_ITERATOR_LAST. Return true on success or false if + map is not a map.

+

A map iterator is only useful during the lifetime of the environment + env that the map belongs to. The iterator must be destroyed by + calling + enif_map_iterator_destroy.

+ +ERL_NIF_TERM key, value; +ErlNifMapIterator iter; +enif_map_iterator_create(env, my_map, ERL_NIF_MAP_ITERATOR_FIRST); + +while (enif_map_iterator_get_pair(env, &iter, &key, &value)) { + do_something(key,value); + enif_map_iterator_next(env, &iter); +} +enif_map_iterator_destroy(env, &iter); + +

The key-value pairs of a map have no defined iteration + order. The only guarantee is that the iteration order of a single map + instance is preserved during the lifetime of the environment that the map + belongs to.

+
+
+
+ voidenif_map_iterator_destroy(ErlNifEnv *env, ErlNifMapIterator *iter) + Destroy a map iterator +

Destroy a map iterator created by + enif_map_iterator_create. +

+
+ intenif_map_iterator_get_pair(ErlNifEnv *env, ErlNifMapIterator *iter, ERL_NIF_TERM *key, ERL_NIF_TERM *value) + Get key and value at current map iterator position +

Get key and value terms at current map iterator position. + On success set *key and *value and return true. + Return false if the iterator is positioned at head (before first entry) + or tail (beyond last entry).

+
+ intenif_map_iterator_is_head(ErlNifEnv *env, ErlNifMapIterator *iter) + Check if map iterator is positioned before first +

Return true if map iterator iter is positioned + before first entry.

+
+ intenif_map_iterator_is_tail(ErlNifEnv *env, ErlNifMapIterator *iter) + Check if map iterator is positioned after last +

Return true if map iterator iter is positioned + after last entry.

+
+ intenif_map_iterator_next(ErlNifEnv *env, ErlNifMapIterator *iter) + Increment map iterator to point to next entry +

Increment map iterator to point to next key-value entry. + Return true if the iterator is now positioned at a valid key-value entry, + or false if the iterator is positioned at the tail (beyond the last + entry).

+
+ intenif_map_iterator_prev(ErlNifEnv *env, ErlNifMapIterator *iter) + Decrement map iterator to point to previous entry +

Decrement map iterator to point to previous key-value entry. + Return true if the iterator is now positioned at a valid key-value entry, + or false if the iterator is positioned at the head (before the first + entry).

+
ErlNifMutex *enif_mutex_create(char *name)

Same as erl_drv_mutex_create. -- cgit v1.2.3 From 7d60e4c592399c2e375a10338015e168a09d16a3 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 28 May 2015 12:30:15 +0200 Subject: erts: Fix alphabetic order in erl_nif doc enif_make_reverse_list was at the wrong place --- erts/doc/src/erl_nif.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 2cc06de0e0..6a4fe5f8b7 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1002,14 +1002,6 @@ typedef enum {

Create an ordinary list containing the elements of array arr of length cnt. An empty list is returned if cnt is 0.

- intenif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM list_in, ERL_NIF_TERM *list_out) - Create the reverse of a list -

Set *list_out to the reverse list of the list list_in and return true, - or return false if list_in is not a list. This function should only be used on - short lists as a copy will be created of the list which will not be released until after the - nif returns.

-

The list_in term must belong to the environment env.

-
ERL_NIF_TERMenif_make_long(ErlNifEnv* env, long int i) Create an integer term from a long int

Create an integer term from a long int.

@@ -1097,6 +1089,14 @@ typedef enum { enif_release_resource.

+ intenif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM list_in, ERL_NIF_TERM *list_out) + Create the reverse of a list +

Set *list_out to the reverse list of the list list_in and return true, + or return false if list_in is not a list. This function should only be used on + short lists as a copy will be created of the list which will not be released until after the + nif returns.

+

The list_in term must belong to the environment env.

+
ERL_NIF_TERMenif_make_string(ErlNifEnv* env, const char* string, ErlNifCharEncoding encoding) Create a string.

Create a list containing the characters of the -- cgit v1.2.3 From a519a52617a6a5bbdb8b17bdd892ab012cf8080b Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 28 May 2015 12:33:11 +0200 Subject: erts: Cleanup fsummary lines in erl_nif docs by removing all full stop. --- erts/doc/src/erl_nif.xml | 64 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 6a4fe5f8b7..e915c3b693 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -565,11 +565,11 @@ typedef enum { void *enif_alloc(size_t size) - Allocate dynamic memory. + Allocate dynamic memory

Allocate memory of size bytes. Return NULL if allocation failed.

intenif_alloc_binary(size_t size, ErlNifBinary* bin) - Create a new binary. + Create a new binary

Allocate a new binary of size size bytes. Initialize the structure pointed to by bin to refer to the allocated binary. The binary must either be released by @@ -596,7 +596,7 @@ typedef enum {

Allocate a memory managed resource object of type type and size size bytes.

voidenif_clear_env(ErlNifEnv* env) - Clear an environment for reuse. + Clear an environment for reuse

Free all terms in an environment and clear it for reuse. The environment must have been allocated with enif_alloc_env.

@@ -684,14 +684,14 @@ typedef enum { size-1.

intenif_get_atom_length(ErlNifEnv* env, ERL_NIF_TERM term, unsigned* len, ErlNifCharEncoding encode) - Get the length of atom term. + Get the length of atom term

Set *len to the length (number of bytes excluding terminating null character) of the atom term with encoding encode. Return true on success or false if term is not an atom.

intenif_get_double(ErlNifEnv* env, ERL_NIF_TERM term, double* dp) - Read a floating-point number term. + Read a floating-point number term

Set *dp to the floating point value of term. Return true on success or false if term is not a float.

@@ -720,12 +720,12 @@ typedef enum { non-empty list.

intenif_get_list_length(ErlNifEnv* env, ERL_NIF_TERM term, unsigned* len) - Get the length of list term. + Get the length of list term

Set *len to the length of list term and return true, or return false if term is not a list.

intenif_get_long(ErlNifEnv* env, ERL_NIF_TERM term, long int* ip) - Read an long integer term. + Read an long integer term

Set *ip to the long integer value of term and return true, or return false if term is not an integer or is outside the bounds of type long int.

@@ -750,7 +750,7 @@ typedef enum { intenif_get_string(ErlNifEnv* env, ERL_NIF_TERM list, char* buf, unsigned size, ErlNifCharEncoding encode) - Get a C-string from a list. + Get a C-string from a list

Write a null-terminated string, in the buffer pointed to by buf with size size, consisting of the characters in the string list. The characters are written using encoding @@ -763,7 +763,7 @@ typedef enum { size is less than 1.

intenif_get_tuple(ErlNifEnv* env, ERL_NIF_TERM term, int* arity, const ERL_NIF_TERM** array) - Inspect the elements of a tuple. + Inspect the elements of a tuple

If term is a tuple, set *array to point to an array containing the elements of the tuple and set *arity to the number of elements. Note that the array @@ -773,25 +773,25 @@ typedef enum { tuple.

intenif_get_uint(ErlNifEnv* env, ERL_NIF_TERM term, unsigned int* ip) - Read an unsigned integer term. + Read an unsigned integer term

Set *ip to the unsigned integer value of term and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned int.

intenif_get_uint64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifUInt64* ip) - Read an unsigned 64-bit integer term. + Read an unsigned 64-bit integer term

Set *ip to the unsigned integer value of term and return true, or return false if term is not an unsigned integer or is outside the bounds of an unsigned 64-bit integer.

intenif_get_ulong(ErlNifEnv* env, ERL_NIF_TERM term, unsigned long* ip) - Read an unsigned integer term. + Read an unsigned integer term

Set *ip to the unsigned long integer value of term and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

intenif_has_pending_exception(ErlNifEnv* env) - Check if an exception has been raised. + Check if an exception has been raised

Return true if a pending exception is associated with the environment env. The only possible exception is currently badarg (see enif_make_badarg).

@@ -906,7 +906,7 @@ typedef enum {

ERL_NIF_TERMenif_make_badarg(ErlNifEnv* env) - Make a badarg exception. + Make a badarg exception

Make a badarg exception to be returned from a NIF, and associate it with the environment env. Once a NIF or any function it calls invokes enif_make_badarg, the runtime ensures that a @@ -925,14 +925,14 @@ typedef enum { if enif_make_badarg has been invoked.

ERL_NIF_TERMenif_make_binary(ErlNifEnv* env, ErlNifBinary* bin) - Make a binary term. + Make a binary term

Make a binary term from bin. Any ownership of the binary data will be transferred to the created term and bin should be considered read-only for the rest of the NIF call and then as released.

ERL_NIF_TERMenif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term) - Make a copy of a term. + Make a copy of a term

Make a copy of term src_term. The copy will be created in environment dst_env. The source term may be located in any environment.

@@ -973,7 +973,7 @@ typedef enum {

Create an integer term from a signed 64-bit integer.

ERL_NIF_TERMenif_make_list(ErlNifEnv* env, unsigned cnt, ...) - Create a list term. + Create a list term

Create an ordinary list term of length cnt. Expects cnt number of arguments (after cnt) of type ERL_NIF_TERM as the elements of the list. An empty list is returned if cnt is 0.

@@ -987,18 +987,18 @@ typedef enum { ERL_NIF_TERMenif_make_list7(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e7) ERL_NIF_TERMenif_make_list8(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e8) ERL_NIF_TERMenif_make_list9(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e9) - Create a list term. + Create a list term

Create an ordinary list term with length indicated by the function name. Prefer these functions (macros) over the variadic enif_make_list to get a compile time error if the number of arguments does not match.

ERL_NIF_TERMenif_make_list_cell(ErlNifEnv* env, ERL_NIF_TERM head, ERL_NIF_TERM tail) - Create a list cell. + Create a list cell

Create a list cell [head | tail].

ERL_NIF_TERMenif_make_list_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt) - Create a list term from an array. + Create a list term from an array

Create an ordinary list containing the elements of array arr of length cnt. An empty list is returned if cnt is 0.

@@ -1051,7 +1051,7 @@ typedef enum {

Make a pid term from *pid.

ERL_NIF_TERMenif_make_ref(ErlNifEnv* env) - Create a reference. + Create a reference

Create a reference like erlang:make_ref/0.

ERL_NIF_TERMenif_make_resource(ErlNifEnv* env, void* obj) @@ -1098,19 +1098,19 @@ typedef enum {

The list_in term must belong to the environment env.

ERL_NIF_TERMenif_make_string(ErlNifEnv* env, const char* string, ErlNifCharEncoding encoding) - Create a string. + Create a string

Create a list containing the characters of the null-terminated string string with encoding encoding.

ERL_NIF_TERMenif_make_string_len(ErlNifEnv* env, const char* string, size_t len, ErlNifCharEncoding encoding) - Create a string. + Create a string

Create a list containing the characters of the string string with length len and encoding encoding. Null-characters are treated as any other characters.

ERL_NIF_TERMenif_make_sub_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, size_t pos, size_t size) - Make a subbinary term. + Make a subbinary term

Make a subbinary of binary bin_term, starting at zero-based position pos with a length of size bytes. bin_term must be a binary or bitstring and @@ -1118,7 +1118,7 @@ typedef enum { bytes in bin_term.

ERL_NIF_TERMenif_make_tuple(ErlNifEnv* env, unsigned cnt, ...) - Create a tuple term. + Create a tuple term

Create a tuple term of arity cnt. Expects cnt number of arguments (after cnt) of type ERL_NIF_TERM as the elements of the tuple.

@@ -1132,14 +1132,14 @@ typedef enum { ERL_NIF_TERMenif_make_tuple7(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e7) ERL_NIF_TERMenif_make_tuple8(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e8) ERL_NIF_TERMenif_make_tuple9(ErlNifEnv* env, ERL_NIF_TERM e1, ..., ERL_NIF_TERM e9) - Create a tuple term. + Create a tuple term

Create a tuple term with length indicated by the function name. Prefer these functions (macros) over the variadic enif_make_tuple to get a compile time error if the number of arguments does not match.

ERL_NIF_TERMenif_make_tuple_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt) - Create a tuple term from an array. + Create a tuple term from an array

Create a tuple containing the elements of array arr of length cnt.

@@ -1282,18 +1282,18 @@ enif_map_iterator_destroy(env, &iter);

Was previously named enif_get_data.

intenif_realloc_binary(ErlNifBinary* bin, size_t size) - Change the size of a binary. + Change the size of a binary

Change the size of a binary bin. The source binary may be read-only, in which case it will be left untouched and a mutable copy is allocated and assigned to *bin. Return true on success, false if memory allocation failed.

voidenif_release_binary(ErlNifBinary* bin) - Release a binary. + Release a binary

Release a binary obtained from enif_alloc_binary.

voidenif_release_resource(void* obj) - Release a resource object. + Release a resource object

Remove a reference to resource object objobtained from enif_alloc_resource. The resource object will be destructed when the last reference is removed. @@ -1369,12 +1369,12 @@ enif_map_iterator_destroy(env, &iter); ErlNifPid *enif_self(ErlNifEnv* caller_env, ErlNifPid* pid) - Get the pid of the calling process. + Get the pid of the calling process

Initialize the pid variable *pid to represent the calling process. Return pid.

intenif_send(ErlNifEnv* env, ErlNifPid* to_pid, ErlNifEnv* msg_env, ERL_NIF_TERM msg) - Send a message to a process. + Send a message to a process

Send a message to a process.

env -- cgit v1.2.3 From 03ae2f86e6a6a4b013fc89a814221fbfe1fe5cf3 Mon Sep 17 00:00:00 2001 From: Tomas Abrahamsson Date: Fri, 5 Jun 2015 18:38:40 +0200 Subject: Add forgotten argument to example in erl_nif doc In the documentation for erl_nif, in the map iterator example, the iterator argument was forgotten in the call to function enif_map_iterator_create. This is now fixed. --- erts/doc/src/erl_nif.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index f64381c99d..412c0e02ac 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1177,7 +1177,7 @@ typedef enum { ERL_NIF_TERM key, value; ErlNifMapIterator iter; -enif_map_iterator_create(env, my_map, ERL_NIF_MAP_ITERATOR_FIRST); +enif_map_iterator_create(env, my_map, &iter, ERL_NIF_MAP_ITERATOR_FIRST); while (enif_map_iterator_get_pair(env, &iter, &key, &value)) { do_something(key,value); -- cgit v1.2.3 From fe1c0d26d4e6180b79fc8497b827ac2ef1f471d5 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 5 Jun 2015 17:25:22 +0200 Subject: Delayed node table GC --- erts/doc/src/erl.xml | 12 ++++++++++++ erts/doc/src/erlang.xml | 10 ++++++++++ 2 files changed, 22 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index ea94a4e82b..00da503469 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1350,6 +1350,18 @@ give lower latency and higher throughput at the expense of higher memory usage.

+ +zdntgc time + +

Set the delayed node table garbage collection time + (delayed_node_table_gc) + in seconds. Valid values are either infinity or + an integer in the range [0-100000000]. Default is 60.

+

Node table entries that are not referred will linger + in the table for at least the amount of time that this + parameter determines. The lingering prevents repeated + deletions and insertions in the tables from occurring. +

+
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 3fea64cef5..50a26781c4 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6222,6 +6222,7 @@ ok + Information about the system

Returns various information about the current system @@ -6291,6 +6292,15 @@ ok compiled; otherwise, false.

+ delayed_node_table_gc + +

Returns the amount of time in seconds that garbage collection + of an entry in a node table will be delayed. This limit can be set + on startup by passing the + +zdntgc command line + flag to erl. For more information see the documentation of the + command line flag.

+
dirty_cpu_schedulers

Returns the number of dirty CPU scheduler threads used by -- cgit v1.2.3 From d1fbf82a0a43f91e2bbf95060dc09a1573e487c2 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 8 Feb 2014 01:39:57 +0100 Subject: Document abstract format of type-related trees --- erts/doc/src/absform.xml | 163 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 835a4fc692..12cb06c151 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -80,6 +80,28 @@ If F is a record declaration , then Rep(F) = . For Rep(V), see below. + If F is a type attribute (i.e. or + ) + where each + is a variable, then Rep(F) = + . + For Rep(T), see below. + If F is a type spec (i.e. or + ) + , + where each is a fun type clause with an + argument sequence of the same length , then + Rep(F) = + . + For Rep(Tc_i), see below. + If F is a type spec (i.e. or + ) + , + where each is a fun type clause with an + argument sequence of the same length , then + Rep(F) = + . + For Rep(Tc_i), see below. If F is a wild attribute , then Rep(F) = .

@@ -89,6 +111,132 @@ Rep(F) = . +

+ Type clauses + + If T is a fun type clause + Ret]]>, where each + and are types, then + Rep(T) = + . + + If T is a bounded fun type clause , + where is an unbounded fun type clause and + is a type guard sequence, then Rep(T) = + . + +
+ +
+ Type guards + + If G is a constraint , where + is an atom and each is a + type, then Rep(G) = + . + + If G is a type definition , + where is a variable and + is a type, then Rep(G) = + . + +
+ +
+ Types + + If T is a type definition , + where is a variable and + is a type, then Rep(T) = + . + If T is a type union , + where each is a type, then Rep(T) = + . + If T is a type range , + where and are types, then + Rep(T) = . + If T is a binary operation , + where is an arithmetic or bitwise binary operator + and and are types, then + Rep(T) = . + If T is , where is an + arithmetic or bitwise unary operator and is a + type, then Rep(T) = . + If T is a fun type , then Rep(T) = + . + If T is a parenthesized type , then + Rep(T) = , i.e. parenthesized + types are distinguished from their bodies. It should be noted though + that parenthesized types that are immediate subtrees of operator + expressions and binary types are peeled off. + If T is a variable , then Rep(T) = + , where is an atom + with a printname consisting of the same characters as + . + If T is an atomic literal L and L is not a string literal, then + Rep(T) = Rep(L). + If T is a tuple or map type (i.e. + or ), then Rep(T) = + . + If T is a type , where each + is a type, then Rep(T) = + . + If T is a remote type , where + each is a type and and + , then Rep(T) = + . + + If T is the nil type , then Rep(T) = + . + If T is a list type , where + is a type, then Rep(T) = + . + If T is a non-empty list type , where + is a type, then Rep(T) = + . + If T is a map type , where each + is a map pair type, then Rep(T) = + . + If T is a map pair type V]]>, where + and are types, + then Rep(T) = + . + If T is a tuple type , where + each is a type, then Rep(T) = + . + If T is a record type , where + is an atom, then Rep(T) = + . + If T is a record type , + where is an atom, then Rep(T) = + . + + If T is a record field type , + where is an atom, then Rep(T) = + . + If T is a record field type >]]>, then Rep(T) = + . + + If T is a binary type >]]>, where + is a type, then Rep(T) = + . + If T is a binary type >]]>, + where is a type, then Rep(T) = + . + If T is a binary type >]]>, + where and is a type, then + Rep(T) = + . + + If T is a fun type Ret)]]>, then + Rep(T) = . + + If T is a fun type , where + is an unbounded fun type clause, + then Rep(T) = . + +
+
Record fields

Each field in a record declaration may have an optional @@ -98,6 +246,21 @@ Rep(V) = . If V is , then Rep(V) = . + If V is , where is + an atom and is a type and it does not contain + syntactically, then Rep(V) = + . + Note that if is an annotated type, it will be wrapped in + parentheses. + If V is , where is + an atom and is a type, then Rep(V) = + . + + If V is , where + is an atom, is an expression and + is a type, then Rep(V) = + . +

-- cgit v1.2.3 From 417f9960371607e6d618d9dda108787558a9cef5 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 10 Jun 2015 16:30:53 +0200 Subject: Update the documentation of the abstract format The parenthesized type with tag 'paren_type' is no longer created by the Erlang Parser as of OTP 18.0. The tag 'user_type' is used for user defined types as of OTP 18.0. In releases before commit 7ad783 'type' is used. --- erts/doc/src/absform.xml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 12cb06c151..e1a8c2e517 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -4,7 +4,7 @@
- 20012013 + 20012015 Ericsson AB. All Rights Reserved. @@ -164,11 +164,6 @@ type, then Rep(T) = . If T is a fun type , then Rep(T) = . - If T is a parenthesized type , then - Rep(T) = , i.e. parenthesized - types are distinguished from their bodies. It should be noted though - that parenthesized types that are immediate subtrees of operator - expressions and binary types are peeled off. If T is a variable , then Rep(T) = , where is an atom with a printname consisting of the same characters as @@ -180,7 +175,7 @@ . If T is a type , where each is a type, then Rep(T) = - . + . If T is a remote type , where each is a type and and , then Rep(T) = -- cgit v1.2.3 From e14ca38380885e50a134b8c4297c44aec73ccb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 16 Jun 2015 10:07:23 +0200 Subject: Revert "Add thread index to allocator enomem dump slogan" This reverts commit 5d5f9c1857029d7e8e1de141e29d20dd3de929be. --- erts/doc/src/crash_dump.xml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index 8291bf38b7..65a3d6af88 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -88,22 +88,20 @@ operating system.

"<A>: Cannot allocate <N> - bytes of memory (of type "<T>", thread - <I>em>)." - The system has run out of memory. <A> - is the allocator that failed to allocate memory, <N> is the - number of bytes that <A> tried to allocate, <T> is the - memory block type that the memory was needed for, and <I> is the - thread identifier. The most common case is that a process stores huge - amounts of data. In this case <T> is most often - , , - , or . - For more information on allocators see - erts_alloc(3). + bytes of memory (of type "<T>")." - The system + has run out of memory. <A> is the allocator that failed + to allocate memory, <N> is the number of bytes that + <A> tried to allocate, and <T> is the memory block + type that the memory was needed for. The most common case is + that a process stores huge amounts of data. In this case + <T> is most often , , + , or . For more information on + allocators see + erts_alloc(3).
"<A>: Cannot reallocate <N> - bytes of memory (of type "<T>", thread - <I>em>)." - Same as above with the exception that memory - was being reallocated instead of being allocated when the system ran - out of memory. + bytes of memory (of type "<T>")." - Same as + above with the exception that memory was being reallocated + instead of being allocated when the system ran out of memory. "Unexpected op code N" - Error in compiled code, file damaged or error in the compiler. "Module Name undefined" "Function -- cgit v1.2.3 From 92e6fb7f31ad8977144a1cfbcee05895839dbc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 16 Jun 2015 10:10:50 +0200 Subject: Revert "Add run queue index to process dump info" This reverts commit 345af4a0c8d68b9369c3556fa6d911854c123d3f. --- erts/doc/src/crash_dump.xml | 3 --- 1 file changed, 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index 65a3d6af88..e13d468ee6 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -304,9 +304,6 @@ Last scheduled in for | Current call The current function of the process. These fields will not always exist. - Run queue - The identifier of the scheduler run queue in which the process is - running. Spawned by The parent of the process, i.e. the process which executed or . -- cgit v1.2.3 From 738c34d4bb8f1a3811acd00af8c6c12107f8315b Mon Sep 17 00:00:00 2001 From: Bruce Yinhe Date: Thu, 18 Jun 2015 11:31:02 +0200 Subject: Change license text to APLv2 --- erts/doc/Makefile | 21 +++++++++++---------- erts/doc/src/Makefile | 19 ++++++++++--------- erts/doc/src/absform.xml | 21 +++++++++++---------- erts/doc/src/alt_dist.xml | 19 ++++++++++--------- erts/doc/src/book.xml | 21 +++++++++++---------- erts/doc/src/communication.xml | 19 ++++++++++--------- erts/doc/src/crash_dump.xml | 19 ++++++++++--------- erts/doc/src/driver.xml | 21 +++++++++++---------- erts/doc/src/driver_entry.xml | 19 ++++++++++--------- erts/doc/src/epmd.xml | 21 +++++++++++---------- erts/doc/src/erl.xml | 19 ++++++++++--------- erts/doc/src/erl_dist_protocol.xml | 21 +++++++++++---------- erts/doc/src/erl_driver.xml | 19 ++++++++++--------- erts/doc/src/erl_ext_dist.xml | 21 +++++++++++---------- erts/doc/src/erl_nif.xml | 21 +++++++++++---------- erts/doc/src/erl_prim_loader.xml | 21 +++++++++++---------- erts/doc/src/erlang.xml | 19 ++++++++++--------- erts/doc/src/erlc.xml | 19 ++++++++++--------- erts/doc/src/erlsrv.xml | 19 ++++++++++--------- erts/doc/src/erts_alloc.xml | 19 ++++++++++--------- erts/doc/src/escript.xml | 21 +++++++++++---------- erts/doc/src/inet_cfg.xml | 19 ++++++++++--------- erts/doc/src/init.xml | 21 +++++++++++---------- erts/doc/src/match_spec.xml | 19 ++++++++++--------- erts/doc/src/notes.xml | 21 +++++++++++---------- erts/doc/src/notes_history.xml | 21 +++++++++++---------- erts/doc/src/part.xml | 21 +++++++++++---------- erts/doc/src/part_notes.xml | 21 +++++++++++---------- erts/doc/src/part_notes_history.xml | 21 +++++++++++---------- erts/doc/src/ref_man.xml | 21 +++++++++++---------- erts/doc/src/run_erl.xml | 21 +++++++++++---------- erts/doc/src/start.xml | 21 +++++++++++---------- erts/doc/src/start_erl.xml | 21 +++++++++++---------- erts/doc/src/time_correction.xml | 21 +++++++++++---------- erts/doc/src/tty.xml | 19 ++++++++++--------- erts/doc/src/werl.xml | 21 +++++++++++---------- erts/doc/src/zlib.xml | 19 ++++++++++--------- 37 files changed, 392 insertions(+), 355 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/Makefile b/erts/doc/Makefile index 8ea3793d90..d415e544f3 100644 --- a/erts/doc/Makefile +++ b/erts/doc/Makefile @@ -3,16 +3,17 @@ # # Copyright Ericsson AB 1996-2009. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index a83aa9b875..83f4c58560 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -3,16 +3,17 @@ # # Copyright Ericsson AB 1997-2012. All Rights Reserved. # -# The contents of this file are subject to the Erlang Public License, -# Version 1.1, (the "License"); you may not use this file except in -# compliance with the License. You should have received a copy of the -# Erlang Public License along with this software. If not, it can be -# retrieved online at http://www.erlang.org/. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # %CopyrightEnd% # diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index e1a8c2e517..547d5e583d 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/alt_dist.xml b/erts/doc/src/alt_dist.xml index e4912576f7..2263302707 100644 --- a/erts/doc/src/alt_dist.xml +++ b/erts/doc/src/alt_dist.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/book.xml b/erts/doc/src/book.xml index dc02edc5c6..12eda03ee5 100644 --- a/erts/doc/src/book.xml +++ b/erts/doc/src/book.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/communication.xml b/erts/doc/src/communication.xml index 02040c9edb..3deea3e4af 100644 --- a/erts/doc/src/communication.xml +++ b/erts/doc/src/communication.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index e13d468ee6..61c9159823 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml index 616703fdef..a68e87d3b3 100644 --- a/erts/doc/src/driver.xml +++ b/erts/doc/src/driver.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index b34ca136f3..349ce4bbc1 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 25f819ab50..28fcc8f7af 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index f41b6e6149..b0322b7d43 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml index 890293d802..e1a58856f3 100644 --- a/erts/doc/src/erl_dist_protocol.xml +++ b/erts/doc/src/erl_dist_protocol.xml @@ -9,16 +9,17 @@ Ericsson AB, All Rights Reserved - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. The Initial Developer of the Original Code is Ericsson AB. diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 77fc906aca..1f7fe0f961 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index a6e7dddbed..caf1e812c4 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -9,16 +9,17 @@ Ericsson AB, All Rights Reserved - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. The Initial Developer of the Original Code is Ericsson AB. diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 412c0e02ac..23c3d5fcee 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index 171f84decc..d05f0d9aea 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 50a26781c4..37f0aa289e 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml index c3fc3b1686..9fc5864413 100644 --- a/erts/doc/src/erlc.xml +++ b/erts/doc/src/erlc.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml index 71cee714a5..ccb8b2dd76 100644 --- a/erts/doc/src/erlsrv.xml +++ b/erts/doc/src/erlsrv.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 1ade41f1aa..376cae4a95 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index 9159d68f60..46110333f9 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/inet_cfg.xml b/erts/doc/src/inet_cfg.xml index d40bc5f9ee..5caf232a62 100644 --- a/erts/doc/src/inet_cfg.xml +++ b/erts/doc/src/inet_cfg.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index c5a1a92b92..fe26df61f7 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index b4cc8e9f78..08dad8cc10 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 35e6e55e72..2574d45184 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/notes_history.xml b/erts/doc/src/notes_history.xml index 4420311912..0886ae4039 100644 --- a/erts/doc/src/notes_history.xml +++ b/erts/doc/src/notes_history.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml index 7b17b5b551..2f5eca93db 100644 --- a/erts/doc/src/part.xml +++ b/erts/doc/src/part.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/part_notes.xml b/erts/doc/src/part_notes.xml index b5c8f0af09..83bb479715 100644 --- a/erts/doc/src/part_notes.xml +++ b/erts/doc/src/part_notes.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/part_notes_history.xml b/erts/doc/src/part_notes_history.xml index a99fa4a17f..055d1681d5 100644 --- a/erts/doc/src/part_notes_history.xml +++ b/erts/doc/src/part_notes_history.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml index 8ed7090a61..ac589f8cb5 100644 --- a/erts/doc/src/ref_man.xml +++ b/erts/doc/src/ref_man.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml index 28e94c6da8..0a5b2c6136 100644 --- a/erts/doc/src/run_erl.xml +++ b/erts/doc/src/run_erl.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/start.xml b/erts/doc/src/start.xml index e9a5714f93..386fbe6e88 100644 --- a/erts/doc/src/start.xml +++ b/erts/doc/src/start.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/start_erl.xml b/erts/doc/src/start_erl.xml index fe808f7737..62610b43b0 100644 --- a/erts/doc/src/start_erl.xml +++ b/erts/doc/src/start_erl.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index 8af98acc19..e7d2aedf96 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/tty.xml b/erts/doc/src/tty.xml index db15195f65..cd46d1203c 100644 --- a/erts/doc/src/tty.xml +++ b/erts/doc/src/tty.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/werl.xml b/erts/doc/src/werl.xml index 49cc45e745..9e7ad584eb 100644 --- a/erts/doc/src/werl.xml +++ b/erts/doc/src/werl.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index 1f10ddef6d..0a641346d9 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -8,16 +8,17 @@ Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. -- cgit v1.2.3 From a99dd7b0f7fd2f99d08527898ca7564024751748 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 18 Jun 2015 11:45:36 +0200 Subject: Minor doc fixes --- erts/doc/src/time_correction.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index 8af98acc19..87b8c9d8fc 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -613,6 +613,7 @@

erlang:system_info(time_warp_mode)

erlang:system_info(time_correction)

erlang:system_info(start_time)

+

erlang:system_info(end_time)

@@ -865,6 +866,7 @@ EventTag = {Time, UMI}
API can easily be implemented using existing primitives (except for erlang:system_info(start_time), + erlang:system_info(end_time), erlang:system_info(os_monotonic_time_source), and erlang:system_info(os_system_time_source)). By wrapping the API with functions that fall back on -- cgit v1.2.3 From a988faecec41db09c819fd948ef294ee5282e5b5 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Mon, 22 Jun 2015 15:48:15 +0200 Subject: Fix documentation of ERL_DRV_ERROR_ERRNO --- erts/doc/src/driver_entry.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index b34ca136f3..e035857dfe 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -210,7 +210,7 @@ typedef struct erl_drv_entry { number >= 0 or a pointer, or if the driver can't be started, one of three error codes should be returned:

ERL_DRV_ERROR_GENERAL - general error, no error code

-

ERL_DRV_ERROR_ERRNO - error with error code in erl_errno

+

ERL_DRV_ERROR_ERRNO - error with error code in errno

ERL_DRV_ERROR_BADARG - error, badarg

If an error code is returned, the port isn't started.

-- cgit v1.2.3 From 2955ddebc32837b66d9bacb4e925ad0ed0033168 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 23 Jun 2015 10:24:26 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 703 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 703 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 2574d45184..2d96ed6105 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -31,6 +31,709 @@

This document describes the changes made to the ERTS application.

+
Erts 7.0 + +
Fixed Bugs and Malfunctions + + +

+ Fix issuing with spaces and quoting in the arguments when + using erlang:open_port spawn_executable on windows. The + behavior now mimics how unix works. This change implies a + backwards incompatibility for how spawn_executable works + on windows.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11905

+
+ +

+ Fix global call trace when hipe compiled code call beam + compiled functions. Tracing of beam functions should now + alway work regardless who the caller is.

+

+ Own Id: OTP-11939

+
+ +

+ Correct cache alignment for ETS write_concurrency + locks to improve performance by reduced false sharing. + May increase memory footprint for tables with + write_concurrency.

+

+ Own Id: OTP-11974

+
+ +

+ All possibly blocking operations in the fd/spawn and + terminal driver have been converted to non-blocking + operations. Before this fix it was possible for the VM to + be blocked for a long time if the entity consuming + stdout/stderr did not consume it fast enough.

+

+ Own Id: OTP-12239

+
+ +

+ Add missing overhead for offheap binaries created from + external format. This fix can improve the garbage + collection of large binaries originating from + binary_to_term or messages from remote nodes.

+

+ Own Id: OTP-12554

+
+ +

+ Ensure hashing of zero is consistent

+

Erlang treats positive and negative zero as + equal:

+

+ true = 0.0 =:= 0.0/-1

+

However, Erlangs hash functions: hash, phash and + phash2 did not reflect this behaviour. The hash values + produced by the different hash functions would not be + identical for positive and negative zero.

This + change ensures that hash value of positive zero is always + produced regardless of the signedness of the zero float, + i.e.,

+

+ true = erlang:phash2(0.0) =:= + erlang:phash2(0.0/-1)

+

+ Own Id: OTP-12641

+
+ +

+ Ensure NIF term creation disallows illegal floating point + values and too long atoms. Such values will cause a NIF + to throw badarg exception when it returns.

+

+ Own Id: OTP-12655

+
+ +

+ Fixed building of Map results from match_specs

+

+ A faulty "box-value" entered into the heap which could + cause a segmentation fault in the garbage collector if it + was written on a heap fragment.

+

+ Own Id: OTP-12656

+
+ +

+ Fix hipe bug when matching a "writable" binary. The bug + has been seen to sometimes cause a failed binary matching + of a correct utf8 character, but other symptoms are also + possible.

+

+ Own Id: OTP-12667

+
+ +

+ Keep dirty schedulers from waking other schedulers.

+

+ Own Id: OTP-12685

+
+ +

+ Disable floating point exceptions if the VM is compiled + by clang/llvm. This is a known long-standing problem in + clang/llvm.

+

+ Own Id: OTP-12717

+
+ +

+ Fix bug in file:sendfile for FreeBSD causing not + the entire file to be sent.

+

+ Own Id: OTP-12720

+
+ +

+ Fix the broken Android support in erl_child_setup.c

+

+ Own Id: OTP-12751

+
+ +

+ Faulty statistics reported by the fix_alloc + allocator.

+

+ Own Id: OTP-12766

+
+ +

+ Fix two erts_snprintf() calls to correct sizes.

+

+ - run_erl.c (ose): Use the size of the signal type, not + its pointer. - erl_node_tables.c: Use the size of the + _BUFFER in erts_snprintf() to make sure we can use the + full space.

+

+ Own Id: OTP-12771

+
+ +

+ Delayed memory allocations could be delayed an + unnecessarily long time.

+

+ Own Id: OTP-12812

+
+ +

+ Make sure that timeouts on a pool of acceptors are + released in the correct order.

+

+ Own Id: OTP-12817

+
+ +

+ Fix segmentation fault in module_info for deleted modules

+

+ Own Id: OTP-12820

+
+ +

Fix garbage collection of literals in code purge

+

During code purging and check_process_code, the + checking of the binary reference embedded in the match + binary state was omitted for the tracing tests. This + would cause the binary match state to reference + deallocated memory.

+

+ Own Id: OTP-12821

+
+ +

+ A bug has been corrected for gen_tcp:close so when + {linger,{true,0}} is in effect it does not wait for data + in the driver queue to transfer out before closing the + port. Bug fix by Rory Byrne.

+

+ Own Id: OTP-12840

+
+ +

+ The documentation of the driver callback start() + erroneously stated that a return value of + ERL_DRV_ERROR_ERRNO caused the error value to be + passed via erl_errno when it should have been + errno.

+

+ Own Id: OTP-12855

+
+
+
+ + +
Improvements and New Features + + +

+ Add md5 and module entries to + ?MODULE:module_info/0/1 and remove obsolete entry + 'import'.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-11940

+
+ +

+ Debug function erlang:display/1 shows content of + binaries and bitstrings, not only the length.

+

+ Own Id: OTP-11941

+
+ +

The time functionality of Erlang has been extended. + This both includes a new + API for time, as well as time warp + modes which alters the behavior of the system + when system time changes. You are strongly encouraged + to use the new API instead of the old API based on + erlang:now/0. + erlang:now/0 has been deprecated since it is and + forever will be a scalability bottleneck. For more + information see the Time and Time + Correction chapter of the ERTS User's + Guide.

+

Besides the API changes and time warp modes a lot of + scalability and performance improvements regarding time + management has been made internally in the runtime + system. Examples of such improvements are scheduler + specific timer wheels, scheduler specific BIF timer + management, parallel retrieval of monotonic time and + system time on systems with primitives that are not + buggy.

+

+ Own Id: OTP-11997

+
+ +

erlang:function_exported(M, F, A) will now + return true if M:F/A refers to a BIF.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12099

+
+ +

+ New BIF: erlang:get_keys/0, lists all keys + associated with the process dictionary. Note: + erlang:get_keys/0 is auto-imported.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12151 Aux Id: seq12521

+
+ +

+ Make distributed send of large messages yield to improve + real-time characteristics.

+

+ Own Id: OTP-12232

+
+ +

+ Use high accuracy poll timeouts

+

+ Where available, use poll/select API's that can handle + time resolutions less than 1ms. In the cases where such + API's are not available the timeout is rounded up to the + nearest ms.

+

+ Own Id: OTP-12236

+
+ +

+ The internal group to user_drv protocol has been changed + to be synchronous in order to guarantee that output sent + to a process implementing the user_drv protocol is + printed before replying. This protocol is used by the + standard_output device and the ssh application when + acting as a client.

+

+ This change changes the previous unlimited buffer when + printing to standard_io and other devices that end up in + user_drv to 1KB.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12240

+
+ +

The previously introduced "eager check I/O" feature is + now enabled by default.

+

Eager check I/O can be disabled using the erl + command line argument: +secio false

+

Characteristics impact compared to previous + default:

Lower latency and smoother + management of externally triggered I/O operations. + A slightly reduced priority of externally triggered + I/O operations. +

+ Own Id: OTP-12254 Aux Id: OTP-12117

+
+ +

+ Properly support maps in match_specs

+

+ Own Id: OTP-12270

+
+ +

+ The notice that a crashdump has been written has been + moved to be printed before the crashdump is generated + instead of afterwords. The wording of the notice has also + been changed.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12292

+
+ +

+ New function ets:take/2. Works the same as + ets:delete/2 but also returns the deleted + object(s).

+

+ Own Id: OTP-12309

+
+ +

+ Tracing with cpu_timestamp option has been enabled on + Linux.

+

+ Own Id: OTP-12366

+
+ +

+ ets:info/1,2 now contains information about whether + write_concurrency or read_concurrency is enabled.

+

+ Own Id: OTP-12376

+
+ +

+ Improved usage of gcc's builtins for atomic memory + access. These are used when no other implementation of + atomic memory operations is available. For example, when + compiling for ARM when libatomic_ops is not + available.

+

+ The largest improvement will be seen when compiling with + a gcc with support for the __atomic_* + builtins (using a gcc of at least version 4.7), + but also when only the legacy __sync_* builtins + are available (using a gcc of at least version + 4.1) an improvement can be seen.

+

+ For more information see the "Atomic + Memory Operations and the VM" section of + $ERL_TOP/HOWTO/INSTALL.md.

+

+ Own Id: OTP-12383

+
+ +

+ Introduce math:log2/1 function to math module.

+

+ Own Id: OTP-12411

+
+ +

The documentation of the Abstract Format (in the ERTS + User's Guide) has been updated with types and + specification. (Thanks to Anthony Ramine.)

The + explicit representation of parentheses used in types of + the abstract format has been removed. Instead the new + functions erl_parse:type_inop_prec() and + erl_parse:type_preop_prec() can be used for + inserting parentheses where needed.

+

+ Own Id: OTP-12492

+
+ +

+ Remove perfctr support

+

+ Development of perfctr in the linux kernel ceased in + 2010. The perfctr support code in the Erlang VM is thus + effectively dead code and therefor removed.

+

+ Own Id: OTP-12508

+
+ +

zlib:inflateChunk/2 has been added. It works + like zlib:inflate/2, but decompresses no more data + than will fit in the buffer configured by + zlib:setBufSize/2.

+

+ Own Id: OTP-12548

+
+ +

+ Use linear search for small select_val arrays

+

+ Own Id: OTP-12555

+
+ +

+ New BIF ets:update_counter/4 with a default object as + argument, which will be inserted in the table if the key + was not found.

+

+ Own Id: OTP-12563

+
+ +

+ Export missing types from zlib module

+

+ Own Id: OTP-12584

+
+ +

+ Use persistent hashmaps for large Maps

Maps will use a + persistent hashmap implementation when the number of + pairs in a Map becomes sufficiently large. The change + will occur when a Map reaches 33 pairs in size but this + limit might change in the future.

+

The most significant impact for the user by this + change is speed, and to a lesser degree memory + consumption and introspection of Maps. Memory consumption + size is probalistic but lesser than gb_trees or + dict for instance. Any other impacts will be + transparent for the user except for the following + changes.

+

Semantics of Maps have changed in two incompatible + ways compared to the experimental implementation in OTP + 17:

Hashing of maps is done different by + erlang:phash2/1,2, erlang:phash/1 and + erlang:hash/2. Comparing two maps + with ==, /=, =<, <, >= and >, is done + different if the keys contain floating point + numbers. +

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12585

+
+ +

+ Scalability improvement for erlang:make_ref/0, + and other functionality that create references. Each + scheduler now manage its own set of references. By this + no communication at all is needed when creating + references.

+

+ Previous implementation generated a strictly + monotonically increasing sequence of references + corresponding to creation time on the runtime system + instance. This is not the case with current + implementation. You can only expect reference to be + unique. The Erlang/OTP documentation has never mentioned + anything else but the uniqueness property, so this change + is fully compatible. The only reason we've + marked this as a potential incompatibility is since an + early draft for an Erlang specification mentions strict + monotonicity as a property.

+

+ If you need to create data with a strict monotonicity + property use erlang:unique_integer([monotonic]). + Do not use the deprecated erlang:now().

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12610

+
+ +

+ Enable different abort signal from heart

+

By using environment variable HEART_KILL_SIGNAL, heart + can now use a different signal to kill the old running + Erlang.

+

By default the signal is SIGKILL but SIGABRT may also + be used by setting environment variable: + HEART_KILL_SIGNAL=SIGABRT

+

+ Own Id: OTP-12613 Aux Id: seq12826

+
+ +

+ Update autconf to latest version 2015-03-04

+

+ Own Id: OTP-12646

+
+ +

+ Optimization of timers internally in the VM. This include + process timers (receive ... after), port timers + (driver_set_timer()) as well as BIF timers + (erlang:send_after()/erlang:start_timer()).

+

+ Each scheduler thread now has its own lock-free timer + service instead of one locked central service. This + dramatically improves performance of timer management on + systems with a large amount of schedulers and timers.

+

+ The timer service internal data structure has also been + optimized to be able to handle more timers than before. + That is, each timer service is by its self able to handle + more timers without dramatic performance loss than the + old centralized timer service.

+

+ The API of BIF timers has also been extended. Timeout + values are for example no longer limited to 32-bit + integers. For more information see the documentation of + erlang:start_timer/4, + erlang:send_after/4, + erlang:cancel_timer/2, + and erlang:read_timer/2.

+

+ Characteristics impact: Calls to the synchronous versions + of erlang:cancel_timer(), and + erlang:read_timer() may take substantially longer + time to complete than before. This occur when the timer + that is accessed is managed by a remote scheduler. You + typically want to use the new asynchronous option in + order to avoid blocking the calling process.

+

+ Own Id: OTP-12650 Aux Id: OTP-11997

+
+ +

+ Specialize instructions from common assembler patterns

+

Specialize common instructions of rem, + band, minus and plus in the beam + loader. This will reduce the number of fetches and thus + lessen the instruction dispatch pressure during runtime + and speed up those operations in some common cases.

+

Specialize move patterns from x-registers to the stack + with a new move_window instruction. This change + will reduce instruction dispatch pressure.

+

+ Own Id: OTP-12690

+
+ +

+ Fix cross compilation for Android.

+

+ Own Id: OTP-12693

+
+ +

+ Fix incorrect use of autoconf macro AC_EGREP_CPP, which + could cause faulty configuration if run from a path + containing the string 'yes'.

+

+ Own Id: OTP-12706

+
+ +

+ Minimal Java version is now 1.6

+

+ Own Id: OTP-12715

+
+ +

+ Send format and args on process exit to error_logger

+

+ Previously, the emulator would generate a whole string + with values and call the error_logger passing + "~s~n". This changes it to a format string + containing ~p with the respective values as + arguments.

+

+ Own Id: OTP-12735

+
+ +

+ Map error logger warnings to warning messages by default.

+

+ Own Id: OTP-12755

+
+ +

+ Configure architecture ppc64le architecture as a ppc64

+

+ Own Id: OTP-12761

+
+ +

+ Add function enif_raise_exception to allow a NIF + to raise an error exception with any type of reason.

+

+ Own Id: OTP-12770

+
+ +

+ Optimized node table statistics retrieval.

+

+ Own Id: OTP-12777

+
+ +

+ Map beam error logger warnings to warning messages by + default. Previously these messages were mapped to the + error channel by default.

+

+ Own Id: OTP-12781

+
+ +

+ gen_tcp:shutdown/2 is now asynchronous

+

+ This solves the following problems with the old + implementation:

+

+ It doesn't block when the TCP peer is idle or slow. This + is the expected behaviour when shutdown() is called: the + caller needs to be able to continue reading from the + socket, not be prevented from doing so.

+

+ It doesn't truncate the output. The current version of + gen_tcp:shutdown/2 will truncate any outbound data in the + driver queue after about 10 seconds if the TCP peer is + idle of slow. Worse yet, it doesn't even inform anyone + that the data has been truncated: 'ok' is returned to the + caller; and a FIN rather than an RST is sent to the TCP + peer.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12797

+
+ +

+ Introduced delayed node table GC. This in order to avoid + oscillation of entries in and out of the tables. The + oscillation caused unnecessary lock contention on the + table locks. The delay length can be set by passing the + +zdntgc + command line argument.

+

+ Characteristics impact: The tables can grow to very large + sizes with unused entries if the node is get huge amounts + of short lived connections from other nodes. This problem + can be alleviated by shortening the length of the delay + using the +zdntgc command line argument.

+

+ Own Id: OTP-12802

+
+ +

Improved implementation of erlang:statistics(io) + in order to reduce contention between schedulers.

+

Characteristics impact: The actual call to + erlang:statistics(io) takes longer time to + complete, but the overall impact on the system is + improved.

+

+ Own Id: OTP-12842

+
+ +

+ There are many cases where user code needs to be able to + distinguish between a socket that was closed normally and + one that was aborted. Setting the option + {show_econnreset, true} enables the user to receive + ECONNRESET errors on both active and passive sockets.

+

+ Own Id: OTP-12843

+
+ +

+ Do not preallocate too large event pool

+

+ A default pool size of 4000 is too excessive for the + common case. This corresponds directly to the number of + threads in the system. Change + ERTS_TS_EV_ALLOC_DEFAULT_POOL_SIZE to 2048. Change + ERTS_TS_EV_ALLOC_POOL_SIZE to 32.

+

+ Own Id: OTP-12849

+
+
+
+ +
+
Erts 6.4.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 0dedcdefde3f5601453ab12faf2a65b616118333 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 25 Jun 2015 14:28:54 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 35e6e55e72..adc73ceae0 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,32 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4.1.1 + +
Fixed Bugs and Malfunctions + + +

Fix garbage collection of literals in code purge

+

During code purging and check_process_code, the + checking of the binary reference embedded in the match + binary state was omitted for the tracing tests. This + would cause the binary match state to reference + deallocated memory.

+

+ Own Id: OTP-12821

+
+ +

+ Fix a rare hanging of the VM seen to happen just after + emulator start. Bug exists since R14.

+

+ Own Id: OTP-12859 Aux Id: seq12882

+
+
+
+ +
+
Erts 6.4.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c97e4fb7f534d4c206e0446ddeeec0f47c57f81c Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 30 Jun 2015 11:53:41 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 2d96ed6105..64de3aa622 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -31,6 +31,22 @@

This document describes the changes made to the ERTS application.

+
Erts 7.0.1 + +
Fixed Bugs and Malfunctions + + +

+ Fix a rare hanging of the VM seen to happen just after + emulator start. Bug exists since R14.

+

+ Own Id: OTP-12859 Aux Id: seq12882

+
+
+
+ +
+
Erts 7.0
Fixed Bugs and Malfunctions -- cgit v1.2.3 From fb8d80f91ebfc328c3229a5908c3b4d527bfc1e6 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 6 Jul 2015 21:14:34 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index adc73ceae0..5682b9254c 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,29 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4.1.2 + +
Fixed Bugs and Malfunctions + + +

+ A process could end up in an inconsistent half exited + state in the runtime system without SMP support. This + could occur if the processes was traced by a port that it + also was linked to, and the port terminated abnormally + while handling a trace message for the process.

+

+ This bug has always existed in the runtime system without + SMP support, but never in the runtime system with SMP + support.

+

+ Own Id: OTP-12889 Aux Id: seq12885

+
+
+
+ +
+
Erts 6.4.1.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 5d6aea209c3dafa1bfdb35ea559809185b060bfa Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 8 Jul 2015 20:31:29 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 64de3aa622..ab6291614c 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -31,6 +31,82 @@

This document describes the changes made to the ERTS application.

+
Erts 7.0.2 + +
Fixed Bugs and Malfunctions + + +

+ A process could end up in an inconsistent half exited + state in the runtime system without SMP support. This + could occur if the processes was traced by a port that it + also was linked to, and the port terminated abnormally + while handling a trace message for the process.

+

+ This bug has always existed in the runtime system without + SMP support, but never in the runtime system with SMP + support.

+

+ Own Id: OTP-12889 Aux Id: seq12885

+
+ +

+ Removed unnecessary copying of data when retrieving + corrected Erlang monotonic time.

+

+ Own Id: OTP-12894

+
+ +

+ Changed default OS monotonic clock source chosen at build + time. This in order to improve performance. The behavior + will now on most systems be that (both OS and Erlang) + monotonic time stops when the system is suspended.

+

+ If you prefer that monotonic time elapse during suspend + of the machine, you can pass the command line argument + --enable-prefer-elapsed-monotonic-time-during-suspend + to configure when building Erlang/OTP. The + configuration stage will try to find such a clock source, + but might not be able to find it. Note that there might + be a performance penalty associated with such a clock + source.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-12895

+
+ +

+ erlang:system_info(end_time) returned a faulty + value on 32-bit architectures.

+

+ Own Id: OTP-12896

+
+
+
+ + +
Improvements and New Features + + +

+ The configure command line argument + --enable-gettimeofday-as-os-system-time has been + added which force usage of gettimeofday() for OS + system time. This will improve performance of + os:system_time() and os:timestamp() on + MacOS X, at the expense of worse accuracy, resolution and + precision of Erlang monotonic time, Erlang system time, + and OS system time.

+

+ Own Id: OTP-12892

+
+
+
+ +
+
Erts 7.0.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c431a065ba515d27830f01c852f70940efb3003b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 2 Jul 2015 11:13:32 +0200 Subject: ose: Remove all code related to the OSE port The OSE port is no longer supported and this commit removed it and any changes related to it. The things that were general improvements have been left in the code. --- erts/doc/src/driver_entry.xml | 8 ++------ erts/doc/src/erl_driver.xml | 6 ++---- erts/doc/src/erlang.xml | 2 +- erts/doc/src/run_erl.xml | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index 30772c68fe..32fc9e13a4 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -246,14 +246,10 @@ typedef struct erl_drv_entry { something that the WaitForMultipleObjects API function understands). (Some trickery in the emulator allows more than the built-in limit of 64 Events to be used.)

-

On Enea OSE the event is one or more signals that can - be retrieved using erl_drv_ose_get_signal.

To use this with threads and asynchronous routines, create a - pipe on unix, an Event on Windows or a unique signal number on - Enea OSE. When the routine + pipe on unix and an Event on Windows. When the routine completes, write to the pipe (use SetEvent on - Windows or send a message to the emulator process on Enea OSE), - this will make the emulator call + Windows), this will make the emulator call ready_input or ready_output.

Spurious events may happen. That is, calls to ready_input or ready_output even though no real events are signaled. In diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 1f7fe0f961..3bf18ae8d0 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -1044,9 +1044,7 @@ typedef struct ErlIOVec { select/poll can use). On windows, the Win32 API function WaitForMultipleObjects is used. This places other restrictions on the event object. - Refer to the Win32 SDK documentation. - On Enea OSE, the receive function is used. See the for more details.

+ Refer to the Win32 SDK documentation.

The on parameter should be 1 for setting events and 0 for clearing them.

The mode argument is a bitwise-or combination of @@ -1058,7 +1056,7 @@ typedef struct ErlIOVec { ready_output.

-

Some OS (Windows and Enea OSE) do not differentiate between read and write events. +

Some OS (Windows) do not differentiate between read and write events. The call-back for a fired event then only depends on the value of mode.

ERL_DRV_USE specifies if we are using the event object or if we want to close it. diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 37f0aa289e..e77532463e 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1054,7 +1054,7 @@ Print a term on standard output

Prints a text representation of Term on the standard - output. On OSE the term is printed to the ramlog.

+ output.

This BIF is intended for debugging only.

diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml index 0a5b2c6136..faec3c68c1 100644 --- a/erts/doc/src/run_erl.xml +++ b/erts/doc/src/run_erl.xml @@ -59,7 +59,7 @@ first argument to run_erl on the command line. pipe_dir This is where to put the named pipe, usually - on Unix or on OSE. It shall be suffixed by a (slash), + . It shall be suffixed by a (slash), i.e. not , but . log_dir This is where the log files are written. There will be one -- cgit v1.2.3 From 0dcd7fc911e4c0b6eca255e9bcfb0e58654326bf Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 18 Aug 2015 16:39:13 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index ab6291614c..bed1ac463d 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -31,6 +31,29 @@

This document describes the changes made to the ERTS application.

+
Erts 7.0.3 + +
Fixed Bugs and Malfunctions + + +

+ Fixed a binary memory leak when printing to shell using + the tty driver (i.e. not -oldshell).

+

+ Own Id: OTP-12941

+
+ +

+ Fix a bug where the standard error port sometimes crashes + with eagain as the reason.

+

+ Own Id: OTP-12942

+
+
+
+ +
+
Erts 7.0.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 1b8dcd4741399a9190d361bb517130163365680e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 28 Aug 2015 14:29:41 +0200 Subject: Add missing behavior/behaviours to absform docs --- erts/doc/src/absform.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 547d5e583d..df2553ced3 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -70,6 +70,10 @@ Rep(D) = . If F is an attribute , then Rep(F) = . + If F is an attribute , then + Rep(F) = . + If F is an attribute , then + Rep(F) = . If F is an attribute , then Rep(F) = . If F is an attribute , then -- cgit v1.2.3 From fa30eeeb6f54bb0421a76a321f77b9163dca8de9 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 7 Sep 2015 17:49:29 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 5682b9254c..cc224bee49 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,23 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4.1.3 + +
Fixed Bugs and Malfunctions + + +

+ When tracing with process_dump option, the VM + could abort if there was an ongoing binary match + somewhere in the call stack of the traced process./

+

+ Own Id: OTP-12968

+
+
+
+ +
+
Erts 6.4.1.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From af2dae8fba475cd216bc3860c8b867e235eb8748 Mon Sep 17 00:00:00 2001 From: Constantin Rack Date: Tue, 15 Sep 2015 17:29:01 +0200 Subject: Typos in documentation example of list_to_bitstring/1 --- erts/doc/src/erlang.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 37f0aa289e..39febba1ec 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2143,10 +2143,10 @@ os_prompt% <<1,2,3>> > Bin2 = <<4,5>>. <<4,5>> -> Bin3 = <<6,7:4,>>. -<<6>> +> Bin3 = <<6,7:4>>. +<<6,7:4>> > list_to_bitstring([Bin1,1,[2,3,Bin2],4|Bin3]). -<<1,2,3,1,2,3,4,5,4,6,7:46>> +<<1,2,3,1,2,3,4,5,4,6,7:4>> -- cgit v1.2.3 From 6738d356a279835222b951fd213ed4cf9897eb7e Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 21 Sep 2015 17:09:23 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 123 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index bed1ac463d..e51cf93cf7 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -31,6 +31,129 @@

This document describes the changes made to the ERTS application.

+
Erts 7.1 + +
Fixed Bugs and Malfunctions + + +

+ Fix bug in ETS that could cause stray objects marked for + deletion to occasionally be missed by the cleanup done by + safe_fixtable(_,false).

+

+ Own Id: OTP-12870

+
+ +

+ Fixed VM crash that could occur if a trace port was + linked to a process, and the trace port terminated + abnormally while handling a trace message. This bug has + always existed in the runtime system with SMP support.

+

+ Own Id: OTP-12901

+
+ +

+ Instead of aborting, the vm now creates a crash dump when + a system process is terminated.

+

+ Own Id: OTP-12934

+
+ +

+ Fixed a rare emulator dead lock that occurred when + erlang:process_flag(priority,...) was called by a process + that was also scheduled for an internal system activity.

+

+ Own Id: OTP-12943

+
+ +

+ The runtime system on various posix platforms (except for + Linux and Solaris) could crash when large amounts of + file-descriptors were in use.

+

+ Own Id: OTP-12954

+
+ +

+ A beam file compiled by hipe for an incompatible runtime + system was sometimes not rejected by the loader, which + could lead to vm crash. This fix will also allow the same + hipe compiler to be used by both normal and debug-built + vm.

+

+ Own Id: OTP-12962

+
+ +

+ Fix bug in maps:merge/2 when called by hipe + compiled code that could cause vm crash. Bug exists since + erts-7.0 (OTP 18.0).

+

+ Own Id: OTP-12965

+
+ +

+ When tracing with process_dump option, the VM + could abort if there was an ongoing binary match + somewhere in the call stack of the traced process.

+

+ Own Id: OTP-12968

+
+ +

+ Fixed possible output deadlock in tty driver when hitting + "CTRL-C" in a non-smp emulator shell on unix.

+

+ Own Id: OTP-12987 Aux Id: Seq12947

+
+ +

+ Fix binary_to_integer to throw badarg for "+" and + "-" similar to list_to_integer.

+

+ Own Id: OTP-12988

+
+ +

+ Suppress warning of unused argument when using macro + enif_make_pid.

+

+ Own Id: OTP-12989

+
+
+
+ + +
Improvements and New Features + + +

+ Changed default clock source used for OS system time on + MacOS X to gettimeofday() in order to improve + performance. The system can be configured during build to + use the previously used higher resolution clock source by + passing the switch --with-clock-resolution=high + when configuring the build.

+

+ Own Id: OTP-12945 Aux Id: OTP-12892

+
+ +

+ Added the configure option --disable-saved-compile-time + which disables saving of compile date and time in the + emulator binary.

+

+ Own Id: OTP-12971

+
+
+
+ +
+
Erts 7.0.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From a50c470e3d1af4660c09d993495dea56c50ad306 Mon Sep 17 00:00:00 2001 From: xsipewe Date: Fri, 11 Sep 2015 15:05:24 +0200 Subject: erts: Update erts time correction docs --- erts/doc/src/time_correction.xml | 764 ++++++++++++++++++++------------------- 1 file changed, 393 insertions(+), 371 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index aed38fbb92..aec9efa3d3 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -35,31 +35,35 @@
New Extended Time Functionality -

As of OTP 18 (ERTS version 7.0) the time functionality of - Erlang has been extended. This both includes a +

As of OTP 18 (ERTS version 7.0) the time functionality of + Erlang has been extended. This includes a new API - for time, as well as + for time and time warp - modes which alters the behavior of the system when + modes that alter the system behavior when system time changes.

+

The default time warp mode has the same behavior as before, and the - old API will still work, so you are not required to change + old API still works. Thus, you are not required to change anything unless you want to. However, you are strongly encouraged to use the new API instead of the old API based on erlang:now/0. - erlang:now/0 has been deprecated since it is and forever - will be a scalability bottleneck. By using the new API you will + erlang:now/0 is deprecated, as it is and + will be a scalability bottleneck.

+ +

By using the new API, you automatically get scalability and performance improvements. This - will also enable you to use the - multi time warp mode - which improves accuracy, and precision of time measurements.

+ also enables you to use the + multi-time warp mode + that improves accuracy and precision of time measurements.

+
- Some Terminology -

In order to make it easier to understand this document we first - define some terminology. This is a mixture of our own terminology + Terminology +

To make it easier to understand this section, some terms + are defined. This is a mix of our own terminology (Erlang/OS system time, Erlang/OS monotonic time, time warp) and globally accepted terminology.

@@ -67,7 +71,7 @@
Monotonically Increasing

In a monotonically increasing sequence of values, all values - that have a predecessor are either larger than, or equal to its + that have a predecessor are either larger than or equal to its predecessor.

@@ -82,19 +86,19 @@
UT1 -

Universal Time. Based on the rotation of the earth. Conceptually - mean solar time at 0° longitude.

+

Universal Time. UT1 is based on the rotation of the earth + and conceptually means solar time at 0° longitude.

UTC -

Coordinated Universal Time. UTC almost align with - UT1, however, UTC uses the - SI definition of a second which is not exactly of the same length +

Coordinated Universal Time. UTC almost aligns with + UT1. However, UTC uses the + SI definition of a second, which has not exactly the same length as the second used by UT1. This means that UTC slowly drifts from - UT1. In order to keep UTC relatively in sync with UT1, leap seconds - are inserted, and potentially also deleted. That is, an UTC day may + UT1. To keep UTC relatively in sync with UT1, leap seconds + are inserted, and potentially also deleted. That is, an UTC day can be 86400, 86401, or 86399 seconds long.

@@ -104,14 +108,15 @@

Time since Epoch. Epoch is defined to be 00:00:00 UTC, - January 1, 1970. + 1970-01-01. A day in POSIX time is defined to be exactly 86400 seconds long. Strangely enough - Epoch is defined to be a time in UTC, and UTC have another + Epoch is defined to be a time in UTC, and UTC has another definition of how long a day is. Quoting the Open Group - "POSIX time is therefore not necessarily UTC, despite its appearance". The effect of this is that when an UTC leap second is + "POSIX time is therefore not necessarily UTC, despite its appearance". + The effect of this is that when an UTC leap second is inserted, POSIX time either stops for a second, or repeats the - last second. If an UTC leap second would be deleted (has never + last second. If an UTC leap second would be deleted (which has not happened yet), POSIX time would make a one second leap forward.

@@ -125,11 +130,11 @@
Time Precision -

The shortest time interval that can be be distinguished +

The shortest time interval that can be distinguished repeatedly and reliably when reading time values. Precision is limited by the resolution, but - resolution and precision might differ significantly.

+ resolution and precision can differ significantly.

@@ -143,21 +148,23 @@ Time Warp

A time warp is a leap forwards or backwards in time. That is, the difference of time values taken before and after the - time warp will not correspond to the actual elapsed time.

+ time warp does not correspond to the actual elapsed time.

OS System Time

The operating systems view of - POSIX time. It can be - retrieved by calling + POSIX time. To + retrieve it, call os:system_time(). This may or may not be an accurate view of POSIX time. This time may typically be adjusted both backwards and forwards without limitation. That is, time warps - may be observed. You can get information about the Erlang runtime - system's source of OS system time by calling + may be observed.

+ +

To get information about the Erlang runtime + system's source of OS system time, call erlang:system_info(os_system_time_source).

@@ -165,15 +172,17 @@
OS Monotonic Time

A monotonically increasing time provided by the operating - system. This time does not leap and have a relatively steady + system. This time does not leap and has a relatively steady frequency although not completely correct. However, it is not - uncommon that the OS monotonic time stops if the system is - suspended. This time typically increase since some + uncommon that OS monotonic time stops if the system is + suspended. This time typically increases since some unspecified point in time that is not connected to - OS system time. Note - that this type of time is not necessarily provided by all - operating systems. You can get information about the Erlang - runtime system's source of OS monotonic time by calling + OS system time. + This type of time is not necessarily provided by all + operating systems.

+ +

To get information about the Erlang + runtime system's source of OS monotonic time, call erlang:system_info(os_monotonic_time_source).

@@ -181,14 +190,17 @@
Erlang System Time

The Erlang runtime systems view of - POSIX time. It can be - retrieved by calling - erlang:system_time(). - This time may or may not be an accurate view of POSIX time, and may + POSIX time. To + retrieve it, call + erlang:system_time().

+ +

This time may or may not be an accurate view of POSIX time, + and may or may not align with OS system time. The runtime system works towards aligning the two - system times. Depending on time - warp mode used, this may be achieved by letting the Erlang + system times. Depending on the + time warp mode used, + this can be achieved by letting Erlang system time perform a time warp.

@@ -197,35 +209,43 @@
Erlang Monotonic Time

A monotonically increasing time provided by the - Erlang runtime system. The Erlang monotonic time increase since - some unspecified point in time. It can be retrieved by calling + Erlang runtime system. Erlang monotonic time increases since + some unspecified point in time. To retrieve it, call erlang:monotonic_time(). - The - accuracy, and +

+ +

The accuracy and precision of Erlang - monotonic time heavily depends on the accuracy and precision of - OS monotonic time, - the accuracy and precision of - OS system time as well - as on the - time warp mode - used. On a system that is lacking OS monotonic time, the Erlang - monotonic time can only guarantee monotonicity and can more or less - not give any other guarantees. The frequency adjustments made to - the Erlang monotonic time depends on the time warp mode - used.

- -

Internally in the runtime system the Erlang monotonic + monotonic time heavily depends on the following:

+ + + Accuracy and precision of + OS monotonic time + + Accuracy and precision of + OS system time + + time warp mode used + + + +

On a system without OS monotonic time, Erlang monotonic + time guarantees monotonicity, but cannot give + other guarantees. The frequency adjustments made to + Erlang monotonic time depend on the time warp mode used.

+ +

Internally in the runtime system, Erlang monotonic time is the "time engine" that is used for more or less - everything that has anything to do with time. All timers + everything that has anything to do with time. All timers, regardless of it is a receive ... after timer, BIF timer, - or a timer in the timer module are triggered + or a timer in the timer module, are triggered relative Erlang monotonic time. Even Erlang system time is based on Erlang monotonic time. By adding current Erlang monotonic time with current time - offset you get current Erlang system time. Current time - offset can be retrieved by calling + offset, you get current Erlang system time.

+ +

To retrieve current time offset, call erlang:time_offset/0.

@@ -234,176 +254,169 @@
Introduction -

Time is vital to an Erlang program and, more importantly, correct time is vital to an Erlang program. As Erlang is a language with - soft real time properties and we have the possibility to express - time in our programs, the Virtual Machine and the language has to be - very careful about what is considered a correct point in time and in + soft real-time properties and we can express + time in our programs, the Virtual Machine and the language must be + careful about what is considered a correct time and in how time functions behave.

-

In the beginning, Erlang was constructed assuming that the wall +

When Erlang was designed, it was assumed that the wall clock time in the system showed a monotonic time moving forward at - exactly the same pace as the definition of time. That more or less - meant that an atomic clock (or better) was expected to be attached + exactly the same pace as the definition of time. This more or less meant + that an atomic clock (or better time source) was expected to be attached to your hardware and that the hardware was then expected to be - locked away from any human (or unearthly) tinkering for all - eternity. While this might be a compelling thought, it's simply - never the case.

- -

A "normal" modern computer can not keep time. Not on itself and - not unless you actually have a chip level atomic clock wired to - it. Time, as perceived by your computer, will normally need to be - corrected. Hence the NTP protocol that together with the ntpd - process will do it's best to keep your computers time in sync with - the "real" time in the universe. Between NTP corrections, usually a + locked away from any human tinkering forever. While this can be a + compelling thought, it is simply never the case.

+ +

A "normal" modern computer cannot keep time, not on itself and + not unless you have a chip-level atomic clock wired to it. Time, + as perceived by your computer, must normally be corrected. Hence + the Network Time Protocol (NTP) protocol, together with the ntpd + process, does its best to keep your computer time in sync with + the correct time. Between NTP corrections, usually a less potent time-keeper than an atomic clock is used.

-

But NTP is not fail safe. The NTP server can be unavailable, the - ntp.conf can be wrongly configured or your computer may from time to - time be disconnected from the internet. Furthermore you can have a - user (or even system administrator) on your system that thinks the - right way to handle daylight saving time is to adjust the clock one - hour two times a year (a tip, that is not the right way to do - it...). To further complicate things, this user fetched your - software from the internet and has never ever thought about what's - the correct time as perceived by a computer. The user simply does - not care about keeping the wall clock in sync with the rest of the - universe. The user expects your program to have omnipotent knowledge +

However, NTP is not fail-safe. The NTP server can be unavailable, + ntp.conf can be wrongly configured, or your computer may + sometimes be disconnected from Internet. Furthermore, you can have a + user (or even system administrator) who thinks the correct + way to handle Daylight Saving Time is to adjust the clock one + hour two times a year (which is the incorrect way to do it). + To complicate things further, this user fetched your + software from Internet and has not considered what + the correct time is as perceived by a computer. The user does + not care about keeping the wall clock in sync with the correct + time. The user expects your program to have unlimited knowledge about the time.

Most programmers also expect time to be reliable, at least until - they realize that the wall clock time on their workstation is of by - a minute. Then they simply set it to the correct time, maybe or - maybe not in a smooth way. Most probably not in a smooth way.

+ they realize that the wall clock time on their workstation is off by + a minute. Then they set it to the correct time, but most probably + not in a smooth way.

-

The amount of problems that arise when you expect the wall clock - time on the system to always be correct may be immense. Therefore Erlang +

The number of problems that arise when you always expect the wall clock + time on the system to be correct can be immense. Erlang therefore introduced the "corrected estimate of time", or the "time - correction" many years ago. The time correction relies on the fact + correction", many years ago. The time correction relies on the fact that most operating systems have some kind of monotonic clock, - either a real time extension or some built in "tick counter" that is - independent of the wall clock settings. This counter may have - microsecond resolution or much less, but generally it has a drift - that is not to be ignored.

- + either a real-time extension or some built-in "tick counter" that is + independent of the wall clock settings. This counter can have + microsecond resolution or much less, but it has a drift that cannot + be ignored.

-
+ Time Correction

If time correction is enabled, the Erlang runtime system - will make use of both + makes use of both OS system time and OS monotonic time, - in order to make adjustments of the frequency of the Erlang - monotonic clock. Time correction will ensure that + to adjust the frequency of the Erlang + monotonic clock. Time correction ensures that Erlang monotonic time - will not warp, and that the frequency is relatively accurate. - The type of adjustments made to the frequency depends on the - time warp mode used. This will be discussed in more details in - the time warp modes - section below.

- -

By default time correction will be enabled if support for - it on the specific platform exist. Support for it includes - both an OS monotonic time provided by the OS, and an - implementation in the Erlang runtime system utilizing the - OS monotonic time. You can check if your system has support - for OS monotonic time by calling - erlang:system_info(os_monotonic_time_source), - and you can check if time correction is enabled on your - system by calling + does not warp and that the frequency is relatively accurate. + The type of frequency adjustments depends on the time warp mode used. + Section Time Warp Modes + provides more details.

+ +

By default time correction is enabled if support for + it exists on the specific platform. Support for it includes + both OS monotonic time, provided by the OS, and an + implementation in the Erlang runtime system using + OS monotonic time. To check if your system has support + for OS monotonic time, call + erlang:system_info(os_monotonic_time_source). + To check if time correction is enabled on your system, call erlang:system_info(time_correction).

-

Time correction is enabled or disabled by passing the +

To enable or disable time correction, pass command-line argument +c [true|false] - command line argument to erl.

+ to erl.

If time correction is disabled, Erlang monotonic time - may warp forwards, it may stop and even freeze for extended - periods of time, and there are no guarantees that the frequency + may warp forwards or stop, or even freeze for extended + periods of time. There are then no guarantees that the frequency of the Erlang monotonic clock is accurate or stable.

You typically never want to disable time correction. - Previously there was a performance penalty associated with time - correction, but nowadays it is most often the other way around. - By disabling time correction you are likely to get bad scalability, + Previously a performance penalty was associated with time + correction, but nowadays it is usually the other way around. + If time correction is disabled, you probably get bad scalability, bad performance, and bad time measurements.

- -
+ Time Warp Safe Code -

Time warp safe code is code that is able to handle +

Time warp safe code can handle a time warp of - Erlang system time. -

+ Erlang system time.

erlang:now/0 - behaves very bad when Erlang system time warps. When Erlang - system time do a time warp backwards, the values returned - from erlang:now/0 will freeze (if you disregard the - micro second increments made due to the actual call) until - OS system time reach the point of the last value returned by - erlang:now/0. This freeze might continue for very - long periods of time. It might take years, decades, - and even longer than this until the freeze stops.

+ behaves bad when Erlang system time warps. When Erlang + system time does a time warp backwards, the values returned + from erlang:now/0 freeze (if you disregard the + microsecond increments made because of the actual call) until + OS system time reaches the point of the last value returned by + erlang:now/0. This freeze can continue for a long time. It + can take years, decades, and even longer until the freeze stops.

All uses of erlang:now/0 are not necessarily time warp unsafe. If you do not use it to get time, it - will be time warp safe. However all uses of + is time warp safe. However, all uses of erlang:now/0 are suboptimal from a performance and scalability perspective. So you really want to replace - the usage of it with other functionality. For examples - of how to replace the usage of erlang:now/0, - see the Dos and Donts - section.

+ the use of it with other functionality. For examples + of how to replace the use of erlang:now/0, see Section + How to Work with the New + API.

-
Time Warp Modes - +

Current Erlang system time is determined by adding current Erlang monotonic time with current time offset. The time offset is managed differently depending on which time - warp mode you use. The time warp mode is set by passing the + warp mode you use.

+ +

To set the time warp mode, pass command-line argument +C [no_time_warp|single_time_warp|multi_time_warp] - command line argument to erl.

+ to erl.

No Time Warp Mode

The time offset is determined at runtime system start - and will after this not change. This is the default behavior. - Not because it is the best mode (which it isn't). It is + and does not change later. This is the default behavior, but + not because it is the best mode (which it is not). It is default only because this is how the runtime system - always has behaved up until ERTS version 7.0, and you have to - ensure that your Erlang code that may execute during a time + behaved until ERTS 7.0. + Ensure that your Erlang code that may execute during a time warp is time warp - safe before you can enable other modes.

+ safe before enabling other modes.

-

Since the time offset is not allowed to change, time - correction needs to adjust the frequency of the Erlang - monotonic clock in order to smoothly align Erlang system - time with OS system time. A big downside of this approach +

As the time offset is not allowed to change, time + correction must adjust the frequency of the Erlang + monotonic clock to align Erlang system time with OS + system time smoothly. A significant downside of this approach is that we on purpose will use a faulty frequency on the Erlang monotonic clock if adjustments are needed. This - error may be as big as 1%. This error will show up in all + error can be as large as 1%. This error will show up in all time measurements in the runtime system.

-

If time correction is not enabled, the Erlang monotonic - time will freeze when the OS system time leap backwards. - The freeze of the monotonic time will continue until - OS system time catch up. The freeze may continue for - a very long time. When OS system time leaps forwards, - Erlang monotonic time will also leap forward.

+

If time correction is not enabled, Erlang monotonic + time freezes when OS system time leaps backwards. + The freeze of monotonic time continues until + OS system time catches up. The freeze can continue for + a long time. When OS system time leaps forwards, + Erlang monotonic time also leaps forward.

@@ -411,26 +424,27 @@ Single Time Warp Mode

This mode is more or less a backwards compatibility mode as of its introduction.

+

On an embedded system it is not uncommon that the system - has no power supply at all, not even a battery, when it is - shut off. The system clock on such a system will typically - be way off when the system boots. If the + has no power supply, not even a battery, when it is + shut off. The system clock on such a system is typically + way off when the system boots. If no time warp mode is used, and the Erlang runtime system is started before - the OS system time has been corrected, the Erlang system - time may be wrong for a very long time, even centuries or - more.

-

If you for some reason need to use Erlang code that - is not + OS system time has been corrected, Erlang system time + can be wrong for a long time, centuries or even longer.

+ +

If you need to use Erlang code that is not time warp safe, - and you need to start the Erlang runtime system before the OS + and you need to start the Erlang runtime system before OS system time has been corrected, you may want to use the single - time warp mode. Note that there are limitations to when you can + time warp mode.

+ +

There are limitations to when you can execute time warp unsafe code using this mode. If it is possible - to only utilize time warp safe code, it is much better - to use the multi time - warp mode instead. -

+ to use time warp safe code only, it is much better + to use the multi-time + warp mode instead.

Using the single time warp mode, the time offset is handled in two phases:

@@ -438,158 +452,150 @@ Preliminary Phase -

The preliminary phase starts when the runtime +

This phase starts when the runtime system starts. A preliminary time offset based on - current OS system time is determined. This offset will - from now on be fixed during the whole preliminary phase.

+ current OS system time is determined. This offset is from + now on to be fixed during the whole preliminary phase.

If time correction is enabled, adjustments to the - Erlang monotonic clock will be made to keep its - frequency as correct as possible, but no - adjustments will be made trying to align Erlang system - time and OS system time. That is, during the preliminary - Erlang system time and OS system time might diverge - from each other, and no attempt to prevent this will - be made.

+ Erlang monotonic clock are made to keep its + frequency as correct as possible. However, no + adjustments are made trying to align Erlang system + time and OS system time. That is, during the preliminary phase + Erlang system time and OS system time can diverge + from each other, and no attempt is made to prevent this.

If time correction is disabled, changes in OS system - time will effect the monotonic clock the same way as + time affects the monotonic clock the same way as when the no time warp mode is used.

Final Phase - -

The final phase begin when the user finalize the time +

This phase begins when the user finalizes the time offset by calling erlang:system_flag(time_offset, finalize). - The finalization can only be performed once. -

+ The finalization can only be performed once.

During finalization, the time offset is adjusted and - fixated so that current Erlang system time align with - current OS system time. Since the time offset may - change during the finalization, the Erlang system time - may do a time warp at this point. The time offset will - from now on be fixed until the runtime system terminates. + fixated so that current Erlang system time aligns with + current OS system time. As the time offset can + change during the finalization, Erlang system time + can do a time warp at this point. The time offset is + from now on fixed until the runtime system terminates. If time correction has been enabled, the time - correction will from now on also make adjustments - in order to align Erlang system time with OS system - time. When the system is in the final phase it behaves + correction from now on also makes adjustments + to align Erlang system time with OS system + time. When the system is in the final phase, it behaves exactly as in the no time warp mode.

-
-

In order for this to work properly there are two - requirements that the user needs to ensure are - satisfied:

+

In order for this to work properly, the user must ensure + that the following two requirements are satisfied:

Forward Time Warp

The time warp made when finalizing the time offset can only be done forwards without encountering problems. - This implies that the user has to ensure that the OS + This implies that the user must ensure that OS system time is set to a time earlier or equal to actual - POSIX time before starting the Erlang runtime system. If - you are not completely sure the OS system time is correct, + POSIX time before starting the Erlang runtime system.

+ +

If you are not sure that OS system time is correct, set it to a time that is guaranteed to be earlier than actual POSIX time before starting the Erlang runtime - system just to be safe.

+ system, just to be safe.

+ Finalize Correct OS System Time -

The OS system time needs to be correct when the - the user finalizes the time offset.

+

OS system time must be correct when + the user finalizes the time offset.

+

If these requirements are not fulfilled, the system - may behave very bad. -

- -

Assuming that the requirements above are fulfilled, - time correction is enabled, and that the OS system time - is adjusted using some time adjustment protocol like NTP - or similar, only small adjustments of the Erlang monotonic - time should be needed in order to keep system times - aligned after finilization. As long as the system is not - suspended, the largest adjustments needed should be for + may behave very bad.

+ +

Assuming that these requirements are fulfilled, + time correction is enabled, and that OS system time + is adjusted using a time adjustment protocol such as NTP, + only small adjustments of Erlang monotonic + time are needed to keep system times + aligned after finalization. As long as the system is not + suspended, the largest adjustments needed are for inserted (or deleted) leap seconds.

-

In order to be able to use this mode you have - to ensure that all Erlang code that will execute in - both phases are +

To use this mode, ensure that + all Erlang code that will execute in both phases are time warp safe.

-

Code that only execute in the final phase does not have +

Code executing only in the final phase does not have to be able to cope with the time warp.

-
- Multi Time Warp Mode - -

Multi time warp mode in combination with time - correction is the preferred configuration. This since, - on almost all platforms, the Erlang runtime system will have - better performance, will scale better, will behave better, - and since the accuracy, and precision of time measurements - will be better. Only Erlang runtime systems executing on - ancient platforms will benefit from another configuration.

+ Multi-Time Warp Mode +

Multi-time warp mode in combination with time + correction is the preferred configuration. This as + the Erlang runtime system have better performance, scale + better, and behave better on almost all platforms. In + addition, the accuracy and precision of time measurements + are better. Only Erlang runtime systems executing on + ancient platforms benefit from another configuration.

The time offset may change at any time without limitations. That is, Erlang system time may perform time warps both - forwards and backwards at any time. Since we align - the Erlang system time with the OS system time by changing + forwards and backwards at any time. As we align + Erlang system time with OS system time by changing the time offset, we can enable a time correction that tries to adjust the frequency of the Erlang monotonic clock to be as - correct as possible. This will make time measurements using - the Erlang monotonic time more accurate and precise.

+ correct as possible. This makes time measurements using + Erlang monotonic time more accurate and precise.

If time correction is disabled, Erlang monotonic time - will leap forward if OS system time leaps forward. If the - OS system time leaps backwards, Erlang monotonic time will - stop briefly but it does not freeze for extended periods - of time. This since the time offset is changed in order to + leaps forward if OS system time leaps forward. If + OS system time leaps backwards, Erlang monotonic time + stops briefly, but it does not freeze for extended periods + of time. This as the time offset is changed to align Erlang system time with OS system time.

-

In order to be able to use this mode you have - to ensure that all Erlang code that will execute on the - runtime system is +

To use this mode, ensure that all + Erlang code that will execute on the runtime system is time warp safe.

-
- The New Time API - + New Time API +

The old time API is based on erlang:now/0. - The major issue with erlang:now/0 is that it was - intended to be used for so many unrelated things. This - tied these unrelated operations together and unnecessarily - caused performance, scalability as well as accuracy, and - precision issues for operations that do not need to have - such issues. The new API spreads different functionality - over multiple functions in order to improve on this.

- -

In order to be backwards compatible erlang:now/0 will - remain as is, but you are strongly discouraged from using - it. A lot of uses of erlang:now/0 will also - prevent you from using the new - multi time warp - mode which is an important part of this + erlang:now/0 was intended to be used for many unrelated + things. This tied these unrelated operations together and + caused issues with performance, scalability, accuracy, and + precision for operations that did not need to have + such issues. To improve this, the new API spreads different + functionality over multiple functions.

+ +

To be backwards compatible, erlang:now/0 + remains as is, but you are strongly discouraged from using + it. Much use of erlang:now/0 + prevents you from using the new + multi-time warp + mode, which is an important part of this new time functionality improvement.

Some of the new BIFs on some systems, perhaps surprisingly, - return negative integer values on a newly started run time - system. This is not a bug, but a memory usage optimization.

+ return negative integer values on a newly started runtime + system. This is not a bug, but a memory use optimization.

+ +

The new API consists of the following new BIFs:

-

The new API consists of a number of new BIFs:

erlang:convert_time_unit/3

erlang:monotonic_time/0

@@ -604,7 +610,9 @@

os:system_time/0

os:system_time/1

-

and a number of extensions of existing BIFs:

+ +

The new API also consists of extensions of the following existing BIFs:

+

erlang:monitor(time_offset, clock_service)

erlang:system_flag(time_offset, finalize)

@@ -619,102 +627,99 @@
- The New Erlang Monotonic Time -

The Erlang monotonic time as such is new as of ERTS - version 7.0. It has been introduced in order to be able - to detach time measurements such as elapsed time from - calender time. It is very common that one is interested - in measuring elapsed time or specifying a time relative - to another point in time without having any need to know - what the involved times are in UTC or any other - globally defined time scale. By introducing a time scale - that has a local definition of where it starts, it is - possible to manage time that do not concern calender - time on that time scale. Erlang monotonic time use + New Erlang Monotonic Time +

Erlang monotonic time as such is new as of ERTS 7.0. + It is introduced to detach time measurements, such as elapsed + time from calendar time. Many programmers want to measure elapsed + time or specify a time relative to another point in time without + knowing the involved times in UTC or any other globally defined + time scale. By introducing a time scale + with a local definition of where it starts, time that do + not concern calendar time on that time scale can be managed. + Erlang monotonic time uses such a time scale with a locally defined start.

-

The introduction of Erlang monotonic time gives us - the possibility to adjust the two Erlang times (Erlang +

The introduction of Erlang monotonic time allows + us to adjust the two Erlang times (Erlang monotonic time and Erlang system time) separately. By - doing this, accuracy of elapsed time does not have to + doing this, the accuracy of elapsed time does not have to suffer just because the system time happened to be wrong at some point in time. Separate adjustments of the two times are only performed in the time warp modes, and only fully separated in the - multi - time warp mode. All other modes than the - multi time warp mode are there for backwards - compatibility reasons, and when using these the - accuracy of Erlang monotonic time suffer since + multi-time + warp mode. All other modes than the + multi-time warp mode are for backwards + compatibility reasons. When using these modes, the + accuracy of Erlang monotonic time suffer, as the adjustments of Erlang monotonic time in these - modes are more or less tied to the Erlang system - time.

+ modes are more or less tied to Erlang system time.

The adjustment of system time could have been made smother than using a time warp approach, but we think - that would be a bad choice. Since we are able to - express and measure time that aren't connected to - calender time by the use of Erlang monotonic time, it + that would be a bad choice. As we can + express and measure time that is not connected to + calendar time by the use of Erlang monotonic time, it is better to expose the change in Erlang system time - immediately. This since it makes it possible for the - Erlang applications executing on the system to react - on the change in system time as soon as possible. This - is also more or less exactly how most OSes handle this + immediately. This as the Erlang applications + executing on the system can react on the change in + system time as soon as possible. This is also more or + less exactly how most operating systems handle this (OS monotonic time and OS system time). By adjusting - system time smoothly we would just hide the fact that + system time smoothly, we would just hide the fact that system time changed and make it harder for the Erlang applications to react to the change in a sensible way.

-

In order to be able to react to a change in Erlang - system time you have to be able to detect that it +

To be able to react to a change in Erlang + system time, you must be able to detect that it happened. The change in Erlang system time occurs when current time offset is changed. We have therefore - introduced the possibility to monitor the time offset - using - erlang:monitor(time_offset, clock_service). A process monitoring the time - offset will be sent a message on the following format + introduced the possibility to monitor the time offset using + erlang:monitor(time_offset, clock_service). + A process monitoring the time + offset is sent a message on the following format when the time offset is changed:

+ {'CHANGE', MonitorReference, time_offset, clock_service, NewTimeOffset}
Unique Values -

Besides reporting time erlang:now/0 also - produce unique and strictly monotonically increasing - values. In order to detach this functionality from - time measurements we have introduced +

Besides reporting time, erlang:now/0 also + produces unique and strictly monotonically increasing + values. To detach this functionality from + time measurements, we have introduced erlang:unique_integer().

- Dos and Don'ts + How to Work with the New API

Previously erlang:now/0 was the only option for doing - quite a lot of things. We will look at a few different things - erlang:now/0 could be used for, and how you want to do - this using the new API:

+ many things. This section deals with some things that + erlang:now/0 can be used for, and how you are to + these using the new API.

Retrieve Erlang System Time

- use erlang:now/0 in order to retrieve current Erlang - system time. + Use erlang:now/0 to retrieve current Erlang system time.

- use + Use erlang:system_time/1 - in order to retrieve current Erlang system time on the + to retrieve current Erlang system time on the time unit of your choice.

If you want the same format as returned by erlang:now/0, use erlang:timestamp/0. -

+

@@ -723,26 +728,27 @@ Measure Elapsed Time

- take timestamps with erlang:now/0 and calculate + Take timestamps with erlang:now/0 and calculate the difference in time with timer:now_diff/2.

- take timestamps with + Take timestamps with erlang:monotonic_time/0 and calculate the time difference using ordinary subtraction. The result will be in native time unit. If you want to convert the - result to another time unit you can do this using + result to another time unit, you can use erlang:convert_time_unit/3.

-

Another easier way of doing this is to use + +

An easier way to do this is to use erlang:monotonic_time/1 - with desired time unit. However, you may lose accuracy, - and precision this way. + with the desired time unit. However, you can then lose accuracy + and precision.

@@ -752,16 +758,16 @@ Determine Order of Events

- determine the order of events by saving a timestamp - with erlang:now/0 when the event happens. + Determine the order of events by saving a timestamp + with erlang:now/0 when the event occurs.

- determine the order of events by saving the integer + Determine the order of events by saving the integer returned by erlang:unique_integer([monotonic]) - when the event happens. These integers will be strictly + when the event occurs. These integers will be strictly monotonically ordered on current runtime system instance corresponding to creation time.

@@ -770,40 +776,43 @@
- Determine Order of Events With Time of the Event + Determine Order of Events with Time of the Event

- determine the order of events by saving a timestamp - with erlang:now/0 when the event happens. + Determine the order of events by saving a timestamp + with erlang:now/0 when the event occurs.

- determine the order of events by saving a tuple - containing + Determine the order of events by saving a tuple containing monotonic time and a strictly - monotonically increasing integer like this:

+ monotonically increasing integer as follows:

+ Time = erlang:monotonic_time(), UMI = erlang:unique_integer([monotonic]), EventTag = {Time, UMI} +

These tuples will be strictly monotonically ordered - on the current runtime system instance according to - creation time. Note that it is important that the + on current runtime system instance according to + creation time. It is important that the monotonic time is in the first element (the most significant element when comparing 2-tuples). Using the monotonic time in the tuples, you can calculate time between events.

-

If you are interested in the Erlang system time at the - time when the event occurred you can also save the time + +

If you are interested in Erlang system time at the + time when the event occurred, you can also save the time offset before or after saving the events using erlang:time_offset/0. Erlang monotonic time added with the time offset corresponds to Erlang system time.

+

If you are executing in a mode where time offset - may change and you want to be able to get the actual - Erlang system time when the event occurred you can + can change, and you want to get the actual + Erlang system time when the event occurred, you can save the time offset as a third element in the tuple (the least significant element when comparing 3-tuples).

@@ -814,16 +823,15 @@ EventTag = {Time, UMI}
Create a Unique Name

- use the values returned from erlang:now/0 - in order to create a name unique on the current - runtime system instance. + Use the values returned from erlang:now/0 + to create a name unique on the current runtime system instance.

- use the value returned from + Use the value returned from erlang:unique_integer/0 - in order to create a name unique on the current runtime system + to create a name unique on the current runtime system instance. If you only want positive integers, you can use erlang:unique_integer([positive]).

@@ -832,48 +840,62 @@ EventTag = {Time, UMI}
- Seed Random Number Generation With a Unique Value + Seed Random Number Generation with a Unique Value

- seed random number generation using erlang:now(). + Seed random number generation using erlang:now().

- seed random number generation using a combination of + Seed random number generation using a combination of erlang:monotonic_time(), erlang:time_offset(), - erlang:unique_integer(), and other functionality. + erlang:unique_integer(), + and other functionality.

-

To sum this section up: Don't use erlang:now/0!

+

To sum up this section: Do not use erlang:now/0.

-
- Supporting Both New and Old OTP Releases -

Your code may be required to be able to run on a variety + + Support of Both New and Old OTP Releases +

It can be required that your code must run on a variety of OTP installations of different OTP releases. If so, you - can not just use the new API out of the box, since it will + cannot use the new API out of the box, as it will not be available on old pre OTP 18 releases. The solution - is not to avoid using the new API, since your - code then won't be able to benefit from the scalability - and accuracy improvements made. Instead you want to use the + is not to avoid using the new API, as your + code then would not benefit from the scalability + and accuracy improvements made. Instead, use the new API when available, and fall back on erlang:now/0 - when it is not available. Fortunately almost all of the new - API can easily be implemented using existing primitives - (except for - erlang:system_info(start_time), - erlang:system_info(end_time), - erlang:system_info(os_monotonic_time_source), and - erlang:system_info(os_system_time_source)). - By wrapping the API with functions that fall back on - erlang:now/0 when the new API is not available, - and using these wrappers instead of using the API directly - the problem is solved. These wrappers can for example + when the new API is unavailable.

+ +

Fortunately most of the new API can easily be + implemented using existing primitives, except for:

+ + + + erlang:system_info(start_time) + + + erlang:system_info(end_time) + + + erlang:system_info(os_monotonic_time_source) + + + erlang:system_info(os_system_time_source)) + + + +

By wrapping the API with functions that fall back on + erlang:now/0 when the new API is unavailable, + and using these wrappers instead of using the API directly, + the problem is solved. These wrappers can, for example, be implemented as in $ERL_TOP/erts/example/time_compat.erl.

-- cgit v1.2.3 From d3413b5ea34b592b92dc0d17a23c35c731368ad1 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 23 Sep 2015 14:48:47 +0200 Subject: erts: Review time correction docs --- erts/doc/src/time_correction.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index aec9efa3d3..4de3739a36 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -584,7 +584,7 @@

To be backwards compatible, erlang:now/0 remains as is, but you are strongly discouraged from using - it. Much use of erlang:now/0 + it. Many use cases of erlang:now/0 prevents you from using the new multi-time warp mode, which is an important part of this @@ -630,14 +630,14 @@ New Erlang Monotonic Time

Erlang monotonic time as such is new as of ERTS 7.0. It is introduced to detach time measurements, such as elapsed - time from calendar time. Many programmers want to measure elapsed - time or specify a time relative to another point in time without - knowing the involved times in UTC or any other globally defined - time scale. By introducing a time scale - with a local definition of where it starts, time that do - not concern calendar time on that time scale can be managed. - Erlang monotonic time uses - such a time scale with a locally defined start.

+ time from calendar time. In many use cases there is a need to + measure elapsed time or specify a time relative to another point + in time without the need to know the involved times in UTC or + any other globally defined time scale. By introducing a time + scale with a local definition of where it starts, time that do + not concern calendar time can be managed on that time + scale. Erlang monotonic time uses such a time scale with a + locally defined start.

The introduction of Erlang monotonic time allows us to adjust the two Erlang times (Erlang -- cgit v1.2.3 From e17e236cd1661bc8f5bb1ebef0d80e93eb8f5b36 Mon Sep 17 00:00:00 2001 From: xsipewe Date: Tue, 1 Sep 2015 12:15:27 +0200 Subject: erts: Update module erlang docs Rebased 6ac77046b05cd3cb7b117 on OTP-18.1 Conflicts: erts/doc/src/erlang.xml --- erts/doc/src/erlang.xml | 6896 +++++++++++++++++++++++++---------------------- 1 file changed, 3702 insertions(+), 3194 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 37f0aa289e..8b20a5c12f 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -30,33 +30,34 @@ erlang.xml erlang - The Erlang BIFs + The Erlang BIFs. -

By convention, most built-in functions (BIFs) are seen as being - in the module erlang. A number of the BIFs are viewed more +

By convention, most Built-In Functions (BIFs) are seen as being + in this module. Some of the BIFs are viewed more or less as part of the Erlang programming language and are - auto-imported. Thus, it is not necessary to specify - the module name and both the calls atom_to_list(Erlang) and - erlang:atom_to_list(Erlang) are identical.

-

In the text, auto-imported BIFs are listed without module prefix. + auto-imported. Thus, it is not necessary to specify the + module name. For example, the calls atom_to_list(Erlang) + and erlang:atom_to_list(Erlang) are identical.

+

Auto-imported BIFs are listed without module prefix. BIFs listed with module prefix are not auto-imported.

-

BIFs may fail for a variety of reasons. All BIFs fail with +

BIFs can fail for various reasons. All BIFs fail with reason badarg if they are called with arguments of an - incorrect type. The other reasons that may make BIFs fail are - described in connection with the description of each individual - BIF.

-

Some BIFs may be used in guard tests, these are marked with + incorrect type. The other reasons are described in the + description of each individual BIF.

+

Some BIFs can be used in guard tests and are marked with "Allowed in guard tests".

- ext_binary() + ext_binary() +

A binary data object, structured according to the Erlang external term format.

+

See erlang:timestamp/0.

@@ -139,12 +140,15 @@ - - - Arithmetical absolute value - -

Returns an integer or float which is the arithmetical - absolute value of Float or Int.

+ Arithmetical absolute value. + + Float = float() + Int = integer() + + +

Returns an integer or float that is the arithmetical + absolute value of Float or + Int, for example:

 > abs(-3.33).
 3.33
@@ -153,206 +157,217 @@
         

Allowed in guard tests.

+ - Compute adler32 checksum + Computes adler32 checksum. -

Computes and returns the adler32 checksum for Data.

+

Computes and returns the adler32 checksum for + Data.

+ - Compute adler32 checksum + Computes adler32 checksum. -

Continue computing the adler32 checksum by combining - the previous checksum, OldAdler, with the checksum of - Data.

-

The following code:

- - X = erlang:adler32(Data1), - Y = erlang:adler32(X,Data2). - -

- would assign the same value to Y as this would:

- - Y = erlang:adler32([Data1,Data2]). - +

Continues computing the adler32 checksum by combining + the previous checksum, OldAdler, with + the checksum of Data.

+

The following code:

+ + X = erlang:adler32(Data1), + Y = erlang:adler32(X,Data2). +

assigns the same value to Y as this:

+ + Y = erlang:adler32([Data1,Data2]).
+ - Combine two adler32 checksums - -

Combines two previously computed adler32 checksums. - This computation requires the size of the data object for - the second checksum to be known.

-

The following code:

- - Y = erlang:adler32(Data1), - Z = erlang:adler32(Y,Data2). - -

- would assign the same value to Z as this would:

- - X = erlang:adler32(Data1), - Y = erlang:adler32(Data2), - Z = erlang:adler32_combine(X,Y,iolist_size(Data2)). - + Combines two adler32 checksums. + +

Combines two previously computed adler32 checksums. + This computation requires the size of the data object for + the second checksum to be known.

+

The following code:

+ + Y = erlang:adler32(Data1), + Z = erlang:adler32(Y,Data2). +

assigns the same value to Z as this:

+ + X = erlang:adler32(Data1), + Y = erlang:adler32(Data2), + Z = erlang:adler32_combine(X,Y,iolist_size(Data2)).
+ - Append an extra element to a tuple - -

Returns a new tuple which has one element more than - Tuple1, and contains the elements in Tuple1 - followed by Term as the last element. Semantically - equivalent to - list_to_tuple(tuple_to_list(Tuple1) ++ [Term]), but much - faster.

+ Appends an extra element to a tuple. + +

Returns a new tuple that has one element more than + Tuple1, and contains the elements in + Tuple1 + followed by Term as the last element. + Semantically equivalent to + list_to_tuple(tuple_to_list(Tuple1) ++ + [Term]), but much faster.

+

Example:

 > erlang:append_element({one, two}, three).
 {one,two,three}
+ - Apply a function to an argument list + Applies a function to an argument list. -

Call a fun, passing the elements in Args as - arguments.

-

Note: If the number of elements in the arguments are known at - compile-time, the call is better written as +

Calls a fun, passing the elements in Args + as arguments.

+

If the number of elements in the arguments are known at + compile time, the call is better written as Fun(Arg1, Arg2, ... ArgN).

Earlier, Fun could also be given as {Module, Function}, equivalent to - apply(Module, Function, Args). This usage is - deprecated and will stop working in a future release of - Erlang/OTP.

+ apply(Module, Function, Args). This use is + deprecated and will stop working in a future release.

+ - Apply a function to an argument list + Applies a function to an argument list.

Returns the result of applying Function in - Module to Args. The applied function must + Module to Args. + The applied function must be exported from Module. The arity of the function is the length of Args.

+

Example:

 > apply(lists, reverse, [[a, b, c]]).
 [c,b,a]
-

apply can be used to evaluate BIFs by using +

apply evaluates BIFs by using the module name erlang.

 > apply(erlang, atom_to_list, ['Erlang']).
 "Erlang"
-

Note: If the number of arguments are known at compile-time, +

If the number of arguments are known at compile time, the call is better written as Module:Function(Arg1, Arg2, ..., ArgN).

Failure: error_handler:undefined_function/3 is called if the applied function is not exported. The error handler can be redefined (see process_flag/2). - If the error_handler is undefined, or if the user has + If error_handler is undefined, or if the user has redefined the default error_handler so the replacement module is undefined, an error with the reason undef is generated.

+ - Return the binary representation of an atom - -

Returns a binary which corresponds to the text - representation of Atom. If Encoding - is latin1, there will be one byte for each character - in the text representation. If Encoding is - utf8 or - unicode, the characters will be encoded using UTF-8 - (meaning that characters from 16#80 up to 0xFF will be - encoded in two bytes).

- -

Currently, atom_to_binary(Atom, latin1) can - never fail because the text representation of an atom can only contain - characters from 0 to 16#FF. In a future release, the text representation - of atoms might be allowed to contain any Unicode character - and atom_to_binary(Atom, latin1) will fail if the - text representation for the Atom contains a Unicode - character greater than 16#FF.

- + Returns the binary representation of an atom. + +

Returns a binary corresponding to the text + representation of Atom. + If Encoding + is latin1, there is one byte for each character + in the text representation. If Encoding is + utf8 or + unicode, the characters are encoded using UTF-8 + (that is, characters from 16#80 through 0xFF are + encoded in two bytes).

+

atom_to_binary(Atom, latin1) never + fails because the text representation of an atom can only + contain characters from 0 through 16#FF. In a future release, + the text representation + of atoms can be allowed to contain any Unicode character and + atom_to_binary(Atom, latin1) will then fail if the + text representation for Atom contains a Unicode + character greater than 16#FF.

+

Example:

 > atom_to_binary('Erlang', latin1).
 <<"Erlang">>
+ - Text representation of an atom + Text representation of an atom. -

Returns a string which corresponds to the text - representation of Atom.

+

Returns a string corresponding to the text + representation of Atom, for example:

 > atom_to_list('Erlang').
 "Erlang"
+ - Extracts a part of a binary + Extracts a part of a binary. -

Extracts the part of the binary described by PosLen.

- -

Negative length can be used to extract bytes at the end of a binary:

- +

Extracts the part of the binary described by + PosLen.

+

Negative length can be used to extract bytes at the end + of a binary, for example:

1> Bin = <<1,2,3,4,5,6,7,8,9,10>>. 2> binary_part(Bin,{byte_size(Bin), -5}). -<<6,7,8,9,10>> - - -

If PosLen in any way references outside the binary, a badarg exception is raised.

- -

Start is zero-based, i.e.:

+<<6,7,8,9,10>> +

Failure: badarg if PosLen in any way + references outside the binary.

+

Start is zero-based, that is:

1> Bin = <<1,2,3>> 2> binary_part(Bin,{0,2}). -<<1,2>> - - -

See the STDLIB module binary for details about the PosLen semantics.

- +<<1,2>> +

For details about the PosLen semantics, see the + binary + manual page in STDLIB.

Allowed in guard tests.

+ - Extracts a part of a binary + Extracts a part of a binary. -

The same as binary_part(Subject, {Start, Length}).

- +

The same as binary_part(Subject, + {Start, Length}).

Allowed in guard tests.

+ - Convert from text representation to an atom + Converts from text representation to an atom.

Returns the atom whose text representation is - Binary. If Encoding is latin1, no - translation of bytes in the binary is done. If Encoding - is utf8 or unicode, the binary must contain - valid UTF-8 sequences; furthermore, only Unicode characters up - to 0xFF are allowed.

- -

binary_to_atom(Binary, utf8) will fail if - the binary contains Unicode characters greater than 16#FF. - In a future release, such Unicode characters might be allowed - and binary_to_atom(Binary, utf8) - will not fail in that case. For more information on Unicode support in atoms - see note on UTF-8 encoded atoms - in the chapter about the external term format in the ERTS User's Guide.

- + Binary. + If Encoding is latin1, no + translation of bytes in the binary is done. + If Encoding + is utf8 or unicode, the binary must contain + valid UTF-8 sequences. Only Unicode characters up + to 0xFF are allowed.

+

binary_to_atom(Binary, utf8) fails if + the binary contains Unicode characters greater than 16#FF. + In a future release, such Unicode characters can be allowed + and binary_to_atom(Binary, utf8) does then not fail. + For more information on Unicode support in atoms, see the + note on UTF-8 + encoded atoms + in Section "External Term Format" in the User's Guide.

+

Examples:

 > binary_to_atom(<<"Erlang">>, latin1).
 'Erlang'
@@ -362,20 +377,24 @@
         called as binary_to_atom(<<208,128>>,utf8)
+ - Convert from text representation to an atom + Converts from text representation to an atom. -

Works like binary_to_atom/2, - but the atom must already exist.

-

Failure: badarg if the atom does not already exist.

+

As + binary_to_atom/2, + but the atom must exist.

+

Failure: badarg if the atom does not exist.

+ - Convert from text representation to a float + Converts from text representation to a float. -

Returns the float whose text representation is Binary.

+

Returns the float whose text representation is + Binary, for example:

 > binary_to_float(<<"2.2017764e+0">>).
 2.2017764
@@ -383,12 +402,13 @@ representation of a float.

+ - Convert from text representation to an integer + Converts from text representation to an integer.

Returns an integer whose text representation is - Binary.

+ Binary, for example:

 > binary_to_integer(<<"123">>).
 123
@@ -396,12 +416,13 @@ representation of an integer.

+ - Convert from text representation to an integer + Converts from text representation to an integer.

Returns an integer whose text representation in base - Base is Binary.

+ Base is Binary, for example:

 > binary_to_integer(<<"3FF">>, 16).
 1023
@@ -409,93 +430,101 @@ representation of an integer.

+ - Convert a binary to a list + Converts a binary to a list. -

Returns a list of integers which correspond to the bytes of +

Returns a list of integers corresponding to the bytes of Binary.

+ - Convert part of a binary to a list + Converts part of a binary to a list. 1..byte_size(Binary)

As binary_to_list/1, but returns a list of integers corresponding to the bytes from position Start to - position Stop in Binary. Positions in the + position Stop in Binary. + The positions in the binary are numbered starting from 1.

- -

This function's indexing style of using one-based indices for - binaries is deprecated. New code should use the functions in - the STDLIB module binary instead. They consequently - use the same (zero-based) style of indexing.

+

The indexing style of using one-based indices for + binaries is deprecated for this function. New code is to + use the functions in module binary in STDLIB + instead. They therefore + use the same (zero-based) style of indexing.

+ - Convert a bitstring to a list + Converts a bitstring to a list. -

Returns a list of integers which correspond to the bytes of - Bitstring. If the number of bits in the binary is not - divisible by 8, the last element of the list will be a bitstring - containing the remaining bits (1 up to 7 bits).

+

Returns a list of integers corresponding to the bytes of + Bitstring. If the number of bits in the binary + is not divisible by 8, the last element of the list is a bitstring + containing the remaining 1-7 bits.

+ - Decode an Erlang external term format binary + Decodes an Erlang external term format binary. -

Returns an Erlang term which is the result of decoding - the binary object Binary, which must be encoded +

Returns an Erlang term that is the result of decoding + binary object Binary, which must be encoded according to the Erlang external term format.

- -

When decoding binaries from untrusted sources, consider using - binary_to_term/2 to prevent denial of service attacks.

-
-

See also - term_to_binary/1 - and - binary_to_term/2.

+

When decoding binaries from untrusted sources, + consider using binary_to_term/2 to prevent Denial + of Service attacks.

+

See also + term_to_binary/1 + and + binary_to_term/2.

+ - Decode an Erlang external term format binary + Decodes an Erlang external term format binary.

As binary_to_term/1, but takes options that affect decoding of the binary.

safe -

Use this option when receiving binaries from an untrusted +

Use this option when receiving binaries from an untrusted source.

-

When enabled, it prevents decoding data that may be used to - attack the Erlang system. In the event of receiving unsafe - data, decoding fails with a badarg error.

-

Currently, this prevents creation of new atoms directly, - creation of new atoms indirectly (as they are embedded in - certain structures like pids, refs, funs, etc.), and creation of - new external function references. None of those resources are - currently garbage collected, so unchecked creation of them can - exhaust available memory.

+

When enabled, it prevents decoding data that can be used to + attack the Erlang system. In the event of receiving unsafe + data, decoding fails with a badarg error.

+

This prevents creation of new atoms directly, + creation of new atoms indirectly (as they are embedded in + certain structures, such as process identifiers, + refs, and funs), and + creation of new external function references. + None of those resources are garbage collected, so unchecked + creation of them can exhaust available memory.

-

Failure: badarg if safe is specified and unsafe data - is decoded.

+

Failure: badarg if safe is specified and unsafe + data is decoded.

See also term_to_binary/1, binary_to_term/1, - and - list_to_existing_atom/1.

+ and + list_to_existing_atom/1.

+ - Return the size of a bitstring + Returns the size of a bitstring. -

Returns an integer which is the size in bits of Bitstring.

+

Returns an integer that is the size in bits of + Bitstring, for example:

 > bit_size(<<433:16,3:3>>).
 19
@@ -504,30 +533,34 @@
         

Allowed in guard tests.

+ - Increment the reduction counter + Increments the reduction counter.

This implementation-dependent function increments the reduction counter for the calling process. In the Beam emulator, the reduction counter is normally incremented by - one for each function and BIF call, and a context switch is - forced when the counter reaches the maximum number of reductions - for a process (2000 reductions in R12B).

+ one for each function and BIF call. A context switch is + forced when the counter reaches the maximum number of + reductions for a process (2000 reductions in OTP R12B).

-

This BIF might be removed in a future version of the Beam +

This BIF can be removed in a future version of the Beam machine without prior warning. It is unlikely to be implemented in other Erlang implementations.

+ - Return the size of a bitstring (or binary) + Returns the size of a bitstring (or binary). -

Returns an integer which is the number of bytes needed to contain - Bitstring. (That is, if the number of bits in Bitstring is not - divisible by 8, the resulting number of bytes will be rounded up.)

+

Returns an integer that is the number of bytes needed to + contain Bitstring. That is, if the number of bits + in Bitstring is not divisible by 8, the resulting + number of bytes is rounded up.

+

Examples:

 > byte_size(<<433:16,3:3>>).
 3
@@ -536,12 +569,13 @@
         

Allowed in guard tests.

+ - Cancel a timer + Cancels a timer.

- Cancels a timer that has been created by either + Cancels a timer that has been created by erlang:start_timer(), or erlang:send_after(). TimerRef identifies the timer, and @@ -606,7 +640,7 @@ the timeout message has been sent, but it does not tell you whether or not it has arrived at its destination yet. When the Result is an integer, it represents the - time in milli-seconds left until the timer will expire. + time in milli-seconds left until the timer would have expired.

@@ -632,7 +666,7 @@ - Cancel a timer + Cancels a timer.

Cancels a timer. The same as calling erlang:cancel_timer(TimerRef, @@ -641,100 +675,99 @@ - Check if a module has old code + Checks if a module has old code. -

Returns true if the Module has old code, - and false otherwise.

+

Returns true if Module has old code, + otherwise false.

See also code(3).

+ - Check if a process is executing old code for a module + Checks if a process executes old code for a module.

The same as - erlang:check_process_code(Pid, - Module, []).

+ erlang:check_process_code(Pid, Module, []).

+ - Check if a process is executing old code for a module + Checks if a process executes old code for a module. -

Check if the node local process identified by Pid - is executing old code for Module.

-

Currently available Options:

+

Checks if the node local process identified by Pid + executes old code for Module.

+

The available Options are as follows:

{allow_gc, boolean()} - Determines if garbage collection is allowed when performing - the operation. If {allow_gc, false} is passed, and - a garbage collection is needed in order to determine the - result of the operation, the operation will be aborted - (see information on CheckResult below). - The default is to allow garbage collection, i.e., - {allow_gc, true}. +

Determines if garbage collection is allowed when performing + the operation. If {allow_gc, false} is passed, and + a garbage collection is needed to determine the + result of the operation, the operation is aborted (see + information on CheckResult in the following). + The default is to allow garbage collection, that is, + {allow_gc, true}.

{async, RequestId} - The check_process_code/3 function will return - the value async immediately after the request - has been sent. When the request has been processed, the - process that called this function will be passed a - message on the form:
- {check_process_code, RequestId, CheckResult}. +

The function check_process_code/3 returns + the value async immediately after the request + has been sent. When the request has been processed, the + process that called this function is passed a + message on the form + {check_process_code, RequestId, CheckResult}.

-

If Pid equals self(), and - no async option has been passed, the operation will - be performed at once. In all other cases a request for - the operation will be sent to the process identified by - Pid, and will be handled when - appropriate. If no async option has been passed, - the caller will block until CheckResult - is available and can be returned.

-

CheckResult informs about the result of - the request:

+

If Pid equals self(), and + no async option has been passed, the operation + is performed at once. Otherwise a request for + the operation is sent to the process identified by + Pid, and is handled when + appropriate. If no async option has been passed, + the caller blocks until CheckResult + is available and can be returned.

+

CheckResult informs about the result of + the request as follows:

true - The process identified by Pid is - executing old code for Module. - That is, the current call of the process executes old - code for this module, or the process has references - to old code for this module, or the process contains - funs that references old code for this module. +

The process identified by Pid + executes old code for Module. + That is, the current call of the process executes old + code for this module, or the process has references + to old code for this module, or the process contains + funs that references old code for this module.

false - The process identified by Pid is - not executing old code for Module. +

The process identified by Pid does + not execute old code for Module.

aborted - The operation was aborted since the process needed to - be garbage collected in order to determine the result - of the operation, and the operation was requested - by passing the {allow_gc, false} option. +

The operation was aborted, as the process needed to + be garbage collected to determine the operation result, + and the operation was requested + by passing option {allow_gc, false}.

See also code(3).

Failures:

badarg - - If Pid is not a node local process identifier. + If Pid is not a node local process identifier. badarg - - If Module is not an atom. + If Module is not an atom. badarg - - If OptionList is not a valid list of options. + If OptionList is an invalid list of options.
+ Convert time unit of a time value @@ -753,99 +786,101 @@ - Compute crc32 (IEEE 802.3) checksum + Computes crc32 (IEEE 802.3) checksum. -

Computes and returns the crc32 (IEEE 802.3 style) checksum for Data.

+

Computes and returns the crc32 (IEEE 802.3 style) checksum + for Data.

+ - Compute crc32 (IEEE 802.3) checksum + Computes crc32 (IEEE 802.3) checksum. -

Continue computing the crc32 checksum by combining - the previous checksum, OldCrc, with the checksum of - Data.

-

The following code:

- - X = erlang:crc32(Data1), - Y = erlang:crc32(X,Data2). - -

- would assign the same value to Y as this would:

- - Y = erlang:crc32([Data1,Data2]). - +

Continues computing the crc32 checksum by combining + the previous checksum, OldCrc, with the checksum of + Data.

+

The following code:

+ + X = erlang:crc32(Data1), + Y = erlang:crc32(X,Data2). +

assigns the same value to Y as this:

+ + Y = erlang:crc32([Data1,Data2]).
+ - Combine two crc32 (IEEE 802.3) checksums - -

Combines two previously computed crc32 checksums. - This computation requires the size of the data object for - the second checksum to be known.

-

The following code:

- - Y = erlang:crc32(Data1), - Z = erlang:crc32(Y,Data2). - -

- would assign the same value to Z as this would:

+ Combines two crc32 (IEEE 802.3) checksums. + +

Combines two previously computed crc32 checksums. + This computation requires the size of the data object for + the second checksum to be known.

+

The following code:

+ + Y = erlang:crc32(Data1), + Z = erlang:crc32(Y,Data2). +

assigns the same value to Z as this:

- X = erlang:crc32(Data1), - Y = erlang:crc32(Data2), - Z = erlang:crc32_combine(X,Y,iolist_size(Data2)). - + X = erlang:crc32(Data1), + Y = erlang:crc32(Data2), + Z = erlang:crc32_combine(X,Y,iolist_size(Data2)).
+ - Current date + Current date.

Returns the current date as {Year, Month, Day}.

-

The time zone and daylight saving time correction depend on +

The time zone and Daylight Saving Time correction depend on the underlying OS.

+

Example:

 > date().
 {1995,2,19}
+ - Extracts a protocol packet from a binary + Extracts a protocol packet from a binary. -

Decodes the binary Bin according to the packet - protocol specified by Type. Very similar to the packet - handling done by sockets with the option {packet,Type}.

-

If an entire packet is contained in Bin it is + protocol specified by Type. Similar to the packet + handling done by sockets with option {packet,Type}.

+

If an entire packet is contained in Bin, it is returned together with the remainder of the binary as {ok,Packet,Rest}.

If Bin does not contain the entire packet, - {more,Length} is returned. Length is either the - expected total size of the packet or undefined - if the expected packet size is not known. decode_packet + {more,Length} is returned. + Length is either the + expected total size of the packet, or undefined + if the expected packet size is unknown. decode_packet can then be called again with more data added.

-

If the packet does not conform to the protocol format +

If the packet does not conform to the protocol format, {error,Reason} is returned.

-

The following values of Type are valid:

+

The following Types are valid:

raw | 0 -

No packet handling is done. Entire binary is +

No packet handling is done. The entire binary is returned unless it is empty.

1 | 2 | 4

Packets consist of a header specifying the number of bytes in the packet, followed by that number of bytes. - The length of header can be one, two, or four bytes; + The length of the header can be one, two, or four bytes; the order of the bytes is big-endian. The header - will be stripped off when the packet is returned.

+ is stripped off when the packet is returned.

line -

A packet is a line terminated with newline. The +

A packet is a line-terminated with newline. The newline character is included in the returned packet - unless the line was truncated according to the option + unless the line was truncated according to option line_length.

asn1 | cdr | sunrm | fcgi | tpkt @@ -864,41 +899,46 @@

The Hypertext Transfer Protocol. The packets are returned with the format according to - HttpPacket described above. A packet is either a - request, a response, a header or an end of header - mark. Invalid lines are returned as HttpError.

-

Recognized request methods and header fields are returned as atoms. - Others are returned as strings. Strings of unrecognized header fields - are formatted with only capital letters first and after hyphen characters - (like "Sec-Websocket-Key").

-

The protocol type http should only be used for - the first line when a HttpRequest or a - HttpResponse is expected. The following calls - should use httph to get HttpHeader's until - http_eoh is returned that marks the end of the + HttpPacket described earlier. + A packet is either a + request, a response, a header, or an end of header + mark. Invalid lines are returned as + HttpError.

+

Recognized request methods and header fields are returned + as atoms. Others are returned as strings. Strings of + unrecognized header fields are formatted with only + capital letters first and after hyphen characters, for + example, "Sec-Websocket-Key".

+

The protocol type http is only to be used for + the first line when an HttpRequest or an + HttpResponse is expected. + The following calls are to use httph to get + HttpHeaders until + http_eoh is returned, which marks the end of the headers and the beginning of any following message body.

-

The variants http_bin and httph_bin will return +

The variants http_bin and httph_bin return strings (HttpString) as binaries instead of lists.

The following options are available:

{packet_size, integer() >= 0} -

Sets the max allowed size of the packet body. If - the packet header indicates that the length of the - packet is longer than the max allowed length, the packet - is considered invalid. Default is 0 which means no - size limit.

+

Sets the maximum allowed size of the packet body. + If the packet header indicates that the length of the + packet is longer than the maximum allowed length, the + packet is considered invalid. Default is 0, which means + no size limit.

{line_length, integer() >= 0} -

For packet type line, truncate lines longer - than the indicated length.

-

Option line_length also applies to http* - packet types as an alias for option packet_size in the - case when packet_size itself is not set. This usage is - only intended for backward compatibility.

+

For packet type line, lines longer than + the indicated length are truncated.

+

Option line_length also applies to http* + packet types as an alias for option packet_size + if packet_size itself is not set. This use is + only intended for backward compatibility.

+

Examples:

 > erlang:decode_packet(1,<<3,"abcd">>,[]).
 {ok,<<"abc">>,<<"d">>}
@@ -909,13 +949,11 @@
 
     
       
-      Delete element at index in a tuple
+      Deletes element at index in a tuple.
       1..tuple_size(Tuple1)
       
-		  

- Returns a new tuple with element at Index removed from - tuple Tuple1. -

+

Returns a new tuple with element at Index + removed from tuple Tuple1, for example:

 > erlang:delete_element(2, {one, two, three}).
 {one,three}
@@ -924,78 +962,82 @@ - Make the current code for a module old + Makes the current code for a module old. -

Makes the current code for Module become old code, and - deletes all references for this module from the export table. +

Makes the current code for Module become old code, + and deletes all references for this module from the export table. Returns undefined if the module does not exist, otherwise true.

This BIF is intended for the code server (see - code(3)) and should not be - used elsewhere.

+ code(3)) and is not + to be used elsewhere.

-

Failure: badarg if there is already an old version of +

Failure: badarg if there already is an old version of Module.

+ - Stop monitoring + Stops monitoring. -

If MonitorRef is a reference which the calling process - obtained by calling +

If MonitorRef is a reference that the + calling process obtained by calling monitor/2, this monitoring is turned off. If the monitoring is already turned off, nothing happens.

-

Once demonitor(MonitorRef) has returned it is - guaranteed that no {'DOWN', MonitorRef, _, _, _} message - due to the monitor will be placed in the caller's message queue - in the future. A {'DOWN', MonitorRef, _, _, _} message - might have been placed in the caller's message queue prior to - the call, though. Therefore, in most cases, it is advisable +

Once demonitor(MonitorRef) has returned, it is + guaranteed that no {'DOWN', + MonitorRef, _, _, _} message, + because of the monitor, will be placed in the caller message queue + in the future. A {'DOWN', + MonitorRef, _, _, _} message + can have been placed in the caller message queue before + the call, though. It is therefore usually advisable to remove such a 'DOWN' message from the message queue - after monitoring has been stopped. - demonitor(MonitorRef, [flush]) can be used instead of + after monitoring has been stopped. + demonitor(MonitorRef, [flush]) + can be used instead of demonitor(MonitorRef) if this cleanup is wanted.

-

Prior to OTP release R11B (erts version 5.5) demonitor/1 - behaved completely asynchronous, i.e., the monitor was active - until the "demonitor signal" reached the monitored entity. This - had one undesirable effect, though. You could never know when - you were guaranteed not to receive a DOWN message - due to the monitor.

-

Current behavior can be viewed as two combined operations: - asynchronously send a "demonitor signal" to the monitored entity - and ignore any future results of the monitor.

+

Before OTP R11B (ERTS 5.5), demonitor/1 + behaved asynchronous, that is, the monitor was active + until the "demonitor signal" reached the monitored entity. + This had an undesirable effect, as you could never know when + you were guaranteed not to receive a DOWN + message because of the monitor.

+

The current behavior can be viewed as two combined operations: + asynchronously send a "demonitor signal" to the monitored + entity and ignore any future results of the monitor.

Failure: It is an error if MonitorRef refers to a monitoring started by another process. Not all such cases are - cheap to check; if checking is cheap, the call fails with - badarg (for example if MonitorRef is a remote - reference).

+ cheap to check. If checking is cheap, the call fails with + badarg for example, if MonitorRef is a + remote reference.

+ - Stop monitoring + Stops monitoring.

The returned value is true unless info is part - of OptionList. -

+ of OptionList.

demonitor(MonitorRef, []) is equivalent to demonitor(MonitorRef).

-

Currently the following Options are valid:

+

The available Options are as follows:

flush -

Remove (one) {_, MonitorRef, _, _, _} message, - if there is one, from the caller's message queue after +

Removes (one) {_, + MonitorRef, _, _, _} message, + if there is one, from the caller message queue after monitoring has been stopped.

Calling demonitor(MonitorRef, [flush]) is equivalent to the following, but more efficient:

- demonitor(MonitorRef), receive {_, MonitorRef, _, _, _} -> @@ -1006,78 +1048,90 @@
info -

The returned value is one of the following:

- - true -

The monitor was found and removed. In this case - no 'DOWN' message due to this monitor have - been nor will be placed in the message queue - of the caller. -

-
- false -

The monitor was not found and could not be removed. - This probably because someone already has placed a - 'DOWN' message corresponding to this monitor - in the caller's message queue. -

-
-
-

If the info option is combined with the flush - option, false will be returned if a flush was needed; - otherwise, true. -

+

The returned value is one of the following:

+ + true + The monitor was found and removed. In this case, + no 'DOWN' message corresponding to this + monitor has been delivered and will not be delivered. + + false + The monitor was not found and could not be removed. + This probably because someone already has placed a + 'DOWN' message corresponding to this monitor + in the caller message queue. + + +

If option info is combined with option flush, + false is returned if a flush was needed, + otherwise true.

-

More options may be added in the future.

+

More options can be added in a future release.

-

Failure: badarg if OptionList is not a list, or - if Option is not a valid option, or the same failure as for - demonitor/1

+

Failures:

+ + badarg + If OptionList is not a list. + + badarg + If Option is an invalid option. + + badarg + The same failure as for + demonitor/1. + +
+ - Force the disconnection of a node + Forces the disconnection of a node. -

Forces the disconnection of a node. This will appear to - the node Node as if the local node has crashed. This - BIF is mainly used in the Erlang network authentication - protocols. Returns true if disconnection succeeds, +

Forces the disconnection of a node. This appears to + the node Node as if the local node has crashed. + This BIF is mainly used in the Erlang network authentication + protocols.

+

Returns true if disconnection succeeds, otherwise false. If the local node is not alive, - the function returns ignored.

+ ignored is returned.

+ - Print a term on standard output + Prints a term on standard output. -

Prints a text representation of Term on the standard - output. On OSE the term is printed to the ramlog.

+

Prints a text representation of Term on the + standard output. On OSE, the term is printed to the ramlog.

This BIF is intended for debugging only.

+ 1..tuple_size(Tuple) - Get Nth element of a tuple + Returns the Nth element of a tuple.

Returns the Nth element (numbering from 1) of - Tuple.

+ Tuple, for example:

 > element(2, {a, b, c}).
 b

Allowed in guard tests.

+ - Return and delete the process dictionary + Returns and deletes the process dictionary. -

Returns the process dictionary and deletes it.

+

Returns the process dictionary and deletes it, for + example:

 > put(key1, {1, 2, 3}),
 put(key2, [a, b, c]),
@@ -1085,13 +1139,16 @@ b
[{key1,{1,2,3}},{key2,[a,b,c]}]
+ - Return and delete a value from the process dictionary + Returns and deletes a value from the process dictionary. -

Returns the value Val associated with Key and - deletes it from the process dictionary. Returns - undefined if no value is associated with Key.

+

Returns the value Val associated with + Key and deletes it from the process dictionary. + Returns undefined if no value is associated with + Key.

+

Example:

 > put(key1, {merry, lambs, are, playing}),
 X = erase(key1),
@@ -1099,16 +1156,19 @@ b
{{merry,lambs,are,playing},undefined}
+ - Stop execution with a given reason + Stops execution with a given reason.

Stops the execution of the calling process with the reason - Reason, where Reason is any term. The actual - exit reason will be {Reason, Where}, where Where + Reason, where Reason + is any term. The exit reason is + {Reason, Where}, where Where is a list of the functions most recently called (the current function first). Since evaluating this function causes the process to terminate, it has no return value.

+

Example:

 > catch error(foobar).
 {'EXIT',{foobar,[{erl_eval,do_apply,5},
@@ -1118,29 +1178,34 @@ b
{shell,eval_loop,3}]}}
+ - Stop execution with a given reason + Stops execution with a given reason.

Stops the execution of the calling process with the reason - Reason, where Reason is any term. The actual - exit reason will be {Reason, Where}, where Where + Reason, where Reason + is any term. The exit reason is + {Reason, Where}, where Where is a list of the functions most recently called (the current - function first). Args is expected to be the list of - arguments for the current function; in Beam it will be used - to provide the actual arguments for the current function in - the Where term. Since evaluating this function causes + function first). Args is expected to be the + list of arguments for the current function; in Beam it is used + to provide the arguments for the current function in + the term Where. Since evaluating this function causes the process to terminate, it has no return value.

+ - Stop execution with a given reason + Stops execution with a given reason. -

Stops the execution of the calling process with the exit - reason Reason, where Reason is any term. Since +

Stops the execution of the calling process with exit reason + Reason, where Reason + is any term. Since evaluating this function causes the process to terminate, it has no return value.

+

Example:

 > exit(foobar).
 ** exception exit: foobar
@@ -1148,110 +1213,117 @@ b
{'EXIT',foobar}
+ - Send an exit signal to a process or a port + Sends an exit signal to a process or a port.

Sends an exit signal with exit reason Reason to the process or port identified by Pid.

-

The following behavior apply if Reason is any term - except normal or kill:

-

If Pid is not trapping exits, Pid itself will - exit with exit reason Reason. If Pid is trapping - exits, the exit signal is transformed into a message - {'EXIT', From, Reason} and delivered to the message - queue of Pid. From is the pid of the process - which sent the exit signal. See also - process_flag/2.

-

If Reason is the atom normal, Pid will - not exit. If it is trapping exits, the exit signal is - transformed into a message {'EXIT', From, normal} - and delivered to its message queue.

-

If Reason is the atom kill, that is if - exit(Pid, kill) is called, an untrappable exit signal - is sent to Pid which will unconditionally exit with - exit reason killed.

+

The following behavior applies if Reason + is any term, except normal or kill:

+ + If Pid is not trapping exits, + Pid + itself exits with exit reason Reason. + + If Pid is trapping exits, the exit + signal is transformed into a message + {'EXIT', From, Reason} + and delivered to the message queue of Pid. + + From is the process identifier of the process + that sent the exit signal. See also + process_flag/2. + + +

If Reason is the atom normal, + Pid + does not exit. If it is trapping exits, the exit signal is + transformed into a message {'EXIT', From, normal} + and delivered to its message queue.

+

If Reason is the atom kill, + that is, if exit(Pid, kill) is called, + an untrappable exit signal is sent to Pid, + which unconditionally exits with exit reason killed. +

+ - Calculate the maximum size for a term encoded in the Erlang - external term format + Calculates the maximum size for a term encoded in the Erlang external term format.

Calculates, without doing the encoding, the maximum byte size for a term encoded in the Erlang external term format. The following condition applies always:

-

 > Size1 = byte_size(term_to_binary(Term)),
 > Size2 = erlang:external_size(Term),
 > true = Size1 =< Size2.
-true
-          
-

-

This is equivalent to a call to: erlang:external_size(Term, []) -

+true +

This is equivalent to a call to:

+erlang:external_size(Term, [])
+ - Calculate the maximum size for a term encoded in the Erlang - external term format + Calculates the maximum size for a term encoded in the Erlang external term format.

Calculates, without doing the encoding, the maximum byte size for a term encoded in the Erlang external term format. The following condition applies always:

-

 > Size1 = byte_size(term_to_binary(Term, Options)),
 > Size2 = erlang:external_size(Term, Options),
 > true = Size1 =< Size2.
-true
-          
-

-

The option {minor_version, Version} specifies how floats - are encoded. See - term_to_binary/2 for - a more detailed description. -

+true +

Option {minor_version, Version} specifies how + floats are encoded. For a detailed description, see + term_to_binary/2.

+ - Convert a number to a float + Converts a number to a float. -

Returns a float by converting Number to a float.

+

Returns a float by converting Number to a float, + for example:

 > float(55).
 55.0

Allowed in guard tests.

-

Note that if used on the top-level in a guard, it will - test whether the argument is a floating point number; for - clarity, use +

If used on the top level in a guard, it tests whether the + argument is a floating point number; for clarity, use is_float/1 instead.

When float/1 is used in an expression in a guard, such as 'float(A) == 4.0', it converts a number as - described above.

+ described earlier.

+ - Text representation of a float + Text representation of a float. -

The same as float_to_binary(Float,[{scientific,20}]).

+

The same as + float_to_binary(Float,[{scientific,20}]).

+ - Text representation of a float formatted using given options + Text representation of a float formatted using given options. -

Returns a binary which corresponds to the text +

Returns a binary corresponding to the text representation of Float using fixed decimal - point formatting. The Options behave in the same - way as float_to_list/2. -

+ point formatting. Options behaves in the same + way as float_to_list/2.

+

Examples:

 > float_to_binary(7.12, [{decimals, 4}]).
 <<"7.1200">>
@@ -1259,31 +1331,42 @@ true
 <<"7.12">>
+ - Text representation of a float + Text representation of a float. -

The same as float_to_list(Float,[{scientific,20}]).

+

The same as + float_to_list(Float,[{scientific,20}]).

+ - Text representation of a float formatted using given options - -

Returns a string which corresponds to the text - representation of Float using fixed decimal point formatting. - When decimals option is specified - the returned value will contain at most Decimals number of - digits past the decimal point. If the number doesn't fit in the - internal static buffer of 256 bytes, the function throws badarg. - When compact option is provided - the trailing zeros at the end of the list are truncated (this option is - only meaningful together with the decimals option). When - scientific option is provided, the float will be formatted using - scientific notation with Decimals digits of precision. If - Options is [] the function behaves like - float_to_list/1. -

+ Text representation of a float formatted using given options. + +

Returns a string corresponding to the text representation + of Float using fixed decimal point formatting. The + options are as follows:

+ + If option decimals is specified, the returned value + contains at most Decimals number of digits past the + decimal point. If the number does not fit in the internal + static buffer of 256 bytes, the function throws badarg. + + If option compact is provided, the trailing zeros + at the end of the list are truncated. This option is only + meaningful together with option decimals. + + If option scientific is provided, the float is + formatted using scientific notation with Decimals + digits of precision. + + If Options is [], the function behaves as + float_to_list/1. + + +

Examples:

 > float_to_list(7.12, [{decimals, 4}]).
 "7.1200"
@@ -1291,36 +1374,40 @@ true
 "7.12"
+ - Information about a fun + Information about a fun. -

Returns a list containing information about the fun - Fun. Each element of the list is a tuple. The order of - the tuples is not defined, and more tuples may be added in a +

Returns a list with information about the fun + Fun. Each list element is a tuple. The order + of the tuples is undefined, and more tuples can be added in a future release.

This BIF is mainly intended for debugging, but it can - occasionally be useful in library functions that might need - to verify, for instance, the arity of a fun.

+ sometimes be useful in library functions that need + to verify, for example, the arity of a fun.

-

There are two types of funs with slightly different - semantics:

-

A fun created by fun M:F/A is called an - external fun. Calling it will always call the - function F with arity A in the latest code for - module M. Note that module M does not even need - to be loaded when the fun fun M:F/A is created.

-

All other funs are called local. When a local fun - is called, the same version of the code that created the fun - will be called (even if newer version of the module has been - loaded).

-

The following elements will always be present in the list +

Two types of funs have slightly different semantics:

+ + A fun created by fun M:F/A is called an + external fun. Calling it will always call the + function F with arity A in the latest code for + module M. Notice that module M does not even + need to be loaded when the fun fun M:F/A is created. + + All other funs are called local. When a local fun + is called, the same version of the code that created the fun + is called (even if a newer version of the module has been + loaded). + + +

The following elements are always present in the list for both local and external funs:

{type, Type} -

Type is either local or external.

+

Type is local or external.

{module, Module} @@ -1335,148 +1422,154 @@ true

Name (an atom) is a function name.

If Fun is a local fun, Name is the name of the local function that implements the fun. - (This name was generated by the compiler, and is generally + (This name was generated by the compiler, and is only of informational use. As it is a local function, it - is not possible to call it directly.) + cannot be called directly.) If no code is currently loaded for the fun, [] - will be returned instead of an atom.

+ is returned instead of an atom.

If Fun is an external fun, Name is the name of the exported function that the fun refers to.

{arity, Arity}

Arity is the number of arguments that the fun - should be called with.

+ is to be called with.

{env, Env}

Env (a list) is the environment or free variables - for the fun. (For external funs, the returned list is - always empty.)

+ for the fun. For external funs, the returned list is + always empty.

-

The following elements will only be present in the list if +

The following elements are only present in the list if Fun is local:

{pid, Pid} -

Pid is the pid of the process that originally - created the fun.

+

Pid is the process identifier of the process + that originally created the fun.

{index, Index} -

Index (an integer) is an index into the module's +

Index (an integer) is an index into the module fun table.

{new_index, Index} -

Index (an integer) is an index into the module's +

Index (an integer) is an index into the module fun table.

{new_uniq, Uniq} -

Uniq (a binary) is a unique value for this fun. - It is calculated from the compiled code for the entire module.

+

Uniq (a binary) is a unique value for this fun. It + is calculated from the compiled code for the entire module.

{uniq, Uniq}

Uniq (an integer) is a unique value for this fun. - Starting in the R15 release, this integer is calculated from - the compiled code for the entire module. Before R15, this - integer was based on only the body of the fun. -

+ As from OTP R15, this integer is calculated from the + compiled code for the entire module. Before OTP R15, this + integer was based on only the body of the fun.

+ + Information about a fun. - Information about a fun

Returns information about Fun as specified by - Item, in the form {Item,Info}.

+ Item, in the form + {Item,Info}.

For any fun, Item can be any of the atoms - module, name, arity, env, or type.

-

For a local fun, Item can also be any of the atoms - index, new_index, new_uniq, + module, name, arity, env, or + type.

+

For a local fun, Item can also be any of the + atoms index, new_index, new_uniq, uniq, and pid. For an external fun, the value of any of these items is always the atom undefined.

See erlang:fun_info/1.

+ - Text representation of a fun + Text representation of a fun. -

Returns a string which corresponds to the text +

Returns a string corresponding to the text representation of Fun.

+ - Check if a function is exported and loaded + Checks if a function is exported and loaded.

Returns true if the module Module is loaded and contains an exported function Function/Arity, or if there is a BIF (a built-in function implemented in C) - with the given name; otherwise returns false.

+ with the given name, otherwise returns false.

This function used to return false for built-in functions before the 18.0 release.

+ - Force an immediate garbage collection of the calling process + Forces an immediate garbage collection of the calling process. -

Forces an immediate garbage collection of the currently - executing process. The function should not be used, unless - it has been noticed -- or there are good reasons to suspect -- +

Forces an immediate garbage collection of the + executing process. The function is not to be used unless + it has been noticed (or there are good reasons to suspect) that the spontaneous garbage collection will occur too late - or not at all. Improper use may seriously degrade system - performance.

+ or not at all.

+ +

Improper use can seriously degrade system performance.

+
+ - Garbage collect a process + Garbage collects a process.

The same as garbage_collect(Pid, []).

+ - Garbage collect a process + Garbage collects a process. -

Garbage collect the node local process identified by - Pid.

-

Currently available Options:

+

Garbage collects the node local process identified by + Pid.

+

The available Options are as follows:

{async, RequestId} - - The garbage_collect/2 function will return + The function garbage_collect/2 returns the value async immediately after the request has been sent. When the request has been processed, the - process that called this function will be passed a - message on the form:
- {garbage_collect, RequestId, GCResult}. -
+ process that called this function is passed a message on + the form {garbage_collect, + RequestId, GCResult}. +

If Pid equals self(), and no async option has been passed, the garbage - collection will be performed at once, i.e. the same as - calling + collection is performed at once, that is, the same as calling garbage_collect/0. - In all other cases a request for garbage collection will - be sent to the process identified by Pid, + Otherwise a request for garbage collection + is sent to the process identified by Pid, and will be handled when appropriate. If no async - option has been passed, the caller will block until - GCResult is available and can be - returned.

+ option has been passed, the caller blocks until + GCResult is available and can be returned.

GCResult informs about the result of - the garbage collection request:

+ the garbage collection request as follows:

true @@ -1485,14 +1578,13 @@ true false - No garbage collection was performed. This since the + No garbage collection was performed, as the process identified by Pid terminated before the request could be satisfied. -

Note that the same caveats as for - garbage_collect/0 - apply.

+

Notice that the same caveats apply as for + garbage_collect/0.

Failures:

badarg @@ -1501,17 +1593,18 @@ true badarg - If OptionList is not a valid list of options. + If OptionList is an invalid list of options.
+ - Return the process dictionary + Returns the process dictionary.

Returns the process dictionary as a list of - {Key, Val} tuples.

+ {Key, Val} tuples, for example:

 > put(key1, merry),
 put(key2, lambs),
@@ -1520,13 +1613,15 @@ true
 [{key1,merry},{key2,lambs},{key3,{are,playing}}]
+ - Return a value from the process dictionary + Returns a value from the process dictionary.

Returns the value Val associated with Key in the process dictionary, or undefined if Key does not exist.

+

Example:

 > put(key1, merry),
 put(key2, lambs),
@@ -1535,14 +1630,16 @@ true
 {are,playing}
+ - Get the magic cookie of the local node + Gets the magic cookie of the local node. -

Returns the magic cookie of the local node, if the node is - alive; otherwise the atom nocookie.

+

Returns the magic cookie of the local node if the node is + alive, otherwise the atom nocookie.

+ Return a list of all keys from the process dictionary @@ -1558,10 +1655,10 @@ true - Return a list of keys from the process dictionary + Returns a list of keys from the process dictionary. -

Returns a list of keys which are associated with the value - Val in the process dictionary.

+

Returns a list of keys that are associated with the value + Val in the process dictionary, for example:

 > put(mary, {1, 2}),
 put(had, {1, 2}),
@@ -1573,40 +1670,40 @@ true
 [mary,had,a,little,lamb]
+ - Get the call stack back-trace of the last exception + Gets the call stack back-trace of the last exception. -

Get the call stack back-trace (stacktrace) of the last - exception in the calling process as a list of +

Gets the call stack back-trace (stacktrace) of the + last exception in the calling process as a list of {Module,Function,Arity,Location} tuples. - The Arity field in the first tuple may be the argument - list of that function call instead of an arity integer, + Field Arity in the first tuple can be the + argument list of that function call instead of an arity integer, depending on the exception.

If there has not been any exceptions in a process, the stacktrace is []. After a code change for the process, - the stacktrace may also be reset to [].

+ the stacktrace can also be reset to [].

The stacktrace is the same data as the catch operator returns, for example:

{'EXIT',{badarg,Stacktrace}} = catch abs(x)

-

Location is a (possibly empty) list of two-tuples that - may indicate the location in the source code of the function. - The first element is an atom that describes the type of - information in the second element. Currently the following - items may occur:

+

Location is a (possibly empty) list + of two-tuples that + can indicate the location in the source code of the function. + The first element is an atom describing the type of + information in the second element. The following + items can occur:

file - -

The second element of the tuple is a string (list of + The second element of the tuple is a string (list of characters) representing the filename of the source file - of the function.

+ of the function.
line - -

The second element of the tuple is the line number + The second element of the tuple is the line number (an integer greater than zero) in the source file - where the exception occurred or the function was called.

+ where the exception occurred or the function was called.

See also @@ -1614,49 +1711,56 @@ true erlang:error/2.

+ - Get the group leader for the calling process + Gets the group leader for the calling process. -

Returns the pid of the group leader for the process which - evaluates the function.

+

Returns the process identifier of the group leader for the + process evaluating the function.

Every process is a member of some process group and all - groups have a group leader. All IO from the group + groups have a group leader. All I/O from the group is channeled to the group leader. When a new process is spawned, it gets the same group leader as the spawning - process. Initially, at system start-up, init is both + process. Initially, at system startup, init is both its own group leader and the group leader of all processes.

+ - Set the group leader for a process + Sets the group leader for a process. -

Sets the group leader of Pid to GroupLeader. - Typically, this is used when a processes started from a - certain shell should have another group leader than +

Sets the group leader of Pid + to GroupLeader. + Typically, this is used when a process started from a + certain shell is to have another group leader than init.

See also group_leader/0.

+ - Halt the Erlang runtime system and indicate normal exit to the calling environment + Halts the Erlang runtime system and indicates normal exit to the calling environment.

The same as halt(0, []).

+

Example:

 > halt().
 os_prompt% 
+ - Halt the Erlang runtime system + Halts the Erlang runtime system.

The same as halt(Status, []).

+

Example:

 > halt(17).
 os_prompt% echo $?
@@ -1664,178 +1768,188 @@ os_prompt% echo $?
 os_prompt% 
+ - Halt the Erlang runtime system + Halts the Erlang runtime system.

Status must be a non-negative integer, a string, or the atom abort. Halts the Erlang runtime system. Has no return value. - Depending on Status: -

+ Depending on Status, the following occurs:

integer() - The runtime system exits with the integer value Status - as status code to the calling environment (operating system). + The runtime system exits with integer value + Status + as status code to the calling environment (OS). string() - An erlang crash dump is produced with Status as slogan, - and then the runtime system exits with status code 1. + An Erlang crash dump is produced with Status + as slogan. Then the runtime system exits with status code 1. abort The runtime system aborts producing a core dump, if that is - enabled in the operating system. + enabled in the OS. -

Note that on many platforms, only the status codes 0-255 are - supported by the operating system. -

-

For integer Status the Erlang runtime system closes all ports - and allows async threads to finish their operations before exiting. - To exit without such flushing use - Option as {flush,false}. -

-

For statuses string() and abort the flush - option is ignored and flushing is not done. -

+

On many platforms, the OS supports only status + codes 0-255.

+

For integer Status, the Erlang runtime system + closes all ports and allows async threads to finish their + operations before exiting. To exit without such flushing, use + Option as {flush,false}.

+

For statuses string() and abort, option + flush is ignored and flushing is not done.

+ - Hash function (deprecated) + Hash function (deprecated).

Returns a hash value for Term within the range - 1..Range. The allowed range is 1..2^27-1.

+ 1..Range. The range is 1..2^27-1.

-

This BIF is deprecated as the hash value may differ on - different architectures. Also the hash values for integer - terms larger than 2^27 as well as large binaries are very +

This BIF is deprecated, as the hash value can differ on + different architectures. The hash values for integer + terms higher than 2^27 and large binaries are poor. The BIF is retained for backward compatibility - reasons (it may have been used to hash records into a file), - but all new code should use one of the BIFs + reasons (it can have been used to hash records into a file), + but all new code is to use one of the BIFs erlang:phash/2 or erlang:phash2/1,2 instead.

+ - Head of a list + Head of a list. -

Returns the head of List, that is, the first element.

+

Returns the head of List, that is, + the first element, for example:

 > hd([1,2,3,4,5]).
 1

Allowed in guard tests.

-

Failure: badarg if List is the empty list [].

+

Failure: badarg if List is the empty + list [].

+ - Hibernate a process until a message is sent to it + Hibernates a process until a message is sent to it.

Puts the calling process into a wait state where its memory - allocation has been reduced as much as possible, which is + allocation has been reduced as much as possible. This is useful if the process does not expect to receive any messages - in the near future.

-

The process will be awaken when a message is sent to it, and - control will resume in Module:Function with - the arguments given by Args with the call stack - emptied, meaning that the process will terminate when that - function returns. Thus erlang:hibernate/3 will never - return to its caller.

+ soon.

+

The process is awaken when a message is sent to it, and control + resumes in Module:Function with + the arguments given by Args with the call + stack emptied, meaning that the process terminates when that + function returns. Thus erlang:hibernate/3 never + returns to its caller.

If the process has any message in its message queue, - the process will be awaken immediately in the same way as - described above.

+ the process is awakened immediately in the same way as + described earlier.

In more technical terms, what erlang:hibernate/3 does - is the following. It discards the call stack for the process. - Then it garbage collects the process. After the garbage - collection, all live data is in one continuous heap. The heap + is the following. It discards the call stack for the process, + and then garbage collects the process. After this, + all live data is in one continuous heap. The heap is then shrunken to the exact same size as the live data - which it holds (even if that size is less than the minimum + that it holds (even if that size is less than the minimum heap size for the process).

If the size of the live data in the process is less than the minimum heap size, the first garbage collection occurring - after the process has been awaken will ensure that the heap + after the process is awakened ensures that the heap size is changed to a size not smaller than the minimum heap size.

-

Note that emptying the call stack means that any surrounding - catch is removed and has to be re-inserted after +

Notice that emptying the call stack means that any surrounding + catch is removed and must be reinserted after hibernation. One effect of this is that processes started using proc_lib (also indirectly, such as - gen_server processes), should use + gen_server processes), are to use proc_lib:hibernate/3 - instead to ensure that the exception handler continues to work + instead, to ensure that the exception handler continues to work when the process wakes up.

- Insert an element at index in a tuple + Inserts an element at index in a tuple. 1..tuple_size(Tuple1) + 1 -

- Returns a new tuple with element Term insert at position - Index in tuple Tuple1. - All elements from position Index and upwards are subsequently - pushed one step higher in the new tuple Tuple2. -

+

Returns a new tuple with element Term + inserted at position + Index in tuple Tuple1. + All elements from position Index and upwards are + pushed one step higher in the new tuple Tuple2.

+

Example:

 > erlang:insert_element(2, {one, two, three}, new).
 {one,new,two,three}
+ - Text representation of an integer + Text representation of an integer. -

Returns a binary which corresponds to the text - representation of Integer.

+

Returns a binary corresponding to the text + representation of Integer, for example:

 > integer_to_binary(77).
 <<"77">>
+ - Text representation of an integer + Text representation of an integer. -

Returns a binary which corresponds to the text - representation of Integer in base Base.

+

Returns a binary corresponding to the text + representation of Integer in base + Base, for example:

 > integer_to_binary(1023, 16).
 <<"3FF">>
+ - Text representation of an integer + Text representation of an integer. -

Returns a string which corresponds to the text - representation of Integer.

+

Returns a string corresponding to the text + representation of Integer, for example:

 > integer_to_list(77).
 "77"
+ - Text representation of an integer + Text representation of an integer. -

Returns a string which corresponds to the text - representation of Integer in base Base.

+

Returns a string corresponding to the text + representation of Integer in base + Base, for example:

 > integer_to_list(1023, 16).
 "3FF"
+ - Convert an iolist to a binary + Converts an iolist to a binary. -

Returns a binary which is made from the integers and - binaries in IoListOrBinary.

+

Returns a binary that is made from the integers and + binaries in IoListOrBinary, for example:

 > Bin1 = <<1,2,3>>.
 <<1,2,3>>
@@ -1847,278 +1961,311 @@ os_prompt% 
<<1,2,3,1,2,3,4,5,4,6>>
+ - Size of an iolist + Size of an iolist. -

Returns an integer which is the size in bytes - of the binary that would be the result of - iolist_to_binary(Item).

+

Returns an integer that is the size in bytes + of the binary that would be the result of + iolist_to_binary(Item), for example:

 > iolist_size([1,2|<<3,4>>]).
 4
+ - Check whether the local node is alive + Checks whether the local node is alive. -

Returns true if the local node is alive; that is, if - the node can be part of a distributed system. Otherwise, it - returns false.

+

Returns true if the local node is alive (that is, if + the node can be part of a distributed system), otherwise + false.

+ - Check whether a term is an atom + Checks whether a term is an atom. -

Returns true if Term is an atom; - otherwise returns false.

+

Returns true if Term is an atom, + otherwise false.

Allowed in guard tests.

+ - Check whether a term is a binary + Checks whether a term is a binary. -

Returns true if Term is a binary; - otherwise returns false.

- +

Returns true if Term is a binary, + otherwise false.

A binary always contains a complete number of bytes.

-

Allowed in guard tests.

+ - Check whether a term is a bitstring + Checks whether a term is a bitstring. -

Returns true if Term is a bitstring (including a binary); - otherwise returns false.

- +

Returns true if Term is a + bitstring (including a binary), otherwise false.

Allowed in guard tests.

+ - Check whether a term is a boolean + Checks whether a term is a boolean. -

Returns true if Term is - either the atom true or the atom false - (i.e. a boolean); otherwise returns false.

+

Returns true if Term is the + atom true or the atom false (that is, a boolean). + Otherwise returns false.

Allowed in guard tests.

+ - Check if a function is a BIF implemented in C + Checks if a function is a BIF implemented in C. -

Returns true if Module:Function/Arity is - a BIF implemented in C; otherwise returns false. - This BIF is useful for builders of cross reference tools.

+

This BIF is useful for builders of cross-reference tools.

+

Returns true if + Module:Function/Arity + ia a BIF implemented in C, otherwise false.

+ - Check whether a term is a float + Checks whether a term is a float.

Returns true if Term is a floating point - number; otherwise returns false.

+ number, otherwise false.

Allowed in guard tests.

+ - Check whether a term is a fun + Checks whether a term is a fun. -

Returns true if Term is a fun; otherwise - returns false.

+

Returns true if Term is a fun, otherwise + false.

Allowed in guard tests.

+ - Check whether a term is a fun with a given arity + Checks whether a term is a fun with a given arity.

Returns true if Term is a fun that can be - applied with Arity number of arguments; otherwise - returns false.

+ applied with Arity number of arguments, otherwise + false.

Allowed in guard tests.

+ - Check whether a term is an integer + Checks whether a term is an integer. -

Returns true if Term is an integer; - otherwise returns false.

+

Returns true if Term is an integer, + otherwise false.

Allowed in guard tests.

+ - Check whether a term is a list + Checks whether a term is a list.

Returns true if Term is a list with - zero or more elements; otherwise returns false.

+ zero or more elements, otherwise false.

Allowed in guard tests.

+ - Check whether a term is a map + Checks whether a term is a map. -

Returns true if Term is a map; - otherwise returns false.

+

Returns true if Term is a map, + otherwise false.

Allowed in guard tests.

+ - Check whether a term is a number + Checks whether a term is a number. -

Returns true if Term is either an integer or a - floating point number; otherwise returns false.

+

Returns true if Term is an integer or a + floating point number. Otherwise returns false.

Allowed in guard tests.

+ - Check whether a term is a pid + Checks whether a term is a process identifier. -

Returns true if Term is a pid (process - identifier); otherwise returns false.

+

Returns true if Term is a process + identifier, otherwise false.

Allowed in guard tests.

+ - Check whether a term is a port + Checks whether a term is a port. -

Returns true if Term is a port identifier; - otherwise returns false.

+

Returns true if Term is a port identifier, + otherwise false.

Allowed in guard tests.

+ - Check whether a process is alive + Checks whether a process is alive. -

- Pid must refer to a process at the local node. - Returns true if the process exists and is alive, that - is, is not exiting and has not exited. Otherwise, returns +

Pid must refer to a process at the local node.

+

Returns true if the process exists and is alive, that + is, is not exiting and has not exited. Otherwise returns false.

+ - Check whether a term appears to be a record + Checks whether a term appears to be a record. -

Returns true if Term is a tuple and its first - element is RecordTag. Otherwise, returns false.

+

Returns true if Term is a tuple and its + first element is RecordTag. + Otherwise returns false.

Normally the compiler treats calls to is_record/2 - specially. It emits code to verify that Term is a - tuple, that its first element is RecordTag, and that - the size is correct. However, if the RecordTag is - not a literal atom, the is_record/2 BIF will be - called instead and the size of the tuple will not be - verified.

+ specially. It emits code to verify that Term + is a tuple, that its first element is + RecordTag, and that the + size is correct. However, if RecordTag is + not a literal atom, the BIF is_record/2 is called + instead and the size of the tuple is not verified.

-

Allowed in guard tests, if RecordTag is a literal - atom.

+

Allowed in guard tests, if RecordTag is + a literal atom.

+ - Check whether a term appears to be a record - -

RecordTag must be an atom. Returns true if - Term is a tuple, its first element is RecordTag, - and its size is Size. Otherwise, returns false.

-

Allowed in guard tests, provided that RecordTag is + Checks whether a term appears to be a record. + +

RecordTag must be an atom.

+

Returns true if + Term is a tuple, + its first element is RecordTag, + and its size is Size. + Otherwise returns false.

+

Allowed in guard tests if RecordTag is a literal atom and Size is a literal integer.

-

This BIF is documented for completeness. In most cases - is_record/2 should be used.

+

This BIF is documented for completeness. Usually + is_record/2 is to be used.

+ - Check whether a term is a reference + Checks whether a term is a reference. -

Returns true if Term is a reference; - otherwise returns false.

+

Returns true if Term is a reference, + otherwise false.

Allowed in guard tests.

+ - Check whether a term is a tuple + Checks whether a term is a tuple. -

Returns true if Term is a tuple; - otherwise returns false.

+

Returns true if Term is a tuple, + otherwise false.

Allowed in guard tests.

+ - Length of a list + Length of a list. -

Returns the length of List.

+

Returns the length of List, for example:

 > length([1,2,3,4,5,6,7,8,9]).
 9

Allowed in guard tests.

+ - Create a link to another process (or port) + Creates a link to another process (or port).

Creates a link between the calling process and another - process (or port) PidOrPort, if there is not such a link + process (or port) PidOrPort, if there is + not such a link already. If a process attempts to create a link to itself, nothing is done. Returns true.

-

If PidOrPort does not exist, the behavior of the BIF depends - on if the calling process is trapping exits or not (see +

If PidOrPort does not exist, the behavior + of the BIF + depends on if the calling process is trapping exits or not (see process_flag/2):

If the calling process is not trapping exits, and - checking PidOrPort is cheap -- that is, if PidOrPort is - local -- link/1 fails with reason noproc. + checking PidOrPort is cheap + (that is, if PidOrPort + is local), link/1 fails with reason noproc. Otherwise, if the calling process is trapping exits, - and/or PidOrPort is remote, link/1 returns - true, but an exit signal with reason noproc + and/or PidOrPort is remote, link/1 + returns true, but an exit signal with reason noproc is sent to the calling process.
+ - Convert from text representation to an atom - -

Returns the atom whose text representation is String.

-

String may only contain ISO-latin-1 - characters (i.e. numbers below 256) as the current - implementation does not allow unicode characters >= 256 in - atoms. For more information on Unicode support in atoms - see note on UTF-8 encoded atoms - in the chapter about the external term format in the ERTS User's Guide.

+ Converts from text representation to an atom. + +

Returns the atom whose text representation is + String.

+

String can only contain ISO-latin-1 + characters (that is, + numbers less than 256) as the implementation does not + allow unicode characters equal to or above 256 in atoms. + For more information on Unicode support in atoms, see + note on UTF-8 + encoded atoms + in Section "External Term Format" in the User's Guide.

+

Example:

 > list_to_atom("Erlang").
 'Erlang'
+ - Convert a list to a binary + Converts a list to a binary. -

Returns a binary which is made from the integers and - binaries in IoList.

+

Returns a binary that is made from the integers and + binaries in IoList, for example:

 > Bin1 = <<1,2,3>>.
 <<1,2,3>>
@@ -2130,14 +2277,16 @@ os_prompt% 
<<1,2,3,1,2,3,4,5,4,6>>
+ + Converts a list to a bitstring. - Convert a list to a bitstring -

Returns a bitstring which is made from the integers and - bitstrings in BitstringList. (The last tail in BitstringList - is allowed to be a bitstring.)

+

Returns a bitstring that is made from the integers and + bitstrings in BitstringList. (The last tail in + BitstringList is allowed to be a bitstring.)

+

Example:

 > Bin1 = <<1,2,3>>.
 <<1,2,3>>
@@ -2149,21 +2298,25 @@ os_prompt% 
<<1,2,3,1,2,3,4,5,4,6,7:46>>
+ - Convert from text representation to an atom + Converts from text representation to an atom. -

Returns the atom whose text representation is String, +

Returns the atom whose text representation is + String, but only if there already exists such atom.

Failure: badarg if there does not already exist an atom whose text representation is String.

+ - Convert from text representation to a float + Converts from text representation to a float. -

Returns the float whose text representation is String.

+

Returns the float whose text representation is + String, for example:

 > list_to_float("2.2017764e+0").
 2.2017764
@@ -2171,12 +2324,13 @@ os_prompt% representation of a float.

+ - Convert from text representation to an integer + Converts from text representation to an integer.

Returns an integer whose text representation is - String.

+ String, for example:

 > list_to_integer("123").
 123
@@ -2184,12 +2338,14 @@ os_prompt% representation of an integer.

+ - Convert from text representation to an integer + Converts from text representation to an integer.

Returns an integer whose text representation in base - Base is String.

+ Base is String, + for example:

 > list_to_integer("3FF", 16).
 1023
@@ -2197,47 +2353,52 @@ os_prompt% representation of an integer.

+ - Convert from text representation to a pid + Converts from text representation to a pid. -

Returns a pid whose text representation is String.

- -

This BIF is intended for debugging and for use in - the Erlang operating system. It should not be used in - application programs.

-
+

Returns a process identifier whose text representation is a + String, for example:

 > list_to_pid("<0.4.1>").
 <0.4.1>

Failure: badarg if String contains a bad - representation of a pid.

+ representation of a process identifier.

+ +

This BIF is intended for debugging and for use in the + Erlang OS. It is not to be used in application programs.

+
+ - Convert a list to a tuple + Converts a list to a tuple. -

Returns a tuple which corresponds to List. List - can contain any Erlang terms.

+

Returns a tuple corresponding to List, + for example

 > list_to_tuple([share, ['Ericsson_B', 163]]).
 {share, ['Ericsson_B', 163]}
+

List can contain any Erlang terms.

+ - Load object code for a module + Loads object code for a module. -

If Binary contains the object code for the module - Module, this BIF loads that object code. Also, if - the code for the module Module already exists, all +

If Binary contains the object code for module + Module, this BIF loads that object code. If + the code for module Module already exists, all export references are replaced so they point to the newly loaded code. The previously loaded code is kept in the system - as old code, as there may still be processes which are - executing that code. It returns either - {module, Module}, or {error, Reason} if loading - fails. Reason is one of the following:

+ as old code, as there can still be processes executing + that code.

+

Returns either {module, Module}, or + {error, Reason} if loading fails. + Reason is any of the following:

badfile @@ -2247,118 +2408,122 @@ os_prompt% not_purged -

Binary contains a module which cannot be loaded - because old code for this module already exists.

+

Binary contains a module that cannot be + loaded because old code for this module already exists.

This BIF is intended for the code server (see - code(3)) and should not be - used elsewhere.

+ code(3)) + and is not to be used elsewhere.

+ - Load NIF library + Loads NIF library. -

In releases older than OTP R14B, NIFs were an - experimental feature. Versions of OTP older than R14B might +

Before OTP R14B, NIFs were an + experimental feature. Versions before OTP R14B can have different and possibly incompatible NIF semantics and - interfaces. For example, in R13B03 the return value on - failure was - {error,Reason,Text}.

+ interfaces. For example, in OTP R13B03 the return value on + failure was {error,Reason,Text}.

Loads and links a dynamic library containing native - implemented functions (NIFs) for a module. Path is a - file path to the sharable object/dynamic library file minus - the OS-dependent file extension (.so for Unix and .dll for - Windows). See erl_nif - on how to implement a NIF library.

-

LoadInfo can be any term. It will be passed on to + implemented functions (NIFs) for a module. Path + is a file path to the sharable object/dynamic library file minus + the OS-dependent file extension (.so for Unix and + .dll for Windows. For information on how to + implement a NIF library, see + erl_nif.

+

LoadInfo can be any term. It is passed on to the library as part of the initialization. A good practice is to include a module version number to support future code upgrade scenarios.

The call to load_nif/2 must be made directly from the Erlang code of the module that the - NIF library belongs to.

-

It returns either ok, or {error,{Reason,Text}} - if loading fails. Reason is one of the atoms below, - while Text is a human readable string that may give - some more information about the failure.

+ NIF library belongs to. It returns either ok, or + {error,{Reason,Text}} if loading fails. + Reason is one of the following atoms + while Text is a human readable string that + can give more information about the failure:

load_failed - -

The OS failed to load the NIF library.

+ The OS failed to load the NIF library. bad_lib - -

The library did not fulfil the requirements as a NIF - library of the calling module.

+ The library did not fulfill the requirements as a NIF + library of the calling module. load | reload | upgrade - -

The corresponding library callback was not successful.

+ The corresponding library callback was unsuccessful. old_code - -

The call to load_nif/2 was made from the old - code of a module that has been upgraded. This is not - allowed.

+ The call to load_nif/2 was made from the old + code of a module that has been upgraded; this is not + allowed.
+ - List of all loaded modules + Lists all loaded modules. -

Returns a list of all loaded Erlang modules (current and/or +

Returns a list of all loaded Erlang modules (current and old code), including preloaded modules.

See also code(3).

+ - Current local date and time + Current local date and time. -

Returns the current local date and time - {{Year, Month, Day}, {Hour, Minute, Second}}.

-

The time zone and daylight saving time correction depend - on the underlying OS.

+

Returns the current local date and time, + {{Year, Month, Day}, {Hour, Minute, Second}}, + for example:

 > erlang:localtime().
 {{1996,11,6},{14,45,17}}
+

The time zone and Daylight Saving Time correction depend + on the underlying OS.

+ - Convert from local to Universal Time Coordinated (UTC) date and time + Converts from local to Universal Time Coordinated (UTC) date and time.

Converts local date and time to Universal Time Coordinated - (UTC), if this is supported by the underlying OS. Otherwise, - no conversion is done and Localtime is returned.

+ (UTC), if supported by the underlying OS. Otherwise + no conversion is done and Localtime + is returned.

+

Example:

 > erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}).
 {{1996,11,6},{13,45,17}}
-

Failure: badarg if Localtime does not denote - a valid date and time.

+

Failure: badarg if Localtime denotes an + invalid date and time.

+ - Convert from local to Universal Time Coordinated (UTC) date and time + Converts from local to Universal Time Coordinated (UTC) date and time.

Converts local date and time to Universal Time Coordinated - (UTC) just like erlang:localtime_to_universaltime/1, - but the caller decides if daylight saving time is active or - not.

-

If IsDst == true the Localtime is during - daylight saving time, if IsDst == false it is not, - and if IsDst == undefined the underlying OS may + (UTC) as erlang:localtime_to_universaltime/1, + but the caller decides if Daylight Saving Time is active.

+

If IsDst == true, Localtime is + during Daylight Saving Time, if IsDst == false it is + not. If IsDst == undefined, the underlying OS can guess, which is the same as calling erlang:localtime_to_universaltime(Localtime).

+

Examples:

 > erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}, true).
 {{1996,11,6},{12,45,17}}
@@ -2366,13 +2531,14 @@ os_prompt% 
{{1996,11,6},{13,45,17}} > erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}, undefined). {{1996,11,6},{13,45,17}} -

Failure: badarg if Localtime does not denote - a valid date and time.

+

Failure: badarg if Localtime denotes an + invalid date and time.

+ - Return a unique reference + Returns a unique reference.

Return a unique reference. The reference is unique among @@ -2383,200 +2549,209 @@ os_prompt% created on an older node with the same node name.

+ - Create a new tuple of a given arity + Creates a new tuple of a given arity. -

Returns a new tuple of the given Arity, where all - elements are InitialValue.

+

Creates a new tuple of the given Arity, where all + elements are InitialValue, for example:

 > erlang:make_tuple(4, []).
 {[],[],[],[]}
+ - Create a new tuple with given arity and contents - -

erlang:make_tuple first creates a tuple of size Arity - where each element has the value DefaultValue. It then fills - in values from InitList. Each list element in InitList - must be a two-tuple where the first element is a position in the - newly created tuple and the second element is any term. If a position - occurs more than once in the list, the term corresponding to - last occurrence will be used.

+ Creates a new tuple with given arity and contents. + +

Creates a tuple of size Arity, where each element + has value DefaultValue, and then fills in + values from InitList. + Each list element in InitList + must be a two-tuple, where the first element is a position in the + newly created tuple and the second element is any term. If a + position occurs more than once in the list, the term corresponding + to the last occurrence is used.

+

Example:

 > erlang:make_tuple(5, [], [{2,ignored},{5,zz},{2,aa}]).
 {{[],aa,[],[],zz}
+ - Return the size of a map + Returns the size of a map. -

Returns an integer which is the number of key-value pairs in Map.

+

Returns an integer, which is the number of key-value pairs + in Map, for example:

 > map_size(#{a=>1, b=>2, c=>3}).
 3

Allowed in guard tests.

+ - Return the largest of two term + Returns the largest of two terms. -

Return the largest of Term1 and Term2; - if the terms compare equal, Term1 will be returned.

+

Returns the largest of Term1 and + Term2. + If the terms are equal, Term1 is returned.

+ - Compute an MD5 message digest + Computes an MD5 message digest. -

Computes an MD5 message digest from Data, where - the length of the digest is 128 bits (16 bytes). Data +

Computes an MD5 message digest from Data, where + the length of the digest is 128 bits (16 bytes). + Data is a binary or a list of small integers and binaries.

-

See The MD5 Message Digest Algorithm (RFC 1321) for more - information about MD5.

-

The MD5 Message Digest Algorithm is not considered - safe for code-signing or software integrity purposes.

+

For more information about MD5, see RFC 1321 - The + MD5 Message-Digest Algorithm.

+

The MD5 Message-Digest Algorithm is not considered + safe for code-signing or software-integrity purposes.

+ - Finish the update of an MD5 context and return the computed MD5 message digest + Finishes the update of an MD5 context and returns the computed MD5 message digest.

Finishes the update of an MD5 Context and returns the computed MD5 message digest.

+ - Create an MD5 context + Creates an MD5 context.

Creates an MD5 context, to be used in subsequent calls to md5_update/2.

+ - Update an MD5 context with data, and return a new context + Updates an MD5 context with data and returns a new context. -

Updates an MD5 Context with Data, and returns - a NewContext.

+

Updates an MD5 Context with + Data and returns a + NewContext.

+ + Information about dynamically allocated memory. - Information about dynamically allocated memory - -

Returns a list containing information about memory - dynamically allocated by the Erlang emulator. Each element of - the list is a tuple {Type, Size}. The first element - Typeis an atom describing memory type. The second - element Sizeis memory size in bytes. A description of - each memory type follows:

+ +

Returns a list with information about memory + dynamically allocated by the Erlang emulator. Each list + element is a tuple {Type, Size}. The first element + Type is an atom describing memory type. The second + element Size is the memory size in bytes.

+

The memory types are as follows:

total -

The total amount of memory currently allocated, which is - the same as the sum of memory size for processes +

The total amount of memory currently allocated. This is + the same as the sum of the memory size for processes and system.

processes -

The total amount of memory currently allocated by +

The total amount of memory currently allocated for the Erlang processes.

processes_used

The total amount of memory currently used by the Erlang - processes.

-

This memory is part of the memory presented as + processes. This is part of the memory presented as processes memory.

system -

The total amount of memory currently allocated by +

The total amount of memory currently allocated for the emulator that is not directly related to any Erlang - process.

-

Memory presented as processes is not included in - this memory.

+ process. Memory presented as processes is not + included in this memory.

atom -

The total amount of memory currently allocated for atoms.

-

This memory is part of the memory presented as +

The total amount of memory currently allocated for atoms. + This memory is part of the memory presented as system memory.

atom_used -

The total amount of memory currently used for atoms.

-

This memory is part of the memory presented as +

The total amount of memory currently used for atoms. + This memory is part of the memory presented as atom memory.

binary

The total amount of memory currently allocated for - binaries.

-

This memory is part of the memory presented as - system memory.

+ binaries. This memory is part of the memory presented + as system memory.

code

The total amount of memory currently allocated for - Erlang code.

-

This memory is part of the memory presented as - system memory.

+ Erlang code. This memory is part of the memory presented + as system memory.

ets

The total amount of memory currently allocated for ets - tables.

-

This memory is part of the memory presented as + tables. This memory is part of the memory presented as system memory.

low -

Only on 64-bit halfword emulator.

-

The total amount of memory allocated in low memory areas - that are restricted to less than 4 Gb even though - the system may have more physical memory.

-

May be removed in future releases of halfword emulator.

+

Only on 64-bit halfword emulator. + The total amount of memory allocated in low memory areas + that are restricted to less than 4 GB, although + the system can have more memory.

+

Can be removed in a future release of the halfword + emulator.

maximum

The maximum total amount of memory allocated since - the emulator was started.

-

This tuple is only present when the emulator is run with - instrumentation.

+ the emulator was started. This tuple is only present + when the emulator is run with instrumentation.

For information on how to run the emulator with - instrumentation see + instrumentation, see instrument(3) and/or erl(1).

The system value is not complete. Some allocated - memory that should be part of the system value are - not.

+ memory that is to be part of this value is not.

When the emulator is run with instrumentation, the system value is more accurate, but memory - directly allocated by malloc (and friends) are still + directly allocated for malloc (and friends) is still not part of the system value. Direct calls to - malloc are only done from OS specific runtime - libraries and perhaps from user implemented Erlang drivers + malloc are only done from OS-specific runtime + libraries and perhaps from user-implemented Erlang drivers that do not use the memory allocation functions in the driver interface.

-

Since the total value is the sum of processes - and system the error in system will propagate +

As the total value is the sum of processes + and system, the error in system propagates to the total value.

The different amounts of memory that are summed are - not gathered atomically which also introduce + not gathered atomically, which introduces an error in the result.

-

The different values has the following relation to each +

The different values have the following relation to each other. Values beginning with an uppercase letter is not part of the result.

@@ -2584,69 +2759,62 @@ os_prompt% processes = processes_used + ProcessesNotUsed system = atom + binary + code + ets + OtherSystem atom = atom_used + AtomNotUsed - RealTotal = processes + RealSystem RealSystem = system + MissedSystem -

More tuples in the returned list may be added in the future.

+

More tuples in the returned list can be added in a + future release.

The total value is supposed to be the total amount of memory dynamically allocated by the emulator. Shared libraries, the code of the emulator itself, and - the emulator stack(s) are not supposed to be included. That + the emulator stacks are not supposed to be included. That is, the total value is not supposed to be - equal to the total size of all pages mapped to the emulator. - Furthermore, due to fragmentation and pre-reservation of - memory areas, the size of the memory segments which contain - the dynamically allocated memory blocks can be substantially + equal to the total size of all pages mapped to the emulator.

+

Furthermore, because of fragmentation and prereservation of + memory areas, the size of the memory segments containing + the dynamically allocated memory blocks can be much larger than the total size of the dynamically allocated memory blocks.

-

- Since erts version 5.6.4 erlang:memory/0 requires that +

As from ERTS 5.6.4, erlang:memory/0 requires that all erts_alloc(3) - allocators are enabled (default behaviour). -

+ allocators are enabled (default behavior).

-

Failure:

- - notsup - - If an erts_alloc(3) - allocator has been disabled. - - +

Failure: notsup if an + erts_alloc(3) + allocator has been disabled.

+ + Information about dynamically allocated memory. - Information about dynamically allocated memory

Returns the memory size in bytes allocated for memory of type Type. The argument can also be given as a list of memory_type() atoms, in which case a corresponding list of {memory_type(), Size :: integer >= 0} tuples is returned.

-

- Since erts version 5.6.4 erlang:memory/1 requires that +

As from ERTS version 5.6.4, + erlang:memory/1 requires that all erts_alloc(3) - allocators are enabled (default behaviour). -

+ allocators are enabled (default behavior).

Failures:

badarg - If Type is not one of the memory types listed in the - documentation of + If Type is not one of the memory types + listed in the decription of erlang:memory/0. badarg - If maximum is passed as Type and the emulator - is not run in instrumented mode. + If maximum is passed as Type and + the emulator is not run in instrumented mode. notsup @@ -2658,35 +2826,39 @@ os_prompt% erlang:memory/0.

+ - Return the smallest of two term + Returns the smallest of two terms. -

Return the smallest of Term1 and Term2; - if the terms compare equal, Term1 will be returned.

+

Returns the smallest of Term1 and + Term2. + If the terms are equal, Term1 is returned.

+ - Check if a module is loaded + Checks if a module is loaded. -

Returns true if the module Module is loaded, - otherwise returns false. It does not attempt to load +

Returns true if the module Module + is loaded, otherwise false. It does not attempt to load the module.

This BIF is intended for the code server (see - code(3)) and should not be + code(3)) and is not to be used elsewhere.

+ - Start monitoring + Starts monitoring.

Send a monitor request of type Type to the entity identified by Item. The caller of @@ -2695,14 +2867,14 @@ os_prompt% {Tag, MonitorRef, Type, Object, Info}

The monitor request is an asynchronous signal. That is, it takes time before the signal reach its destination.

-

Currently valid Types:

+

Valid Types:

process

Monitor the existence of the process identified by - Item. Currently valid + Item. Valid Items in combination with the - process Type:

+ process Type can be any of the following:

pid() @@ -2721,10 +2893,10 @@ os_prompt% will become monitored.

-

When a process is monitored by registered name, the - process that has the registered name at the time when the +

When a registered name is used, the + process that has the registered name when the monitor request reach its destination will be monitored. - The monitor will not be effected, if the registered name is + The monitor is not effected if the registered name is unregistered, or unregistered and later registered on another process.

The monitor is triggered either when the monitored process @@ -2732,22 +2904,22 @@ os_prompt% lost. In the case the connection to it is lost, we do not know if it still exist or not. After this type of monitor has been triggered, the monitor is automatically removed.

-

When the monitor is triggered a 'DOWN' message will - be sent to the monitoring process. A 'DOWN' message has +

When the monitor is triggered a 'DOWN' message is + sent to the monitoring process. A 'DOWN' message has the following pattern:

{'DOWN', MonitorRef, Type, Object, Info} -

where MonitorRef and Type are the same as - described above, and:

+

Here MonitorRef and Type are the same as + described earlier, and:

Object

equals:

Item - If Item was specified by a - pid. + If Item is specified by a + process identifier. {RegisteredName, Node} - If Item was specified as + If Item is specified as RegisteredName, or {RegisteredName, Node} where Node corresponds to the node that the monitored process resides on. @@ -2760,26 +2932,26 @@ os_prompt% connection to the node where the monitored process resides).

-

The monitoring is turned off either when the 'DOWN' - message is sent, or when +

The monitoring is turned off when the 'DOWN' + message is sent or when demonitor/1 is called.

If an attempt is made to monitor a process on an older node - (where remote process monitoring is not implemented or one + (where remote process monitoring is not implemented or where remote process monitoring by registered name is not implemented), the call fails with badarg.

-

The format of the 'DOWN' message changed in the 5.2 - version of the emulator (OTP release R9B) for monitor - by registered name. The Object element of +

The format of the 'DOWN' message changed in ERTS + version 5.2 (OTP R9B) for monitoring + by registered name. Element Object of the 'DOWN' message could in earlier versions - sometimes be the pid of the monitored process and sometimes - be the registered name. Now the Object element is + sometimes be the process identifier of the monitored process and sometimes + be the registered name. Now element Object is always a tuple consisting of the registered name and - the node name. Processes on new nodes (emulator version 5.2 - or greater) will always get 'DOWN' messages on + the node name. Processes on new nodes (ERTS version 5.2 + or higher) always get 'DOWN' messages on the new format even if they are monitoring processes on old - nodes. Processes on old nodes will always get 'DOWN' + nodes. Processes on old nodes always get 'DOWN' messages on the old format.

@@ -2836,7 +3008,7 @@ os_prompt%

When the 'CHANGE' message has been received you are guaranteed not to retrieve the old time offset when calling erlang:time_offset(). - Note that you may observe the change of the time offset + Note that you can observe the change of the time offset when calling erlang:time_offset() before you get the 'CHANGE' message.

@@ -2844,64 +3016,68 @@ os_prompt%

Making several calls to monitor/2 for the same Item and/or Type is not - an error; it results in many, completely independent, - monitorings.

+ an error; it results in as many independent monitorings.

The monitor functionality is expected to be extended. That is, other Types and Items - are expected to be supported in the future.

+ are expected to be supported in a future release.

-

If/when monitor/2 is extended, other - possible values for Tag, Object, and +

If or when monitor/2 is extended, other + possible values for Tag, Object and Info in the monitor message will be introduced.

+ - Monitor the status of a node + Monitors the status of a node. -

Monitors the status of the node Node. If Flag - is true, monitoring is turned on; if Flag is - false, monitoring is turned off.

+

Monitors the status of the node Node. + If Flag + is true, monitoring is turned on. If Flag + is false, monitoring is turned off.

Making several calls to monitor_node(Node, true) for - the same Node is not an error; it results in as many, - completely independent, monitorings.

+ the same Node is not an error; it results + in as many independent monitorings.

If Node fails or does not exist, the message {nodedown, Node} is delivered to the process. If a process has made two calls to monitor_node(Node, true) - and Node terminates, two nodedown messages are - delivered to the process. If there is no connection to - Node, there will be an attempt to create one. If this - fails, a nodedown message is delivered.

+ and Node terminates, two nodedown messages + are delivered to the process. If there is no connection to + Node, an attempt is made to create one. + If this fails, a nodedown message is delivered.

Nodes connected through hidden connections can be monitored - as any other node.

+ as any other nodes.

Failure: badarg if the local node is not alive.

+ - Monitor the status of a node + Monitors the status of a node. -

Behaves as monitor_node/2 except that it allows an +

Behaves as + monitor_node/2 + except that it allows an extra option to be given, namely allow_passive_connect. - The option allows the BIF to wait the normal net connection - timeout for the monitored node to connect itself, + This option allows the BIF to wait the normal network connection + time-out for the monitored node to connect itself, even if it cannot be actively connected from this node - (i.e. it is blocked). The state where this might be useful can - only be achieved by using the kernel option - dist_auto_connect once. If that kernel option is not - used, the allow_passive_connect option has no - effect.

+ (that is, it is blocked). The state where this can be useful + can only be achieved by using the Kernel option + dist_auto_connect once. If that option is not + used, option allow_passive_connect has no effect.

-

The allow_passive_connect option is used +

Option allow_passive_connect is used internally and is seldom needed in applications where the - network topology and the kernel options in effect is known in - advance.

+ network topology and the Kernel options in effect + are known in advance.

Failure: badarg if the local node is not alive or the option list is malformed.

+ Current Erlang monotonic time @@ -2949,61 +3125,68 @@ os_prompt% - Stop execution with a given reason + Stops execution with a given reason.

Works exactly like - erlang:error/1, - but Dialyzer thinks that this BIF will return an arbitrary term. - When used in a stub function for a NIF to generate an - exception when the NIF library is not loaded, Dialyzer - will not generate false warnings.

+ erlang:error/1, but + Dialyzer thinks that this BIF will return an arbitrary + term. When used in a stub function for a NIF to generate an + exception when the NIF library is not loaded, Dialyzer + does not generate false warnings.

+ - Stop execution with a given reason + Stops execution with a given reason.

Works exactly like - erlang:error/2, - but Dialyzer thinks that this BIF will return an arbitrary term. - When used in a stub function for a NIF to generate an - exception when the NIF library is not loaded, Dialyzer - will not generate false warnings.

+ erlang:error/2, but + Dialyzer thinks that this BIF will return an arbitrary + term. When used in a stub function for a NIF to generate an + exception when the NIF library is not loaded, Dialyzer + does not generate false warnings.

+ - Name of the local node + Name of the local node.

Returns the name of the local node. If the node is not alive, nonode@nohost is returned instead.

Allowed in guard tests.

+ - At which node is a pid, port or reference located + At which node a pid, port, or reference is located. -

Returns the node where Arg is located. Arg can - be a pid, a reference, or a port. If the local node is not +

Returns the node where Arg is located. + Arg can + be a process identifier, a reference, or a port. + If the local node is not alive, nonode@nohost is returned.

Allowed in guard tests.

+ - All visible nodes in the system + All visible nodes in the system. -

Returns a list of all visible nodes in the system, excluding +

Returns a list of all visible nodes in the system, except the local node. Same as nodes(visible).

+ - All nodes of a certain type in the system + All nodes of a certain type in the system. -

Returns a list of nodes according to argument given. - The result returned when the argument is a list, is the list +

Returns a list of nodes according to the argument given. + The returned result when the argument is a list, is the list of nodes satisfying the disjunction(s) of the list elements.

NodeType can be any of the following:

@@ -3025,22 +3208,24 @@ os_prompt% known -

Nodes which are known to this node, i.e., connected, - previously connected, etc.

+

Nodes that are known to this node, for example, connected + and previously connected.

Some equalities: [node()] = nodes(this), nodes(connected) = nodes([visible, hidden]), and nodes() = nodes(visible).

If the local node is not alive, - nodes(this) == nodes(known) == [nonode@nohost], for - any other Arg the empty list [] is returned.

+ nodes(this) == nodes(known) == [nonode@nohost]. For + any other Arg the empty list + [] is returned.

+ + Elapsed time since 00:00 GMT. - Elapsed time since 00:00 GMT

This function is deprecated! Do not use it! See the users guide chapter @@ -3050,107 +3235,101 @@ os_prompt% section for information on what to use instead of erlang:now/0.

Returns the tuple {MegaSecs, Secs, MicroSecs} which is - the elapsed time since 00:00 GMT, January 1, 1970 (zero hour) + the elapsed time since 00:00 GMT, January 1, 1970 (zero hour), on the assumption that the underlying OS supports this. - Otherwise, some other point in time is chosen. It is also - guaranteed that subsequent calls to this BIF returns + Otherwise some other point in time is chosen. It is also + guaranteed that subsequent calls to this BIF return continuously increasing values. Hence, the return value from - now() can be used to generate unique time-stamps, - and if it is called in a tight loop on a fast machine + now() can be used to generate unique time-stamps. + If it is called in a tight loop on a fast machine, the time of the node can become skewed.

-

It can only be used to check the local time of day if - the time-zone info of the underlying operating system is +

Can only be used to check the local time of day if + the time-zone information of the underlying OS is properly configured.

+ - Open a port + Opens a port.

Returns a port identifier as the result of opening a new Erlang port. A port can be seen as an external Erlang - process. -

+ process.

The name of the executable as well as the arguments - given in cd, env, args and arg0 is subject to - Unicode file name translation if the system is running - in Unicode file name mode. To avoid - translation or force i.e. UTF-8, supply the executable + given in cd, env, args, and arg0 are + subject to Unicode filename translation if the system is running + in Unicode filename mode. To avoid + translation or force, that is, UTF-8, supply the executable and/or arguments as a binary in the correct - encoding. See the file module, the - - file:native_name_encoding/0 function and the - stdlib users guide - for details.

- -

The characters in the name (if given as a list) - can only be > 255 if the Erlang VM is started in - Unicode file name translation mode, otherwise the name + encoding. For details, see the module + file, the function + file:native_name_encoding/0, and the + STDLIB + User's Guide.

+

The characters in the name (if given as a list) can + only be higher than 255 if the Erlang Virtual Machine is started + in Unicode filename translation mode. Otherwise the name of the executable is limited to the ISO-latin-1 character set.

- -

PortName is one of the following:

+

PortName can be any of the following:

{spawn, Command} -

Starts an external program. Command is the name - of the external program which will be run. Command +

Starts an external program. Command + is the name of the external program to be run. + Command runs outside the Erlang work space unless an Erlang - driver with the name Command is found. If found, - that driver will be started. A driver runs in the Erlang + driver with the name Command is found. + If found, that driver is started. A driver runs in the Erlang workspace, which means that it is linked with the Erlang runtime system.

When starting external programs on Solaris, the system call vfork is used in preference to fork for performance reasons, although it has a history of - being less robust. If there are problems with using - vfork, setting the environment variable - ERL_NO_VFORK to any value will cause fork + being less robust. If there are problems using + vfork, setting environment variable + ERL_NO_VFORK to any value causes fork to be used instead.

- -

For external programs, the PATH is searched +

For external programs, PATH is searched (or an equivalent method is used to find programs, - depending on operating system). This is done by invoking - the shell on certain platforms. The first space - separated token of the command will be considered as the + depending on OS). This is done by invoking + the shell on certain platforms. The first space-separated + token of the command is considered as the name of the executable (or driver). This (among other things) makes this option unsuitable for running - programs having spaces in file or directory names. Use - {spawn_executable, Command} instead if spaces in executable - file names is desired.

+ programs having spaces in filenames or directory names. + If spaces in executable filenames are desired, use + {spawn_executable, Command} instead.

{spawn_driver, Command}

Works like {spawn, Command}, but demands the - first (space separated) token of the command to be the name of a + first (space-separated) token of the command to be the name of a loaded driver. If no driver with that name is loaded, a badarg error is raised.

{spawn_executable, FileName} -

Works like {spawn, FileName}, but only runs - external executables. The FileName in its whole - is used as the name of the executable, including any - spaces. If arguments are to be passed, the - args and arg0 PortSettings can be used.

- -

The shell is not usually invoked to start the - program, it's executed directly. Neither is the - PATH (or equivalent) searched. To find a program - in the PATH to execute, use os:find_executable/1.

+ external executables. FileName in its whole + is used as the name of the executable, including any spaces. + If arguments are to be passed, the PortSettings + args and arg0 can be used.

+

The shell is usually not invoked to start the + program, it is executed directly. PATH (or + equivalent) is not searched. To find a program + in PATH to execute, use + os:find_executable/1.

Only if a shell script or .bat file is - executed, the appropriate command interpreter will - implicitly be invoked, but there will still be no - command argument expansion or implicit PATH search.

- -

If the FileName cannot be run, an error - exception, with the posix error code as the reason, is - raised. The error reason may differ between operating - systems. Typically the error enoent is raised - when one tries to run a program that is not found and + executed, the appropriate command interpreter is + invoked implicitly, but there is still no + command argument expansion or implicit PATH search.

+

If FileName cannot be run, an error + exception is raised, with the POSIX error code as the reason. + The error reason can differ between OSs. + Typically the error enoent is raised when an + attempt is made to run a program that is not found and eacces is raised when the given file is not executable.

@@ -3160,19 +3339,18 @@ os_prompt% file descriptors used by Erlang. The file descriptor In can be used for standard input, and the file descriptor Out for standard output. It is only - used for various servers in the Erlang operating system - (shell and user). Hence, its use is very - limited.

+ used for various servers in the Erlang OS (shell + and user). Hence, its use is limited.

PortSettings is a list of settings for the port. - Valid settings are:

+ The valid settings are as follows:

{packet, N}

Messages are preceded by their length, sent in N - bytes, with the most significant byte first. Valid values - for N are 1, 2, or 4.

+ bytes, with the most significant byte first. The valid values + for N are 1, 2, and 4.

stream @@ -3183,116 +3361,108 @@ os_prompt% {line, L}

Messages are delivered on a per line basis. Each line - (delimited by the OS-dependent newline sequence) is - delivered in one single message. The message data format - is {Flag, Line}, where Flag is either - eol or noeol and Line is the actual - data delivered (without the newline sequence).

+ (delimited by the OS-dependent new line sequence) is + delivered in a single message. The message data format + is {Flag, Line}, where Flag is + eol or noeol, and Line is the + data delivered (without the new line sequence).

L specifies the maximum line length in bytes. - Lines longer than this will be delivered in more than one - message, with the Flag set to noeol for all + Lines longer than this are delivered in more than one + message, with Flag set to noeol for all but the last message. If end of file is encountered - anywhere else than immediately following a newline - sequence, the last line will also be delivered with - the Flag set to noeol. In all other cases, + anywhere else than immediately following a new line + sequence, the last line is also delivered with + Flag set to noeol. Otherwise lines are delivered with Flag set to eol.

-

The {packet, N} and {line, L} settings are - mutually exclusive.

+

The {packet, N} and {line, + L} settings are mutually exclusive.

{cd, Dir} -

This is only valid for {spawn, Command} and - {spawn_executable, FileName}. +

Only valid for {spawn, Command} and + {spawn_executable, FileName}. The external program starts using Dir as its - working directory. Dir must be a string. -

+ working directory. Dir must be a string.

{env, Env} -

This is only valid for {spawn, Command} and +

Only valid for {spawn, Command} and {spawn_executable, FileName}. The environment of the started process is extended using the environment specifications in Env.

-

Env should be a list of tuples {Name, Val}, - where Name is the name of an environment variable, - and Val is the value it is to have in the spawned - port process. Both Name and Val must be - strings. The one exception is Val being the atom +

Env is to be a list of tuples + {Name, Val}, + where Name is the name of an + environment variable, and Val is the + value it is to have in the spawned + port process. Both Name and + Val must be strings. The one + exception is Val being the atom false (in analogy with os:getenv/1), which - removes the environment variable. -

+ removes the environment variable.

{args, [ string() | binary() ]} - -

This option is only valid for {spawn_executable, FileName} +

Only valid for {spawn_executable, FileName} and specifies arguments to the executable. Each argument is given as a separate string and (on Unix) eventually ends up as one element each in the argument vector. On - other platforms, similar behavior is mimicked.

- -

The arguments are not expanded by the shell prior to - being supplied to the executable, most notably this - means that file wildcard expansion will not happen. Use - filelib:wildcard/1 - to expand wildcards for the arguments. Note that even if + other platforms, a similar behavior is mimicked.

+

The arguments are not expanded by the shell before + being supplied to the executable. Most notably this + means that file wildcard expansion does not happen. + To expand wildcards for the arguments, use + filelib:wildcard/1. + Notice that even if the program is a Unix shell script, meaning that the - shell will ultimately be invoked, wildcard expansion - will not happen and the script will be provided with the - untouched arguments. On Windows®, wildcard expansion - is always up to the program itself, why this isn't an - issue.

- -

Note also that the actual executable name (a.k.a. argv[0]) - should not be given in this list. The proper executable name will - automatically be used as argv[0] where applicable.

- -

If one, for any reason, wants to explicitly set the - program name in the argument vector, the arg0 - option can be used.

- + shell ultimately is invoked, wildcard expansion + does not happen, and the script is provided with the + untouched arguments. On Windows, wildcard expansion + is always up to the program itself, therefore this is + not an issue issue.

+

The executable name (also known as argv[0]) + is not to be given in this list. The proper executable name + is automatically used as argv[0], where applicable.

+

If you explicitly want to set the + program name in the argument vector, option arg0 + can be used.

{arg0, string() | binary()} - -

This option is only valid for {spawn_executable, FileName} +

Only valid for {spawn_executable, FileName} and explicitly specifies the program name argument when - running an executable. This might in some circumstances, - on some operating systems, be desirable. How the program - responds to this is highly system dependent and no specific + running an executable. This can in some circumstances, + on some OSs, be desirable. How the program + responds to this is highly system-dependent and no specific effect is guaranteed.

-
- exit_status -

This is only valid for {spawn, Command} where - Command refers to an external program, and for - {spawn_executable, FileName}.

+

Only valid for {spawn, Command}, where + Command refers to an external program, and + for {spawn_executable, FileName}.

When the external process connected to the port exits, a message of the form {Port,{exit_status,Status}} is sent to the connected process, where Status is the exit status of the external process. If the program - aborts, on Unix the same convention is used as the shells - do (i.e., 128+signal).

-

If the eof option has been given as well, - the eof message and the exit_status message - appear in an unspecified order.

-

If the port program closes its stdout without exiting, - the exit_status option will not work.

+ aborts on Unix, the same convention is used as the shells + do (that is, 128+signal).

+

If option eof is also given, the messages eof + and exit_status appear in an unspecified order.

+

If the port program closes its stdout without exiting, + option exit_status does not work.

use_stdio -

This is only valid for {spawn, Command} and +

Only valid for {spawn, Command} and {spawn_executable, FileName}. It allows the standard input and output (file descriptors 0 - and 1) of the spawned (UNIX) process for communication + and 1) of the spawned (Unix) process for communication with Erlang.

nouse_stdio -

The opposite of use_stdio. Uses file descriptors +

The opposite of use_stdio. It uses file descriptors 3 and 4 for communication with Erlang.

stderr_to_stdout @@ -3304,14 +3474,15 @@ os_prompt%
overlapped_io -

Affects ports to external programs on Windows® only. - The standard input and standard output handles of the port program - will, if this option is supplied, be opened with the flag - FILE_FLAG_OVERLAPPED, so that the port program can (and has to) do +

Affects ports to external programs on Windows only. The + standard input and standard output handles of the port program + are, if this option is supplied, opened with flag + FILE_FLAG_OVERLAPPED, so that the port program can + (and must) do overlapped I/O on its standard handles. This is not normally the case for simple port programs, but an option of value for the - experienced Windows programmer. On all other platforms, this - option is silently discarded.

+ experienced Windows programmer. On all other platforms, this + option is silently discarded.

in @@ -3323,213 +3494,213 @@ os_prompt% binary -

All IO from the port are binary data objects as opposed +

All I/O from the port is binary data objects as opposed to lists of bytes.

eof -

The port will not be closed at the end of the file and - produce an exit signal. Instead, it will remain open and - a {Port, eof} message will be sent to the process +

The port is not closed at the end of the file and does not + produce an exit signal. Instead, it remains open and + a {Port, eof} message is sent to the process holding the port.

hide -

When running on Windows, suppress creation of a new +

When running on Windows, suppresses creation of a new console window when spawning the port program. (This option has no effect on other platforms.)

- {parallelism, Boolean} + {parallelism, Boolean} -

Set scheduler hint for port parallelism. If set to true, - the VM will schedule port tasks when doing so will improve - parallelism in the system. If set to false, the VM will - try to perform port tasks immediately, improving latency at the - expense of parallelism. The default can be set on system startup - by passing the - +spp command line argument - to erl(1). -

+ +

Sets scheduler hint for port parallelism. If set to + true, the Virtual Machine schedules port tasks; + when doing so, it improves parallelism in the system. If set + to false, the Virtual Machine tries to + perform port tasks immediately, improving latency at the + expense of parallelism. The default can be set at system startup + by passing command-line argument + +spp to erl(1).

-

The default is stream for all types of port and +

Default is stream for all port types and use_stdio for spawned ports.

Failure: If the port cannot be opened, the exit reason is - badarg, system_limit, or the Posix error code which - most closely describes the error, or einval if no Posix code - is appropriate:

+ badarg, system_limit, or the POSIX error code that + most closely describes the error, or einval if no POSIX + code is appropriate:

badarg - -

Bad input arguments to open_port.

+ Bad input arguments to open_port. system_limit - -

All available ports in the Erlang emulator are in use.

+ All available ports in the Erlang emulator are in use. enomem - -

There was not enough memory to create the port.

+ Not enough memory to create the port. eagain - -

There are no more available operating system processes.

+ No more available OS processes. enametoolong - -

The external command given was too long.

+ Too long external command. emfile - -

There are no more available file descriptors (for the operating system process - that the Erlang emulator runs in).

+ No more available file descriptors (for the + OS process that the Erlang emulator runs in). enfile - -

The file table is full (for the entire operating system).

+ Full file table (for the entire OS). eacces - -

The Command given in {spawn_executable, Command} does not point out an executable file.

+ Command given in {spawn_executable, Command} + does not point out an executable file. enoent - -

The FileName given in {spawn_executable, FileName} does not point out an existing file.

+ FileName given in + {spawn_executable, FileName} + does not point out an existing file.

During use of a port opened using {spawn, Name}, - {spawn_driver, Name} or {spawn_executable, Name}, + {spawn_driver, Name}, or {spawn_executable, Name}, errors arising when sending messages to it are reported to the owning process using signals of the form - {'EXIT', Port, PosixCode}. See file(3) for - possible values of PosixCode.

+ {'EXIT', Port, PosixCode}. For the possible values of + PosixCode, see the + file(3) + manual page in Kernel.

The maximum number of ports that can be open at the same - time can be configured by passing the - +Q - command line flag to - erl(1).

+ time can be configured by passing command-line flag + +Q to + erl(1).

+ Range = 1..2^32, Hash = 1..Range - Portable hash function + Portable hash function. -

Portable hash function that will give the same hash for +

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and - ERTS version (the BIF was introduced in ERTS 4.9.1.1). Range - can be between 1 and 2^32, the function returns a hash value - for Term within the range 1..Range.

-

This BIF could be used instead of the old deprecated - erlang:hash/2 BIF, as it calculates better hashes for - all data-types, but consider using phash2/1,2 instead.

+ ERTS version (the BIF was introduced in ERTS 4.9.1.1). + Range is 1..2^32. The function returns a hash value for + Term within the range + 1..Range.

+

This BIF can be used instead of the old deprecated BIF + erlang:hash/2, as it calculates better hashes for + all data types, but consider using phash2/1,2 instead.

+ 1..2^32 0..Range-1 - Portable hash function + Portable hash function. -

Portable hash function that will give the same hash for +

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and - ERTS version (the BIF was introduced in ERTS 5.2). Range can - be between 1 and 2^32, the function returns a hash value for - Term within the range 0..Range-1. When called - without the Range argument, a value in the range - 0..2^27-1 is returned.

-

This BIF should always be used for hashing terms. It + ERTS version (the BIF was introduced in ERTS 5.2). + Range is 1..2^32. The function returns a hash value for + Term within the range + 0..Range-1. When without argument + Range, a value in the range + 0..2^27-1 is returned.

+

This BIF is always to be used for hashing terms. It distributes small integers better than phash/2, and it is faster for bignums and binaries.

-

Note that the range 0..Range-1 is different from - the range of phash/2 (1..Range).

+

Notice that the range 0..Range-1 is + different from the range of phash/2, which is + 1..Range.

+ - Text representation of a pid + Text representation of a pid. -

Returns a string which corresponds to the text +

Returns a string corresponding to the text representation of Pid.

-

This BIF is intended for debugging and for use in - the Erlang operating system. It should not be used in - application programs.

+

This BIF is intended for debugging and for use in the + Erlang OS. It is not to be used in application programs.

+ - Close an open port + Closes an open port.

Closes an open port. Roughly the same as - Port ! {self(), close} except for the error behaviour - (see below), being synchronous, and that the port does - not reply with {Port, closed}. Any process may + Port ! {self(), close} except for the error behavior + (see the following), being synchronous, and that the port does + not reply with {Port, closed}. Any process can close a port with port_close/1, not only the port owner (the connected process). If the calling process is linked to - port identified by Port, an exit signal due - to that link will be received by the process prior to the return - from port_close/1.

+ a port identified by Port, an exit signal is sent + because that link will be received before the return from + port_close/1

For comparison: Port ! {self(), close} fails with - badarg if Port cannot be sent to (i.e., - Port refers neither to a port nor to a process). If - Port is a closed port nothing happens. If Port + badarg if Port cannot be sent to (that is, + Port refers not to a port and not to a process). If + Port is a closed port, nothing happens. + If Port is an open port and the calling process is the port owner, the port replies with {Port, closed} when all buffers - have been flushed and the port really closes, but if - the calling process is not the port owner the port owner fails with badsig.

- -

Note that any process can close a port using - Port ! {PortOwner, close} just as if it itself was + have been flushed and the port really closes. If + the calling process is not the port owner, the + port owner fails with badsig.

+

Notice that any process can close a port using + Port ! {PortOwner, close} as if it itself was the port owner, but the reply always goes to the port owner.

-

As of OTP-R16 Port ! {PortOwner, close} is truly - asynchronous. Note that this operation has always been +

As from OTP R16, Port ! {PortOwner, close} is truly + asynchronous. Notice that this operation has always been documented as an asynchronous operation, while the underlying implementation has been synchronous. port_close/1 is - however still fully synchronous. This due to its error + however still fully synchronous. This because of its error behavior.

-

Failure:

- - badarg - - If Port is not an identifier of an open - port, or the registered name of an open port. If the calling - process was linked to the previously open port identified by - Port, an exit signal due to this link - was received by the process prior to this exception. - - +

Failure: badarg if Port is not an identifier + of an open port, or the registered name of an open port. + If the calling process was linked to the port, the exit + identified by Port, the exit signal is sent because + this link was delivered to the calling process before this + exception occurs.

+ - Send data to a port + Sends data to a port.

Sends data to a port. Same as - Port ! {PortOwner, {command, Data}} except for the error - behaviour and being synchronous (see below). Any process may - send data to a port with port_command/2, not only the + Port ! {PortOwner, {command, Data}} except + for the error + behavior and being synchronous (see the following). Any process + can send data to a port with port_command/2, not only the port owner (the connected process).

For comparison: Port ! {PortOwner, {command, Data}} - fails with badarg if Port cannot be sent to - (i.e., Port refers neither to a port nor to a process). - If Port is a closed port the data message disappears + fails with badarg if Port + cannot be sent to (that + is, Port refers not to a port and not to a process). + If Port is a closed port, the data message disappears without a sound. If Port is open and the calling process is not the port owner, the port owner fails with badsig. The port owner fails with badsig - also if Data is not a valid IO list.

-

Note that any process can send to a port using - Port ! {PortOwner, {command, Data}} just as if it - itself was the port owner.

-

If the port is busy, the calling process will be suspended - until the port is not busy anymore.

-

As of OTP-R16 Port ! {PortOwner, {command, Data}} is - truly asynchronous. Note that this operation has always been + also if Data is an invalid I/O list.

+

Notice that any process can send to a port using + Port ! {PortOwner, {command, Data}} + as if it itself was the port owner.

+

If the port is busy, the calling process is suspended + until the port is not busy any more.

+

As from OTP-R16, Port ! {PortOwner, {command, Data}} + is truly asynchronous. Notice that this operation has always been documented as an asynchronous operation, while the underlying implementation has been synchronous. port_command/2 is - however still fully synchronous. This due to its error + however still fully synchronous. This because of its error behavior.

Failures:

@@ -3537,46 +3708,46 @@ os_prompt% If Port is not an identifier of an open port, or the registered name of an open port. If the calling - process was linked to the previously open port identified by - Port, an exit signal due to this link - was received by the process prior to this exception. + process was linked to the port, the exit signal is sent + because this link was delivered to the calling process + before this exception occurs. badarg - If Data is not a valid io list. + If Data is an invalid I/O list.
+ - Send data to a port + Sends data to a port.

Sends data to a port. port_command(Port, Data, []) equals port_command(Port, Data).

-

If the port command is aborted false is returned; - otherwise, true is returned.

-

If the port is busy, the calling process will be suspended - until the port is not busy anymore.

-

Currently the following Options are valid:

+

If the port command is aborted, false is returned, + otherwise true.

+

If the port is busy, the calling process is suspended + until the port is not busy any more.

+

The following Options are valid:

force - The calling process will not be suspended if the port is - busy; instead, the port command is forced through. The - call will fail with a notsup exception if the + The calling process is not suspended if the port is + busy, instead the port command is forced through. The + call fails with a notsup exception if the driver of the port does not support this. For more - information see the - - driver flag. + information, see driver flag + . nosuspend - The calling process will not be suspended if the port is - busy; instead, the port command is aborted and + The calling process is not suspended if the port is + busy, instead the port command is aborted and false is returned. -

More options may be added in the future.

+

More options can be added in a future release.

Failures:

@@ -3584,84 +3755,89 @@ os_prompt% If Port is not an identifier of an open port, or the registered name of an open port. If the calling - process was linked to the previously open port identified by - Port, an exit signal due to this link - was received by the process prior to this exception. + process was linked to the port, the exit signal is sent + because this link was delivered to the calling process + before this exception occurs. badarg - If Data is not a valid io list. + If Data is an invalid I/O list. badarg - If OptionList is not a valid option list. + If OptionList is an invalid option list. notsup - If the force option has been passed, but the + If option force has been passed, but the driver of the port does not allow forcing through a busy port.
+ - Set the owner of a port + Sets the owner of a port.

Sets the port owner (the connected port) to Pid. - Roughly the same as Port ! {Owner, {connect, Pid}} + Roughly the same as + Port ! {Owner, {connect, Pid}} except for the following:

-

The error behavior differs, see below.

+

The error behavior differs, see the following.

The port does not reply with {Port,connected}.

-

port_connect/1 is synchronous, see below.

+

port_connect/1 is synchronous, see the following.

The new port owner gets linked to the port.

-

The old port owner stays linked to the port and have to call - unlink(Port) if this is not desired. Any process may +

The old port owner stays linked to the port and must call + unlink(Port) if this is not desired. Any process can set the port owner to be any process with port_connect/2.

-

For comparison: Port ! {self(), {connect, Pid}} fails - with badarg if Port cannot be sent to (i.e., - Port refers neither to a port nor to a process). If - Port is a closed port nothing happens. If Port +

For comparison: + Port ! {self(), {connect, Pid}} fails + with badarg if Port cannot be sent to (that is, + Port refers not to a port and not to a process). If + Port is a closed port, nothing happens. + If Port is an open port and the calling process is the port owner, the port replies with {Port, connected} to the old - port owner. Note that the old port owner is still linked to - the port, and that the new is not. If Port is an open + port owner. Notice that the old port owner is still linked to + the port, while the new is not. If Port is an open port and the calling process is not the port owner, the port owner fails with badsig. The port owner fails with badsig also if Pid is not an - existing local pid.

-

Note that any process can set the port owner using - Port ! {PortOwner, {connect, Pid}} just as if it - itself was the port owner, but the reply always goes to + existing local process identifier.

+

Notice that any process can set the port owner using + Port ! {PortOwner, {connect, Pid}} + as if it itself was the port owner, but the reply always goes to the port owner.

-

As of OTP-R16 Port ! {PortOwner, {connect, Pid}} is - truly asynchronous. Note that this operation has always been +

As from OTP-R16, + Port ! {PortOwner, {connect, Pid}} is + truly asynchronous. Notice that this operation has always been documented as an asynchronous operation, while the underlying implementation has been synchronous. port_connect/2 is - however still fully synchronous. This due to its error + however still fully synchronous. This because of its error behavior.

Failures:

badarg - If Port is not an identifier of an open - port, or the registered name of an open port. If the calling - process was linked to the previously open port identified by - Port, an exit signal due to this link - was received by the process prior to this exception. + If Port is not an identifier of an open port, or + the registered name of an open port. If the calling + process was linked to the port, the exit signal is sent + because this link was delivered to the calling process + before this exception occurs. badarg If process identified by Pid is not an existing @@ -3669,53 +3845,74 @@ os_prompt%
+ - Perform a synchronous control operation on a port + Performs a synchronous control operation on a port.

Performs a synchronous control operation on a port. - The meaning of Operation and Data depends on - the port, i.e., on the port driver. Not all port drivers + The meaning of Operation and + Data depends on + the port, that is, on the port driver. Not all port drivers support this control feature.

-

Returns: a list of integers in the range 0 through 255, or a +

Returns a list of integers in the range 0..255, or a binary, depending on the port driver. The meaning of the returned data also depends on the port driver.

-

Failure: badarg if Port is not an open port or - the registered name of an open port, if Operation - cannot fit in a 32-bit integer, if the port driver does not - support synchronous control operations, or if the port driver - so decides for any reason (probably something wrong with - Operation or Data).

+

Failures:

+ + badarg + + If Port is not an open port or the registered + name of an open port. + + badarg + + If Operation cannot fit in a 32-bit integer. + + badarg + + If the port driver does not support synchronous control + operations. + + badarg + + If the port driver so decides for any reason (probably + something wrong with Operation or + Data). + +
+ - Synchronous call to a port with term data + Performs a synchronous call to a port with term data.

Performs a synchronous call to a port. The meaning of - Operation and Data depends on the port, i.e., + Operation and Data + depends on the port, that is, on the port driver. Not all port drivers support this feature.

-

Port is a port identifier, referring to a driver.

+

Port is a port identifier, + referring to a driver.

Operation is an integer, which is passed on to the driver.

-

Data is any Erlang term. This data is converted to - binary term format and sent to the port.

-

Returns: a term from the driver. The meaning of the returned +

Data is any Erlang term. This data is converted + to binary term format and sent to the port.

+

Returns a term from the driver. The meaning of the returned data also depends on the port driver.

Failures:

badarg - If Port is not an identifier of an open - port, or the registered name of an open port. If the calling - process was linked to the previously open port identified by - Port, an exit signal due to this link - was received by the process prior to this exception. + If Port is not an identifier of an open port, + or the registered name of an open port. If the calling + process was linked to the port, the exit signal is sent + because this link was delivered to the calling process + before this exception occurs. badarg - If Operation does not fit in a - 32-bit integer. + If Operation does not fit in a 32-bit integer. badarg @@ -3725,171 +3922,192 @@ os_prompt% badarg If the port driver so decides for any reason (probably - something wrong with Operation, or - Data). + something wrong with Operation + or Data).
+ - Information about a port + Information about a port.

Returns a list containing tuples with information about - the Port, or undefined if the port is not open. - The order of the tuples is not defined, nor are all the - tuples mandatory. + Port, or undefined if the port is not open. + The order of the tuples is undefined, and all the + tuples are not mandatory. If undefined is returned and the calling process was linked to a previously open port identified by - Port, an exit signal due to this link - was received by the process prior to the return from + Port, an exit signal is sent because this link + was received by the process before the return from port_info/1.

-

Currently the result will containt information about the - following Items: registered_name (if the port has - a registered name), id, connected, links, - name, input, and output. For more information - about the different Items, see +

The result contains information about the following + Items:

+ + registered_name (if the port has a registered + name) + id + connected + links + name + input + output + +

For more information about the different Items, see port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the connected process of a port + Information about the connected process of a port.

Pid is the process identifier of the process connected to the port.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the internal index of a port + Information about the internal index of a port.

Index is the internal index of the port. This - index may be used to separate ports.

+ index can be used to separate ports.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the input of a port + Information about the input of a port.

Bytes is the total number of bytes read from the port.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the links of a port + Information about the links of a port.

Pids is a list of the process identifiers of the processes that the port is linked to.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the locking of a port + Information about the locking of a port. -

Locking is currently either false - (emulator without SMP support), port_level (port specific - locking), or driver_level (driver specific locking). Note - that these results are highly implementation specific and might - change in the future.

+

Locking is one of the following:

+ + false (emulator without SMP support) + port_level (port-specific locking) + driver_level (driver-specific locking) + +

Notice that these results are highly implementation-specific + and can change in a future release.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the memory size of a port + Information about the memory size of a port. -

Bytes is the total amount of memory, - in bytes, allocated for this port by the runtime system. Note - that the port itself might have allocated memory which is not +

Bytes is the total number of + bytes allocated for this port by the runtime system. The + port itself can have allocated memory that is not included in Bytes.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the monitors of a port + Information about the monitors of a port.

Monitors represent processes that this port - is monitoring.

+ monitors.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the name of a port + Information about the name of a port.

Name is the command name set by open_port/2.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the OS pid of a port + Information about the OS pid of a port.

OsPid is the process identifier (or equivalent) of an OS process created with @@ -3899,430 +4117,466 @@ os_prompt%

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the output of a port + Information about the output of a port.

Bytes is the total number of bytes written - to the port from Erlang processes using either + to the port from Erlang processes using port_command/2, port_command/3, - or Port ! {Owner, {command, Data}. -

+ or Port ! {Owner, {command, Data}.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent before this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the parallelism hint of a port + Information about the parallelism hint of a port.

Boolean corresponds to the port parallelism - hint being used by this port. For more information see - the parallelism - option of open_port/2.

+ hint being used by this port. For more information, see option + parallelism + of open_port/2.

+ - Information about the queue size of a port + Information about the queue size of a port. -

Bytes is the total amount of data, - in bytes, queued by the port using the ERTS driver queue +

Bytes is the total number + of bytes queued by the port using the ERTS driver queue implementation.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Information about the registered name of a port + Information about the registered name of a port.

RegisteredName is the registered name of the port. If the port has no registered name, [] is returned.

If the port identified by Port is not open, undefined is returned. If undefined is returned and the calling process was linked to a previously open port identified - by Port, an exit signal due to this link - was received by the process prior to the return from + by Port, an exit signal is sent because this link + was received by the process before the return from port_info/2.

Failure: badarg if Port is not a local port identifier, or an atom.

+ - Text representation of a port identifier + Text representation of a port identifier. -

Returns a string which corresponds to the text +

Returns a string corresponding to the text representation of the port identifier Port.

-

This BIF is intended for debugging and for use in - the Erlang operating system. It should not be used in - application programs.

+

This BIF is intended for debugging and for use in the + Erlang OS. It is not to be used in application programs.

+ - All open ports + Lists all open ports.

Returns a list of port identifiers corresponding to all the - ports currently existing on the local node.

- -

Note that a port that is exiting, exists but is not open.

+ ports existing on the local node.

+

Notice that an exiting port exists, but is not open.

+ - List of all pre-loaded modules + Lists all pre-loaded modules. -

Returns a list of Erlang modules which are pre-loaded in +

Returns a list of Erlang modules that are preloaded in the system. As all loading of code is done through the file system, the file system must have been loaded previously. - Hence, at least the module init must be pre-loaded.

+ Hence, at least the module init must be preloaded.

+ - Write information about a local process on standard error + Writes information about a local process on standard error.

Writes information about the local process Pid on - standard error. The currently allowed value for the atom + standard error. The only allowed value for the atom Type is backtrace, which shows the contents of the call stack, including information about the call chain, with the current function printed first. The format of the output is not further defined.

+ - Set process flag trap_exit for the calling process + Sets process flag trap_exit for the calling process.

When trap_exit is set to true, exit signals - arriving to a process are converted to {'EXIT', From, Reason} messages, which can be received as ordinary + arriving to a process are converted to {'EXIT', From, Reason} + messages, which can be received as ordinary messages. If trap_exit is set to false, the process exits if it receives an exit signal other than normal and the exit signal is propagated to its - linked processes. Application processes should normally - not trap exits.

+ linked processes. Application processes are normally + not to trap exits.

Returns the old value of the flag.

See also exit/2.

+ - Set process flag error_handler for the calling process + Sets process flag error_handler for the calling process. -

This is used by a process to redefine the error handler +

Used by a process to redefine the error handler for undefined function calls and undefined registered - processes. Inexperienced users should not use this flag - since code auto-loading is dependent on the correct + processes. Inexperienced users are not to use this flag, + as code auto-loading depends on the correct operation of the error handling module.

Returns the old value of the flag.

+ - Set process flag min_heap_size for the calling process + Sets process flag min_heap_size for the calling process. -

This changes the minimum heap size for the calling - process.

+

Changes the minimum heap size for the calling process.

Returns the old value of the flag.

+ - Set process flag min_bin_vheap_size for the calling process + Sets process flag min_bin_vheap_size for the calling process. -

This changes the minimum binary virtual heap size for the calling +

Changes the minimum binary virtual heap size for the calling process.

-

Returns the old value of the flag.

+

Returns the old value of the flag.

+
+ + Sets process flag priority for the calling process. - Set process flag priority for the calling process

- This sets the process priority. Level is an atom. - There are currently four priority levels: low, - normal, high, and max. The default - priority level is normal. NOTE: The - max priority level is reserved for internal use in - the Erlang runtime system, and should not be used - by others. -

-

Internally in each priority level processes are scheduled - in a round robin fashion. -

+ Sets the process priority. Level is an atom. + There are four priority levels: low, + normal, high, and max. Default + is normal.

+ +

Priority level max is reserved for internal use in + the Erlang runtime system, and is not to be used + by others.

+
+

Internally in each priority level, processes are scheduled + in a round robin fashion.

Execution of processes on priority normal and - priority low will be interleaved. Processes on - priority low will be selected for execution less - frequently than processes on priority normal. -

-

When there are runnable processes on priority high - no processes on priority low, or normal will - be selected for execution. Note, however, that this does - not mean that no processes on priority low, - or normal will be able to run when there are - processes on priority high running. On the runtime - system with SMP support there might be more processes running - in parallel than processes on priority high, i.e., - a low, and a high priority process might - execute at the same time. -

-

When there are runnable processes on priority max + low are interleaved. Processes on priority + low are selected for execution less + frequently than processes on priority normal.

+

When there are runnable processes on priority high, + no processes on priority low or normal are + selected for execution. Notice however, that this does + not mean that no processes on priority low + or normal can run when there are processes + running on priority high. On the runtime + system with SMP support, more processes can be running + in parallel than processes on priority high, that is, + a low and a high priority process can + execute at the same time.

+

When there are runnable processes on priority max, no processes on priority low, normal, or - high will be selected for execution. As with the - high priority, processes on lower priorities might - execute in parallel with processes on priority max. -

-

Scheduling is preemptive. Regardless of priority, a process - is preempted when it has consumed more than a certain amount + high are selected for execution. As with priority + high, processes on lower priorities can + execute in parallel with processes on priority max.

+

Scheduling is pre-emptive. Regardless of priority, a process + is pre-empted when it has consumed more than a certain number of reductions since the last time it was selected for - execution. -

-

NOTE: You should not depend on the scheduling + execution.

+ +

Do not depend on the scheduling to remain exactly as it is today. Scheduling, at least on - the runtime system with SMP support, is very likely to be - modified in the future in order to better utilize available - processor cores. -

-

There is currently no automatic mechanism for - avoiding priority inversion, such as priority inheritance, - or priority ceilings. When using priorities you have - to take this into account and handle such scenarios by - yourself. -

+ the runtime system with SMP support, is likely to be + changed in a future release to use available + processor cores better.

+
+

There is no automatic mechanism for + avoiding priority inversion, such as priority inheritance + or priority ceilings. When using priorities, + take this into account and handle such scenarios by + yourself.

Making calls from a high priority process into code - that you don't have control over may cause the high - priority process to wait for a processes with lower - priority, i.e., effectively decreasing the priority of the + that you have no control over can cause the high + priority process to wait for a process with lower + priority. That is, effectively decreasing the priority of the high priority process during the call. Even if this - isn't the case with one version of the code that you don't - have under your control, it might be the case in a future - version of it. This might, for example, happen if a - high priority process triggers code loading, since - the code server runs on priority normal. -

+ is not the case with one version of the code that you have no + control over, it can be the case in a future + version of it. This can, for example, occur if a + high priority process triggers code loading, as + the code server runs on priority normal.

Other priorities than normal are normally not needed. - When other priorities are used, they need to be used - with care, especially the high priority must - be used with care. A process on high priority should - only perform work for short periods of time. Busy looping for - long periods of time in a high priority process will - most likely cause problems, since there are important servers - in OTP running on priority normal. -

+ When other priorities are used, use them with care, + especially priority high. A + process on priority high is only + to perform work for short periods. Busy looping for + long periods in a high priority process does + most likely cause problems, as important OTP servers + run on priority normal.

Returns the old value of the flag.

+ - Set process flag save_calls for the calling process + Sets process flag save_calls for the calling process.

N must be an integer in the interval 0..10000. - If N > 0, call saving is made active for the - process, which means that information about the N - most recent global function calls, BIF calls, sends and + If N is greater than 0, call saving is made + active for the + process. This means that information about the N + most recent global function calls, BIF calls, sends, and receives made by the process are saved in a list, which can be retrieved with process_info(Pid, last_calls). A global function call is one in which the module of the function is explicitly mentioned. Only a fixed amount of information - is saved: a tuple {Module, Function, Arity} for - function calls, and the mere atoms send, - 'receive' and timeout for sends and receives - ('receive' when a message is received and - timeout when a receive times out). If N = 0, + is saved, as follows:

+ + A tuple {Module, Function, Arity} for + function calls + The atoms send, 'receive', and + timeout for sends and receives ('receive' + when a message is received and timeout when a + receive times out) + +

If N = 0, call saving is disabled for the process, which is the default. Whenever the size of the call saving list is set, its contents are reset.

Returns the old value of the flag.

+ - Set process flag sensitive for the calling process + Sets process flag sensitive for the calling process. -

Set or clear the sensitive flag for the current process. +

Sets or clears flag sensitive for the current process. When a process has been marked as sensitive by calling - process_flag(sensitive, true), features in the run-time - system that can be used for examining the data and/or inner working + process_flag(sensitive, true), features in the runtime + system that can be used for examining the data or inner working of the process are silently disabled.

Features that are disabled include (but are not limited to) the following:

-

Tracing: Trace flags can still be set for the process, but no - trace messages of any kind will be generated. - (If the sensitive flag is turned off, trace messages will - again be generated if there are any trace flags set.)

-

Sequential tracing: The sequential trace token will be propagated - as usual, but no sequential trace messages will be generated.

-

process_info/1,2 cannot be used to read out the message - queue or the process dictionary (both will be returned as empty lists).

+ + Tracing: Trace flags can still be set for the process, + but no trace messages of any kind are generated. (If flag + sensitive is turned off, trace messages are again + generated if any trace flags are set.) + Sequential tracing: The sequential trace token is + propagated as usual, but no sequential trace messages are + generated. + +

process_info/1,2 cannot be used to read out the + message queue or the process dictionary (both are returned + as empty lists).

Stack back-traces cannot be displayed for the process.

In crash dumps, the stack, messages, and the process dictionary - will be omitted.

+ are omitted.

If {save_calls,N} has been set for the process, no - function calls will be saved to the call saving list. - (The call saving list will not be cleared; furthermore, send, receive, - and timeout events will still be added to the list.)

+ function calls are saved to the call saving list. + (The call saving list is not cleared. Furthermore, send, receive, + and timeout events are still added to the list.)

Returns the old value of the flag.

+ - Set process flags for a process + Sets process flags for a process. -

Sets certain flags for the process Pid, in the same - manner as +

Sets certain flags for the process Pid, + in the same manner as process_flag/2. - Returns the old value of the flag. The allowed values for + Returns the old value of the flag. The valid values for Flag are only a subset of those allowed in - process_flag/2, namely: save_calls.

-

Failure: badarg if Pid is not a local process.

+ process_flag/2, namely save_calls.

+

Failure: badarg if Pid + is not a local process.

+ + Information about a process. - Information about a process

Returns a list containing InfoTuples with miscellaneous information about the process identified by - Pid, or undefined if the process is not alive. -

-

- The order of the InfoTuples is not defined, nor - are all the InfoTuples mandatory. The InfoTuples - part of the result may be changed without prior notice. - Currently InfoTuples with the following items - are part of the result: - current_function, initial_call, status, - message_queue_len, messages, links, - dictionary, trap_exit, error_handler, - priority, group_leader, total_heap_size, - heap_size, stack_size, reductions, and - garbage_collection. - If the process identified by Pid has a registered name - also an InfoTuple with the item registered_name - will appear. -

-

See process_info/2 - for information about specific InfoTuples.

+ Pid, or undefined if the process is not alive.

+

The order of the InfoTuples is undefined and + all InfoTuples are not mandatory. + The InfoTuples + part of the result can be changed without prior notice.

+

The InfoTuples with the following items + are part of the result:

+ + current_function + initial_call + status + message_queue_len + messages + links + dictionary + trap_exit + error_handler + priority + group_leader + total_heap_size + heap_size + stack_size + reductions + garbage_collection + +

If the process identified by Pid has a + registered name, + also an InfoTuple with item registered_name + appears.

+

For information about specific InfoTuples, see + process_info/2.

-

This BIF is intended for debugging only, use - process_info/2 - for all other purposes. -

+

This BIF is intended for debugging only. For + all other purposes, use + process_info/2.

-

Failure: badarg if Pid is not a local process.

+

Failure: badarg if Pid is not a + local process.

+ + Information about a process. - Information about a process -

Returns information about the process identified by Pid - as specified by the Item or the ItemList, or undefined if the - process is not alive. -

-

If the process is alive and a single Item is given, - the returned value is the corresponding - InfoTuple unless Item =:= registered_name - and the process has no registered name. In this case - [] is returned. This strange behavior is due to - historical reasons, and is kept for backward compatibility. -

-

If an ItemList is given, the result is an - InfoTupleList. The InfoTuples in the - InfoTupleList will appear with the corresponding - Items in the same order as the Items appeared - in the ItemList. Valid Items may appear multiple - times in the ItemList. -

-

If registered_name is part of an ItemList +

Returns information about the process identified by + Pid, as specified by + Item or ItemList, + or undefined if the process is not alive.

+

If the process is alive and a single Item + is given, the returned value is the corresponding + InfoTuple, unless Item =:= registered_name + and the process has no registered name. In this case, + [] is returned. This strange behavior is because of + historical reasons, and is kept for backward compatibility.

+

If ItemList is given, the result is + InfoTupleList. + The InfoTuples in + InfoTupleList appear with the corresponding + Items in the same order as the + Items appeared + in ItemList. Valid Items can + appear multiple times in ItemList.

+

If registered_name is part of ItemList and the process has no name registered a - {registered_name, []} InfoTuple will - appear in the resulting InfoTupleList. This - behavior is different than when a single - Item =:= registered_name is given, and than when - process_info/1 is used. -

-

Currently the following InfoTuples with corresponding + {registered_name, []}, InfoTuple + will appear in the resulting + InfoTupleList. This + behavior is different when a single + Item =:= registered_name is given, and when + process_info/1 is used.

+
+

The following InfoTuples with corresponding Items are valid:

{backtrace, Bin} -

The binary Bin contains the same information as - the output from +

Binary Bin contains the same information + as the output from erlang:process_display(Pid, backtrace). Use binary_to_list/1 to obtain the string of characters from the binary.

{binary, BinInfo} -

BinInfo is a list containing miscellaneous information - about binaries currently being referred to by this process. - This InfoTuple may be changed or removed without prior - notice.

+

BinInfo is a list containing miscellaneous + information about binaries currently being referred to by this + process. This InfoTuple can be changed or + removed without prior notice.

{catchlevel, CatchLevel}

CatchLevel is the number of currently active - catches in this process. This InfoTuple may be + catches in this process. This InfoTuple can be changed or removed without prior notice.

- {current_function, {Module, Function, Arity}} + {current_function, {Module, + Function, Arity}} -

Module, Function, Arity is +

Module, Function, + Arity is the current function call of the process.

- {current_location, {Module, Function, Arity, Location}} + {current_location, {Module, + Function, Arity, + Location}} -

Module, Function, Arity is +

Module, Function, + Arity is the current function call of the process. - Location is a list of two-tuples that describes the - location in the source code. -

+ Location is a list of two-tuples describing the + location in the source code.

{current_stacktrace, Stack} -

Return the current call stack back-trace (stacktrace) +

Returns the current call stack back-trace (stacktrace) of the process. The stack has the same format as returned by - erlang:get_stacktrace/0. -

+ erlang:get_stacktrace/0.

{dictionary, Dictionary} -

Dictionary is the dictionary of the process.

+

Dictionary is the process dictionary.

{error_handler, Module} @@ -4331,34 +4585,36 @@ os_prompt% {garbage_collection, GCInfo} -

GCInfo is a list which contains miscellaneous +

GCInfo is a list containing miscellaneous information about garbage collection for this process. - The content of GCInfo may be changed without + The content of GCInfo can be changed without prior notice.

{group_leader, GroupLeader} -

GroupLeader is group leader for the IO of +

GroupLeader is group leader for the I/O of the process.

{heap_size, Size} -

Size is the size in words of youngest heap generation - of the process. This generation currently include the stack - of the process. This information is highly implementation - dependent, and may change if the implementation change. -

+

Size is the size in words of the youngest heap + generation of the process. This generation includes + the process stack. This information is highly + implementation-dependent, and can change if the + implementation changes.

- {initial_call, {Module, Function, Arity}} + {initial_call, {Module, Function, + Arity}} -

Module, Function, Arity is +

Module, Function, + Arity is the initial function call with which the process was spawned.

{links, PidsAndPorts} -

PidsAndPorts is a list of pids and - port identifiers, with processes or ports to which the process +

PidsAndPorts is a list of process identifiers + and port identifiers, with processes or ports to which the process has a link.

{last_calls, false|Calls} @@ -4372,14 +4628,14 @@ os_prompt% {memory, Size}

Size is the size in bytes of the process. This - includes call stack, heap and internal structures.

+ includes call stack, heap, and internal structures.

{message_queue_len, MessageQueueLen}

MessageQueueLen is the number of messages currently in the message queue of the process. This is the length of the list MessageQueue returned as - the info item messages (see below).

+ the information item messages (see the following).

{messages, MessageQueue} @@ -4388,31 +4644,35 @@ os_prompt% {min_heap_size, MinHeapSize} -

MinHeapSize is the minimum heap size for the process.

+

MinHeapSize is the minimum heap size + for the process.

{min_bin_vheap_size, MinBinVHeapSize} -

MinBinVHeapSize is the minimum binary virtual heap size for the process.

+

MinBinVHeapSize is the minimum binary virtual + heap size for the process.

{monitored_by, Pids} -

A list of pids that are monitoring the process (with +

A list of process identifiers monitoring the process (with monitor/2).

{monitors, Monitors}

A list of monitors (started by monitor/2) that are active for the process. For a local process - monitor or a remote process monitor by pid, the list item - is {process, Pid}, and for a remote process + monitor or a remote process monitor by a process + identifier, the list item is {process, Pid}. + For a remote process monitor by name, the list item is {process, {RegName, Node}}.

- {priority, Level} + {priority, Level}

Level is the current priority level for - the process. For more information on priorities see - process_flag(priority, Level).

+ the process. For more information on priorities, see + process_flag(priority, + Level).

{reductions, Number} @@ -4427,166 +4687,203 @@ os_prompt% {sequential_trace_token, [] | SequentialTraceToken} -

SequentialTraceToken the sequential trace token for - the process. This InfoTuple may be changed or removed - without prior notice.

+

SequentialTraceToken is the sequential trace + token for the process. This InfoTuple can be + changed or removed without prior notice.

{stack_size, Size} -

Size is the stack size of the process in words.

+

Size is the stack size, in words, + of the process.

{status, Status} -

Status is the status of the process. Status - is exiting, garbage_collecting, - waiting (for a message), running, - runnable (ready to run, but another process is - running), or suspended (suspended on a "busy" port - or by the erlang:suspend_process/[1,2] BIF).

+

Status is the status of the process and is one + of the following:

+ + exiting + garbage_collecting + waiting (for a message) + running + runnable (ready to run, but another process is + running) + suspended (suspended on a "busy" port + or by the BIF erlang:suspend_process/[1,2]) +
{suspending, SuspendeeList} -

SuspendeeList is a list of {Suspendee, - ActiveSuspendCount, OutstandingSuspendCount} tuples. - Suspendee is the pid of a process that have been or is to - be suspended by the process identified by Pid via the - erlang:suspend_process/2 - BIF, or the - erlang:suspend_process/1 - BIF. ActiveSuspendCount is the number of times the - Suspendee has been suspended by Pid. +

SuspendeeList is a list of + {Suspendee, ActiveSuspendCount, + OutstandingSuspendCount} tuples. + Suspendee is the process identifier of a + process that has been, or is to be, + suspended by the process identified by Pid + through one of the following BIFs:

+ + + erlang:suspend_process/2 + + + erlang:suspend_process/1 + + +

ActiveSuspendCount is the number of + times Suspendee has been suspended by + Pid. OutstandingSuspendCount is the number of not yet - completed suspend requests sent by Pid. That is, - if ActiveSuspendCount =/= 0, Suspendee is - currently in the suspended state, and if - OutstandingSuspendCount =/= 0 the asynchronous - option of erlang:suspend_process/2 has been used and - the suspendee has not yet been suspended by Pid. - Note that the ActiveSuspendCount and - OutstandingSuspendCount are not the total suspend count - on Suspendee, only the parts contributed by Pid. -

+ completed suspend requests sent by Pid, that is:

+ + If ActiveSuspendCount =/= 0, + Suspendee is + currently in the suspended state. + + If OutstandingSuspendCount =/= 0, option + asynchronous of erlang:suspend_process/2 + has been used and the suspendee has not yet been + suspended by Pid. + + +

Notice that ActiveSuspendCount and + OutstandingSuspendCount are not the + total suspend count on Suspendee, + only the parts contributed by Pid.

{total_heap_size, Size} -

Size is the total size in words of all heap - fragments of the process. This currently include the stack - of the process. -

+

Size is the total size, in words, of all heap + fragments of the process. This includes the process stack.

{trace, InternalTraceFlags} -

InternalTraceFlags is an integer representing - internal trace flag for this process. This InfoTuple - may be changed or removed without prior notice.

+

InternalTraceFlags is an integer + representing the internal trace flag for this process. + This InfoTuple + can be changed or removed without prior notice.

{trap_exit, Boolean} -

Boolean is true if the process is trapping - exits, otherwise it is false.

+

Boolean is true if the process + is trapping exits, otherwise false.

-

Note however, that not all implementations support every one - of the above Items.

-

Failure: badarg if Pid is not a local process, - or if Item is not a valid Item.

+

Notice that not all implementations support all + these Items.

+

Failures:

+ + badarg + If Pid is not a local process. + badarg + If Item is an invalid + Item. +
+ - All processes + All processes.

Returns a list of process identifiers corresponding to - all the processes currently existing on the local node. -

-

Note that a process that is exiting, exists but is not alive, i.e., - is_process_alive/1 will return false for a process - that is exiting, but its process identifier will be part - of the result returned from processes/0. -

+ all the processes currently existing on the local node.

+

Notice that an exiting process exists, but is not alive. + That is, is_process_alive/1 returns false + for an exiting process, but its process identifier is part + of the result returned from processes/0.

+

Example:

 > processes().
 [<0.0.0>,<0.2.0>,<0.4.0>,<0.5.0>,<0.7.0>,<0.8.0>]
+ - Remove old code for a module + Removes old code for a module. -

Removes old code for Module. Before this BIF is used, - erlang:check_process_code/2 should be called to check - that no processes are executing old code in the module.

+

Removes old code for Module. + Before this BIF is used, + erlang:check_process_code/2 is to be called to check + that no processes execute old code in the module.

This BIF is intended for the code server (see - code(3)) and should not be - used elsewhere.

+ code(3)) + and is not to be used elsewhere.

Failure: badarg if there is no old code for Module.

+ - Add a new value to the process dictionary - -

Adds a new Key to the process dictionary, associated - with the value Val, and returns undefined. If - Key already exists, the old value is deleted and - replaced by Val and the function returns the old value.

- -

The values stored when put is evaluated within - the scope of a catch will not be retracted if a - throw is evaluated, or if an error occurs.

-
+ Adds a new value to the process dictionary. + +

Adds a new Key to the process dictionary, + associated with the value Val, and returns + undefined. If Key exists, the old + value is deleted and replaced by Val, and + the function returns the old value.

+

Example:

 > X = put(name, walrus), Y = put(name, carpenter),
 Z = get(name),
 {X, Y, Z}.
 {undefined,walrus,carpenter}
+ +

The values stored when put is evaluated within + the scope of a catch are not retracted if a + throw is evaluated, or if an error occurs.

+
+ + Stops execution with an exception of given class, reason, and call stack backtrace. - Stop execution with an exception of given class, reason and call stack backtrace

Stops the execution of the calling process with an - exception of given class, reason and call stack backtrace + exception of given class, reason, and call stack backtrace (stacktrace).

This BIF is intended for debugging and for use in - the Erlang operating system. In general, it should - be avoided in applications, unless you know - very well what you are doing.

+ the Erlang OS. Avoid to use it in applications, + unless you really know what you are doing.

-

Class is one of error, exit or - throw, so if it were not for the stacktrace - erlang:raise(Class, Reason, Stacktrace) is - equivalent to erlang:Class(Reason). - Reason is any term and Stacktrace is a list as - returned from get_stacktrace(), that is a list of - 4-tuples {Module, Function, Arity | Args, - Location} where Module and Function - are atoms and the third element is an integer arity or an - argument list. The stacktrace may also contain {Fun, - Args, Location} tuples where - Fun is a local fun and Args is an argument list.

-

The Location element at the end is optional. +

Class is error, exit, or + throw. So, if it were not for the stacktrace, + erlang:raise(Class, Reason, + Stacktrace) is + equivalent to erlang:Class(Reason).

+

Reason is any term. + Stacktrace is a list as + returned from get_stacktrace(), that is, a list of + four-tuples {Module, Function, Arity | Args, + Location}, where Module and Function + are atoms, and the third element is an integer arity or an + argument list. The stacktrace can also contain {Fun, + Args, Location} tuples, where Fun is a local + fun and Args is an argument list.

+

Element Location at the end is optional. Omitting it is equivalent to specifying an empty list.

The stacktrace is used as the exception stacktrace for the - calling process; it will be truncated to the current + calling process; it is truncated to the current maximum stacktrace depth.

-

Because evaluating this function causes the process to - terminate, it has no return value - unless the arguments are - invalid, in which case the function returns the error reason, that is badarg. If you want to be - really sure not to return you can call - error(erlang:raise(Class, Reason, Stacktrace)) +

Since evaluating this function causes the process to + terminate, it has no return value unless the arguments are + invalid, in which case the function returns the error + reason badarg. If you want to be + sure not to return, you can call + error(erlang:raise(Class, Reason, + Stacktrace)) and hope to distinguish exceptions later.

+ - Read the state of a timer + Reads the state of a timer.

Read the state of a timer that has been created by either @@ -4626,7 +4923,7 @@ os_prompt% the timeout message has been sent, but it does not tell you whether or not it has arrived at its destination yet. When the Result is an integer, it represents the - time in milli-seconds left until the timer will expire. + time in milli-seconds left until the timer expires.

@@ -4651,70 +4948,86 @@ os_prompt% - Read the state of a timer + Reads the state of a timer.

Read the state of a timer. The same as calling erlang:read_timer(TimerRef, []).

+ - Text representation of a reference + Text representation of a reference. -

Returns a string which corresponds to the text +

Returns a string corresponding to the text representation of Ref.

-

This BIF is intended for debugging and for use in - the Erlang operating system. It should not be used in - application programs.

+

This BIF is intended for debugging and for use in the + Erlang OS. It is not to be used in application programs.

+ - Register a name for a pid (or port) + Registers a name for a pid (or port). -

Associates the name RegName with a pid or a port - identifier. RegName, which must be an atom, can be used - instead of the pid / port identifier in the send operator +

Associates the name RegName with a process + identifier (pid) or a port identifier. + RegName, which must be an atom, can be used + instead of the pid or port identifier in send operator (RegName ! Message).

+

Example:

 > register(db, Pid).
 true
-

Failure: badarg if PidOrPort is not an existing, - local process or port, if RegName is already in use, - if the process or port is already registered (already has a - name), or if RegName is the atom undefined.

+

Failures:

+ + badarg + If PidOrPort is not an existing local + process or port. + badarg + If RegName is already in use. + badarg + If the process or port is already registered + (already has a name). + badarg + If RegName is the atom + undefined. +
+ - All registered names + All registered names. -

Returns a list of names which have been registered using - register/2.

+

Returns a list of names that have been registered using + register/2, for + example:

 > registered().
 [code_server, file_server, init, user, my_db]
+ - Resume a suspended process + Resumes a suspended process.

Decreases the suspend count on the process identified by - Suspendee. Suspendee should previously have been - suspended via - erlang:suspend_process/2, + Suspendee. Suspendee + is previously to have been suspended through + erlang:suspend_process/2 or erlang:suspend_process/1 - by the process calling erlang:resume_process(Suspendee). When - the suspend count on Suspendee reach zero, Suspendee - will be resumed, i.e., the state of the Suspendee is changed - from suspended into the state Suspendee was in before it was - suspended. -

+ by the process calling + erlang:resume_process(Suspendee). When the + suspend count on Suspendee reaches zero, + Suspendee is resumed, that is, its state + is changed from suspended into the state it had before it was + suspended.

This BIF is intended for debugging only.

@@ -4722,7 +5035,7 @@ true badarg - If Suspendee isn't a process identifier. + If Suspendee is not a process identifier. badarg @@ -4732,58 +5045,65 @@ true badarg - If the process identified by Suspendee is not alive. + If the process identified by Suspendee + is not alive.
+ - Return an integer by rounding a number + Returns an integer by rounding a number. -

Returns an integer by rounding Number.

+

Returns an integer by rounding Number, + for example:

-> round(5.5).
+round(5.5).
 6

Allowed in guard tests.

+ - Pid of the calling process + Returns pid of the calling process. -

Returns the pid (process identifier) of the calling process.

+

Returns the process identifier of the calling process, for + example:

 > self().
 <0.26.0>

Allowed in guard tests.

+ - Send a message + Sends a message. -

Sends a message and returns Msg. This is the same as - Dest ! Msg.

-

Dest may be a remote or local pid, a (local) port, a - locally registered name, or a tuple {RegName, Node} +

Sends a message and returns Msg. This + is the same as Dest ! Msg.

+

Dest can be a remote or local process identifier, + a (local) port, a locally registered name, or a tuple + {RegName, Node} for a registered name at another node.

+ + Sends a message conditionally. - Send a message conditionally - -

Sends a message and returns ok, or does not send - the message but returns something else (see below). Otherwise - the same as - erlang:send/2. See - also - erlang:send_nosuspend/2,3. - for more detailed explanation and warnings.

-

The possible options are:

+ +

Either sends a message and returns ok, or does not send + the message but returns something else (see the following). + Otherwise the same as + erlang:send/2. + For more detailed explanation and warnings, see + erlang:send_nosuspend/2,3.

+

The options are as follows:

nosuspend @@ -4793,16 +5113,17 @@ true noconnect

If the destination node would have to be auto-connected - before doing the send, noconnect is returned + to do the send, noconnect is returned instead.

-

As with erlang:send_nosuspend/2,3: Use with extreme - care!

+

As with erlang:send_nosuspend/2,3: use with extreme + care.

+ Start a timer @@ -4819,288 +5140,334 @@ true - Start a timer + Starts a timer.

Starts a timer. The same as calling erlang:send_after(Time, Dest, Msg, []).

+ - Try to send a message without ever blocking + Tries to send a message without ever blocking.

The same as - erlang:send(Dest, Msg, [nosuspend]), but returns true if + erlang:send(Dest, + Msg, [nosuspend]), + but returns true if the message was sent and false if the message was not sent because the sender would have had to be suspended.

-

This function is intended for send operations towards an +

This function is intended for send operations to an unreliable remote node without ever blocking the sending (Erlang) process. If the connection to the remote node (usually not a real Erlang node, but a node written in C or - Java) is overloaded, this function will not send the message but return false instead.

-

The same happens, if Dest refers to a local port that - is busy. For all other destinations (allowed for the ordinary - send operator '!') this function sends the message and + Java) is overloaded, this function does not send the message + and returns false.

+

The same occurs if Dest refers to a local port + that is busy. For all other destinations (allowed for the ordinary + send operator '!'), this function sends the message and returns true.

-

This function is only to be used in very rare circumstances +

This function is only to be used in rare circumstances where a process communicates with Erlang nodes that can - disappear without any trace causing the TCP buffers and - the drivers queue to be over-full before the node will actually - be shut down (due to tick timeouts) by net_kernel. The - normal reaction to take when this happens is some kind of + disappear without any trace, causing the TCP buffers and + the drivers queue to be over-full before the node is + shut down (because of tick time-outs) by net_kernel. + The normal reaction to take when this occurs is some kind of premature shutdown of the other node.

-

Note that ignoring the return value from this function would - result in unreliable message passing, which is +

Notice that ignoring the return value from this function would + result in an unreliable message passing, which is contradictory to the Erlang programming model. The message is not sent if this function returns false.

-

Note also that in many systems, transient states of +

In many systems, transient states of overloaded queues are normal. The fact that this function - returns false does not in any way mean that the other + returns false does not mean that the other node is guaranteed to be non-responsive, it could be a - temporary overload. Also a return value of true does - only mean that the message could be sent on the (TCP) channel - without blocking, the message is not guaranteed to have - arrived at the remote node. Also in the case of a disconnected + temporary overload. Also, a return value of true does + only mean that the message can be sent on the (TCP) channel + without blocking, the message is not guaranteed to + arrive at the remote node. For a disconnected non-responsive node, the return value is true (mimics - the behaviour of the ! operator). The expected - behaviour as well as the actions to take when the function - returns false are application and hardware specific.

+ the behavior of operator !). The expected + behavior and the actions to take when the function + returns false are application- and hardware-specific.

-

Use with extreme care!

+

Use with extreme care.

+ - Try to send a message without ever blocking + Tries to send a message without ever blocking.

The same as - erlang:send(Dest, Msg, [nosuspend | Options]), - but with boolean return value.

+ erlang:send(Dest, + Msg, [nosuspend | Options]), + but with a Boolean return value.

This function behaves like erlang:send_nosuspend/2), - but takes a third parameter, a list of options. The only - currently implemented option is noconnect. The option - noconnect makes the function return false if + but takes a third parameter, a list of options. + The only option is noconnect, which + makes the function return false if the remote node is not currently reachable by the local - node. The normal behaviour is to try to connect to the node, - which may stall the process for a shorter period. The use of - the noconnect option makes it possible to be - absolutely sure not to get even the slightest delay when + node. The normal behavior is to try to connect to the node, + which can stall the process during a short period. The use of + option noconnect makes it possible to be + sure not to get the slightest delay when sending to a remote process. This is especially useful when - communicating with nodes who expect to always be - the connecting part (i.e. nodes written in C or Java).

+ communicating with nodes that expect to always be + the connecting part (that is, nodes written in C or Java).

Whenever the function returns false (either when a suspend would occur or when noconnect was specified and the node was not already connected), the message is guaranteed not to have been sent.

-

Use with extreme care!

+

Use with extreme care.

+ - Set the magic cookie of a node + Sets the magic cookie of a node.

Sets the magic cookie of Node to the atom - Cookie. If Node is the local node, the function + Cookie. If Node is the + local node, the function also sets the cookie of all other unknown nodes to - Cookie (see - Distributed Erlang in the Erlang Reference Manual).

+ Cookie (see Section + Distributed Erlang + in the Erlang Reference Manual in System Documentation).

Failure: function_clause if the local node is not alive.

+ - 1..tuple_size(Tuple1) - Set Nth element of a tuple + 1..tuple_size(Tuple1 + Sets the Nth element of a tuple. -

Returns a tuple which is a copy of the argument Tuple1 - with the element given by the integer argument Index +

Returns a tuple that is a copy of argument + Tuple1 + with the element given by integer argument + Index (the first element is the element with index 1) replaced by - the argument Value.

+ argument Value, for example:

 > setelement(2, {10, green, bottles}, red).
 {10,red,bottles}
+ - Size of a tuple or binary + Size of a tuple or binary. -

Returns an integer which is the size of the argument - Item, which must be either a tuple or a binary.

+

Returns an integer that is the size of argument + Item, which must be a tuple or a binary, + for example:

 > size({morni, mulle, bwange}).
 3

Allowed in guard tests.

+ - Create a new process with a fun as entry point + Creates a new process with a fun as entry point. -

Returns the pid of a new process started by the application - of Fun to the empty list []. Otherwise works - like spawn/3.

+

Returns the process identifier of a new process started by the + application of Fun to the empty list + []. Otherwise + works like spawn/3.

+ - Create a new process with a fun as entry point on a given node + Creates a new process with a fun as entry point on a given node. -

Returns the pid of a new process started by the application - of Fun to the empty list [] on Node. If - Node does not exist, a useless pid is returned. - Otherwise works like +

Returns the process identifier of a new process started + by the application of Fun to the + empty list [] on Node. If + Node does not exist, a useless pid is + returned. Otherwise works like spawn/3.

+ - Create a new process with a function as entry point - -

Returns the pid of a new process started by the application - of Module:Function to Args. The new process - created will be placed in the system scheduler queue and be - run some time later.

-

error_handler:undefined_function(Module, Function, Args) is evaluated by the new process if - Module:Function/Arity does not exist (where - Arity is the length of Args). The error handler + Creates a new process with a function as entry point. + +

Returns the process identifier of a new process started by + the application of Module:Function + to Args. + The new created process is placed in the system scheduler + queue and will be run some time later.

+

error_handler:undefined_function(Module, + Function, Args) + is evaluated by the new process if + Module:Function/Arity + does not exist (where Arity is the length of + Args). The error handler can be redefined (see process_flag/2). If error_handler is undefined, or the user has - redefined the default error_handler its replacement is - undefined, a failure with the reason undef will occur.

+ redefined the default error_handler, its replacement is + undefined, and a failure with reason undef occurs.

+

Example:

 > spawn(speed, regulator, [high_speed, thin_cut]).
 <0.13.1>
+ - Create a new process with a function as entry point on a given node + Creates a new process with a function as entry point on a given node. -

Returns the pid of a new process started by the application - of Module:Function to Args on Node. If - Node does not exists, a useless pid is returned. +

Returns the process identifier (pid) of a new process started + by the application + of Module:Function + to Args on Node. If + Node does not exist, a useless pid is returned. Otherwise works like spawn/3.

+ - Create and link to a new process with a fun as entry point + Creates and links to a new process with a fun as entry point. -

Returns the pid of a new process started by the application - of Fun to the empty list []. A link is created between +

Returns the process identifier of a new process started by + the application of Fun to the empty list + []. A link is created between the calling process and the new process, atomically. Otherwise works like spawn/3.

+ - Create and link to a new process with a fun as entry point on a specified node + Creates and links to a new process with a fun as entry point on a specified node. -

Returns the pid of a new process started by the application - of Fun to the empty list [] on Node. A link is +

Returns the process identifier (pid) of a new process started + by the application of Fun to the empty + list [] on Node. A link is created between the calling process and the new process, - atomically. If Node does not exist, a useless pid is - returned (and due to the link, an exit signal with exit - reason noconnection will be received). Otherwise works + atomically. If Node does not exist, + a useless pid is + returned (and, because of the link, an exit signal with exit + reason noconnection is received). Otherwise works like spawn/3.

+ - Create and link to a new process with a function as entry point + Creates and links to a new process with a function as entry point. -

Returns the pid of a new process started by the application - of Module:Function to Args. A link is created +

Returns the process identifier of a new process started by + the applicatio of Module:Function + to Args. A link is created between the calling process and the new process, atomically. Otherwise works like spawn/3.

+ - Create and link to a new process with a function as entry point on a given node + Creates and links to a new process with a function as entry point on a given node. -

Returns the pid of a new process started by the application - of Module:Function to Args on Node. A +

Returns the process identifier (pid) of a new process + started by the application + of Module:Function + to Args on Node. A link is created between the calling process and the new - process, atomically. If Node does not exist, a useless - pid is returned (and due to the link, an exit signal with exit - reason noconnection will be received). Otherwise works + process, atomically. If Node does + not exist, a useless pid + is returned (and, because of the link, an exit signal with exit + reason noconnection is received). Otherwise works like spawn/3.

+ - Create and monitor a new process with a fun as entry point + Creates and monitors a new process with a fun as entry point. -

Returns the pid of a new process started by the application - of Fun to the empty list [] and reference for a monitor - created to the new process. +

Returns the process identifier of a new process, started by + the application of Fun to the empty list + [], + and a reference for a monitor created to the new process. Otherwise works like spawn/3.

+ - Create and monitor a new process with a function as entry point + Creates and monitors a new process with a function as entry point.

A new process is started by the application - of Module:Function to Args, and the process is - monitored at the same time. Returns the pid and a reference - for the monitor. - Otherwise works like + of Module:Function + to Args. The process is + monitored at the same time. Returns the process identifier + and a reference for the monitor. Otherwise works like spawn/3.

+ - - Create a new process with a fun as entry point + Creates a new process with a fun as entry point. + -

Returns the pid of a new process started by the application - of Fun to the empty list []. Otherwise - works like +

Returns the process identifier (pid) of a new process + started by the application of Fun + to the empty list []. Otherwise works like spawn_opt/4.

-

If the option monitor is given, the newly created - process will be monitored and both the pid and reference for - the monitor will be returned.

+

If option monitor is given, the newly created + process is monitored, and both the pid and reference for + the monitor is returned.

+ - - Create a new process with a fun as entry point on a given node + Creates a new process with a fun as entry point on a given node. + -

Returns the pid of a new process started by the application - of Fun to the empty list [] on Node. If - Node does not exist, a useless pid is returned. - Otherwise works like +

Returns the process identifier (pid) of a new process started + by the application of Fun to the + empty list [] on Node. If + Node does not exist, a useless pid is + returned. Otherwise works like spawn_opt/4.

+ - - Create a new process with a function as entry point + Creates a new process with a function as entry point. + -

Works exactly like +

Works as spawn/3, except that an extra option list is given when creating the process.

-

If the option monitor is given, the newly created - process will be monitored and both the pid and reference for - the monitor will be returned.

+

If option monitor is given, the newly created + process is monitored, and both the pid and reference for + the monitor is returned.

+

The options are as follows:

link @@ -5109,112 +5476,123 @@ true monitor -

Monitor the new process (just like +

Monitors the new process (like monitor/2 does).

- {priority, Level} + {priority, Level

Sets the priority of the new process. Equivalent to executing - process_flag(priority, Level) in the start function of the new process, - except that the priority will be set before the process is - selected for execution for the first time. For more information - on priorities see - process_flag(priority, Level).

+ process_flag(priority, + Level) + in the start function of the new process, + except that the priority is set before the process is + selected for execution for the first time. For more + information on priorities, see + process_flag(priority, + Level).

{fullsweep_after, Number} -

This option is only useful for performance tuning. - In general, you should not use this option unless you - know that there is problem with execution times and/or - memory consumption, and you should measure to make sure - that the option improved matters. -

+

Useful only for performance tuning. Do not use this + option unless you + know that there is problem with execution times or + memory consumption, and ensure + that the option improves matters.

The Erlang runtime system uses a generational garbage collection scheme, using an "old heap" for data that has survived at least one garbage collection. When there is no more room on the old heap, a fullsweep garbage - collection will be done.

-

The fullsweep_after option makes it possible to + collection is done.

+

Option fullsweep_after makes it possible to specify the maximum number of generational collections - before forcing a fullsweep even if there is still room on - the old heap. Setting the number to zero effectively - disables the general collection algorithm, meaning that + before forcing a fullsweep, even if there is room on + the old heap. Setting the number to zero + disables the general collection algorithm, that is, all live data is copied at every garbage collection.

-

Here are a few cases when it could be useful to change - fullsweep_after. Firstly, if binaries that are no - longer used should be thrown away as soon as possible. - (Set Number to zero.) Secondly, a process that - mostly have short-lived data will be fullsweeped seldom - or never, meaning that the old heap will contain mostly - garbage. To ensure a fullsweep once in a while, set - Number to a suitable value such as 10 or 20. - Thirdly, in embedded systems with limited amount of RAM - and no virtual memory, one might want to preserve memory - by setting Number to zero. (The value may be set - globally, see - erlang:system_flag/2.)

+

A few cases when it can be useful to change + fullsweep_after:

+ + If binaries that are no longer used are to be + thrown away as soon as possible. (Set + Number to zero.) + + A process that mostly have short-lived data is + fullsweeped seldom or never, that is, the old heap + contains mostly garbage. To ensure a fullsweep + occasionally, set Number to a + suitable value, such as 10 or 20. + + In embedded systems with a limited amount of RAM + and no virtual memory, you might want to preserve memory + by setting Number to zero. + (The value can be set globally, see + erlang:system_flag/2.) + +
{min_heap_size, Size} -

This option is only useful for performance tuning. - In general, you should not use this option unless you - know that there is problem with execution times and/or - memory consumption, and you should measure to make sure - that the option improved matters. -

-

Gives a minimum heap size in words. Setting this value - higher than the system default might speed up some +

Useful only for performance tuning. Do not use this + option unless you know that there is problem with + execution times or memory consumption, and + ensure that the option improves matters.

+

Gives a minimum heap size, in words. Setting this value + higher than the system default can speed up some processes because less garbage collection is done. - Setting too high value, however, might waste memory and - slow down the system due to worse data locality. - Therefore, it is recommended to use this option only for + However, setting a too high value can waste memory and + slow down the system because of worse data locality. + Therefore, use this option only for fine-tuning an application and to measure the execution time with various Size values.

{min_bin_vheap_size, VSize} -

This option is only useful for performance tuning. - In general, you should not use this option unless you - know that there is problem with execution times and/or - memory consumption, and you should measure to make sure - that the option improved matters. -

-

Gives a minimum binary virtual heap size in words. Setting this value - higher than the system default might speed up some +

Useful only for performance tuning. Do not use this + option unless you know that there is problem with + execution times or memory consumption, and + ensure that the option improves matters.

+

Gives a minimum binary virtual heap size, in words. + Setting this value + higher than the system default can speed up some processes because less garbage collection is done. - Setting too high value, however, might waste memory. - Therefore, it is recommended to use this option only for + However, setting a too high value can waste memory. + Therefore, use this option only for fine-tuning an application and to measure the execution time with various VSize values.

-
+ - - Create a new process with a function as entry point on a given node + Creates a new process with a function as entry point on a given node. + -

Returns the pid of a new process started by the application - of Module:Function to Args on Node. If +

Returns the process identifier (pid) of a new process started + by the application + of Module:Function to + Args on Node. If Node does not exist, a useless pid is returned. Otherwise works like spawn_opt/4.

-

The monitor option is currently not supported by +

Option monitor is not supported by spawn_opt/5.

+ 0..byte_size(Bin) - Split a binary into two + Splits a binary into two. -

Returns a tuple containing the binaries which are the result - of splitting Bin into two parts at position Pos. +

Returns a tuple containing the binaries that are the result + of splitting Bin into two parts at + position Pos. This is not a destructive operation. After the operation, - there will be three binaries altogether.

+ there are three binaries altogether.

+

Example:

 > B = list_to_binary("0123456789").
 <<"0123456789">>
@@ -5228,9 +5606,10 @@ true
7
+ - Start a timer + Starts a timer.

Starts a timer. When the timer expires, the message @@ -5268,7 +5647,7 @@ true is not allowed to be negative.

- If Dest is a pid(), it has to + If Dest is a pid(), it must be a pid() of a process created on the current runtime system instance. This process may or may not have terminated. If Dest is an @@ -5278,11 +5657,11 @@ true is given if the name does not refer to a process.

- If Dest is a pid(), the timer will - be automatically canceled if the process referred to by the + If Dest is a pid(), the timer is + automatically canceled if the process referred to by the pid() is not alive, or when the process exits. This - feature was introduced in erts version 5.4.11. Note that - timers will not be automatically canceled when + feature was introduced in ERTS version 5.4.11. Notice that + timers are not automatically canceled when Dest is an atom().

See also @@ -5290,13 +5669,14 @@ true erlang:cancel_timer/2, and erlang:read_timer/2.

-

Failure: badarg if the arguments does not satisfy - the requirements specified above.

+

Failure: badarg if the arguments do not satisfy + the requirements specified here.

+ - Start a timer + Starts a timer.

Starts a timer. The same as calling erlang:start_timer(Time, @@ -5305,126 +5685,137 @@ true - Information about context switches + Information about context switches. -

ContextSwitches is the total number of context - switches since the system started.

+

Returns the total number of context switches since the + system started.

+ - Information about exact reductions + Information about exact reductions. -

statistics(exact_reductions) is - a more expensive operation than - statistics(reductions) - especially on an Erlang machine with SMP support.

-
+

Returns the number of exact reductions.

+

statistics(exact_reductions) is + a more expensive operation than + statistics(reductions), + especially on an Erlang machine with SMP support.

+
+ - Information about garbage collection + Information about garbage collection. -

This information may not be valid for all implementations.

+

Returns information about garbage collection, for example:

 > statistics(garbage_collection).
-{85,23961,0}
-
+{85,23961,0} +

This information can be invalid for some implementations.

+ - Information about io + Information about I/O. -

Input is the total number of bytes received - through ports, and Output is the total number of - bytes output to ports.

+

Returns Input, + which is the total number of bytes + received through ports, and Output, + which is the total number of bytes output to ports.

+ - Information about reductions + Information about reductions. - -

Since erts-5.5 (OTP release R11B) - this value does not include reductions performed in current - time slices of currently scheduled processes. If an - exact value is wanted, use - statistics(exact_reductions).

-
+

Returns information about reductions, for example:

 > statistics(reductions).
-{2046,11}
-
+{2046,11} +

As from ERTS 5.5 (OTP R11B), + this value does not include reductions performed in current + time slices of currently scheduled processes. If an + exact value is wanted, use + statistics(exact_reductions).

+
+ - Information about the run-queue + Information about the run-queue. -

Returns the total length of the run queues, that is, the number - of processes that are ready to run on all available run queues.

+

Returns the total length of run-queues, that is, the number + of processes that are ready to run on all available run-queues.

+ - Information about run-time + Information about runtime. -

Note that the run-time is the sum of the run-time for all - threads in the Erlang run-time system and may therefore be greater - than the wall-clock time. The time is returned in milliseconds.

+

Returns information about runtime, in milliseconds.

+

The runtime is the sum of the runtime for all threads + in the Erlang runtime system and can therefore be greater + than the wall clock time.

+

Example:

 > statistics(runtime).
-{1690,1620}
-
+{1690,1620}
+ - Information about each schedulers work time - - -

- Returns a list of tuples with {SchedulerId, - ActiveTime, TotalTime}, where - SchedulerId is an integer id of the scheduler, ActiveTime is - the duration the scheduler has been busy, TotalTime is the total time duration since - scheduler_wall_time - activation. The time unit is not defined and may be subject to change - between releases, operating systems and system restarts. - scheduler_wall_time should only be used to calculate relative - values for scheduler-utilization. ActiveTime can never exceed TotalTime. -

- -

The definition of a busy scheduler is when it is not idle or not - scheduling (selecting) a process or port, meaning; executing process - code, executing linked-in-driver or NIF code, executing - built-in-functions or any other runtime handling, garbage collecting - or handling any other memory management. Note, a scheduler may also be - busy even if the operating system has scheduled out the scheduler - thread. -

- -

- Returns undefined if the system flag - scheduler_wall_time - is turned off. -

- -

The list of scheduler information is unsorted and may appear in different order - between calls. -

-

Using scheduler_wall_time to calculate scheduler utilization.

+ Information about each schedulers work time. + + +

Returns a list of tuples with + {SchedulerId, ActiveTime, + TotalTime}, where + SchedulerId is an integer ID of the scheduler, + ActiveTime is + the duration the scheduler has been busy, and + TotalTime is the total time duration since + scheduler_wall_time + activation. The time unit is undefined and can be subject + to change between releases, OSs, and system restarts. + scheduler_wall_time is only to be used to + calculate relative values for scheduler-use. + ActiveTime can never exceed + TotalTime.

+

The definition of a busy scheduler is when it is not idle + and is not scheduling (selecting) a process or port, + that is:

+ + Executing process code + Executing linked-in-driver or NIF code + Executing built-in-functions, or any other runtime + handling + Garbage collecting + Handling any other memory management + +

Notice that a scheduler can also be busy even if the + OS has scheduled out the scheduler thread.

+

Returns undefined if system flag + scheduler_wall_time + is turned off.

+

The list of scheduler information is unsorted and can + appear in different order between calls.

+

Using scheduler_wall_time to calculate scheduler-use:

 > erlang:system_flag(scheduler_wall_time, true).
 false
 > Ts0 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
-ok
-
-

Some time later we will take another snapshot and calculate scheduler-utilization per scheduler.

+ok +

Some time later the user takes another snapshot and calculates + scheduler-use per scheduler, for example:

 > Ts1 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
 ok
@@ -5437,86 +5828,90 @@ ok
  {5,0.9717956667018103},
  {6,0.9739235846420741},
  {7,0.973237033077876},
- {8,0.9741297293248656}]
-
-

Using the same snapshots to calculate a total scheduler-utilization.

+ {8,0.9741297293248656}] +

Using the same snapshots to calculate a total scheduler-use:

 > {A, T} = lists:foldl(fun({{_, A0, T0}, {_, A1, T1}}, {Ai,Ti}) ->
 	{Ai + (A1 - A0), Ti + (T1 - T0)} end, {0, 0}, lists:zip(Ts0,Ts1)), A/T.
-0.9769136803764825
-
+0.9769136803764825 -

scheduler_wall_time is by default disabled. Use erlang:system_flag(scheduler_wall_time, true) to enable it.

+

scheduler_wall_time is by default disabled. To + enable it, use + erlang:system_flag(scheduler_wall_time, true).

+ - Information about wall-clock + Information about wall clock. -

wall_clock can be used in the same manner as +

Returns information about wall clock. wall_clock can + be used in the same manner as runtime, except that real time is measured as opposed to runtime or CPU time.

+ - Suspend a process + Suspends a process.

Increases the suspend count on the process identified by - Suspendee and puts it in the suspended state if it isn't - already in the suspended state. A suspended process will not be - scheduled for execution until the process has been resumed. -

- + Suspendee and puts it in the suspended + state if it is not + already in that state. A suspended process will not be + scheduled for execution until the process has been resumed.

A process can be suspended by multiple processes and can be suspended multiple times by a single process. A suspended - process will not leave the suspended state until its suspend - count reach zero. The suspend count of Suspendee - is decreased when + process does not leave the suspended state until its suspend + count reaches zero. The suspend count of + Suspendee is decreased when erlang:resume_process(Suspendee) is called by the same process that called - erlang:suspend_process(Suspendee). All increased suspend - counts on other processes acquired by a process will automatically be + erlang:suspend_process(Suspendee). + All increased suspend + counts on other processes acquired by a process are automatically decreased when the process terminates.

- -

Currently the following options (Opts) are available:

+

The options (Opts) are as follows:

asynchronous A suspend request is sent to the process identified by - Suspendee. Suspendee will eventually suspend - unless it is resumed before it was able to suspend. The caller - of erlang:suspend_process/2 will return immediately, - regardless of whether the Suspendee has suspended yet - or not. Note that the point in time when the Suspendee - will actually suspend cannot be deduced from other events - in the system. The only guarantee given is that the - Suspendee will eventually suspend (unless it - is resumed). If the asynchronous option has not - been passed, the caller of erlang:suspend_process/2 will - be blocked until the Suspendee has actually suspended. + Suspendee. Suspendee + eventually suspends + unless it is resumed before it could suspend. The caller + of erlang:suspend_process/2 returns immediately, + regardless of whether Suspendee has + suspended yet or not. The point in time when + Suspendee suspends cannot be deduced + from other events in the system. It is only guaranteed that + Suspendee eventually suspends + (unless it + is resumed). If option asynchronous has not + been passed, the caller of erlang:suspend_process/2 is + blocked until Suspendee has suspended. unless_suspending - The process identified by Suspendee will be suspended - unless the calling process already is suspending the - Suspendee. If unless_suspending is combined - with the asynchronous option, a suspend request will be - sent unless the calling process already is suspending the - Suspendee or if a suspend request already has been sent - and is in transit. If the calling process already is suspending - the Suspendee, or if combined with the asynchronous - option and a send request already is in transit, - false is returned and the suspend count on Suspendee - will remain unchanged. + The process identified by Suspendee is + suspended unless the calling process already is suspending + Suspendee. + If unless_suspending is combined + with option asynchronous, a suspend request is + sent unless the calling process already is suspending + Suspendee or if a suspend request + already has been sent and is in transit. If the calling + process already is suspending Suspendee, + or if combined with option asynchronous + and a send request already is in transit, + false is returned and the suspend count on + Suspendee remains unchanged. -

If the suspend count on the process identified by - Suspendee was increased, true is returned; otherwise, - false is returned.

- + Suspendee is increased, true + is returned, otherwise false.

This BIF is intended for debugging only.

@@ -5524,310 +5919,324 @@ ok badarg - If Suspendee isn't a process identifier. + If Suspendee is not a process identifier. badarg - If the process identified by Suspendee is same the process as - the process calling erlang:suspend_process/2. + If the process identified by Suspendee + is the same process + as the process calling erlang:suspend_process/2. badarg - If the process identified by Suspendee is not alive. + If the process identified by Suspendee + is not alive. badarg - If the process identified by Suspendee resides on another node. + If the process identified by Suspendee + resides on another node. badarg - If OptList isn't a proper list of valid Opts. + If OptList is not a proper list of valid + Opts. system_limit - If the process identified by Suspendee has been suspended more - times by the calling process than can be represented by the - currently used internal data structures. The current system limit - is larger than 2 000 000 000 suspends, and it will never be less - than that. + If the process identified by Suspendee + has been suspended + more times by the calling process than can be represented by the + currently used internal data structures. The system limit is + higher than 2,000,000,000 suspends and will never be lower.
+ - Suspend a process - -

Suspends the process identified by Suspendee. The - same as calling - erlang:suspend_process(Suspendee, []). For more information see the documentation of erlang:suspend_process/2. -

+ Suspends a process. + +

Suspends the process identified by + Suspendee. The same as calling + erlang:suspend_process(Suspendee, + []). + For more information, see + erlang:suspend_process/2.

This BIF is intended for debugging only.

+ - Set system flag backtrace_depth + Sets system flag backtrace_depth.

Sets the maximum depth of call stack back-traces in the exit reason element of 'EXIT' tuples.

Returns the old value of the flag.

+ + Sets system flag cpu_topology. - Set system flag cpu_topology

- This argument is deprecated and - scheduled for removal in erts-5.10/OTP-R16. Instead of using - this argument you are advised to use the erl command - line argument +sct. - When this argument has been removed a final CPU topology to use - will be determined at emulator boot time.

+ This argument is deprecated and scheduled for + removal in ERTS 5.10/OTP R16. Instead of using this + argument, use command-line argument + +sct in + erl(1).

+

When this argument is removed, a final CPU topology + to use will be determined at emulator boot time.

-

Sets the user defined CpuTopology. The user defined - CPU topology will override any automatically detected - CPU topology. By passing undefined as CpuTopology - the system will revert back to the CPU topology automatically +

Sets the user-defined CpuTopology. + The user-defined + CPU topology overrides any automatically detected + CPU topology. By passing undefined as + CpuTopology, + the system reverts to the CPU topology automatically detected. The returned value equals the value returned from erlang:system_info(cpu_topology) before the - change was made. -

+ change was made.

Returns the old value of the flag.

The CPU topology is used when binding schedulers to logical processors. If schedulers are already bound when the CPU - topology is changed, the schedulers will be sent a request - to rebind according to the new CPU topology. -

-

The user defined CPU topology can also be set by passing - the +sct command - line argument to erl. -

-

For information on the CpuTopology type - and more, see the documentation of - erlang:system_info(cpu_topology), - and the erl +sct - and +sbt - command line flags. -

+ topology is changed, the schedulers are sent a request + to rebind according to the new CPU topology.

+

The user-defined CPU topology can also be set by passing + command-line argument + +sct to + erl(1).

+

For information on type CpuTopology + and more, see + erlang:system_info(cpu_topology) + as well as the command-line flags + +sct and + +sbt in + erl(1).

+ - Set system flag dirty CPU schedulers online + Sets system_flag_dirty_cpu_schedulers_online.

- Sets the amount of dirty CPU schedulers online. Valid range is - where N is the - lesser of the return values of erlang:system_info(dirty_cpu_schedulers) and - erlang:system_info(schedulers_online). -

+ Sets the number of dirty CPU schedulers online. Range is + , where N + is the smallest of the return values of + erlang:system_info(dirty_cpu_schedulers) and + erlang:system_info(schedulers_online).

Returns the old value of the flag.

-

Note that the number of dirty CPU schedulers online may change if the number of - schedulers online changes. For example, if there are 12 schedulers and all are - online, and 6 dirty CPU schedulers, all online as well, and system_flag/2 - is used to set the number of schedulers online to 6, then the number of dirty - CPU schedulers online is automatically decreased by half as well, down to 3. - Similarly, the number of dirty CPU schedulers online increases proportionally - to increases in the number of schedulers online.

-

Note that the dirty schedulers functionality is experimental, and - that you have to enable support for dirty schedulers when building OTP in order - to try out the functionality.

-

For more information see +

The number of dirty CPU schedulers online can change if the + number of schedulers online changes. For example, if 12 + schedulers and 6 dirty CPU schedulers are online, and + system_flag/2 is used to set the number of + schedulers online to 6, then the number of dirty CPU + schedulers online is automatically decreased by half as well, + down to 3. Similarly, the number of dirty CPU schedulers + online increases proportionally to increases in the number of + schedulers online.

+

The dirty schedulers functionality is experimental. + Enable support for dirty schedulers when building OTP to + try out the functionality.

+
+

For more information, see erlang:system_info(dirty_cpu_schedulers) and - erlang:system_info(dirty_cpu_schedulers_online). -

+ erlang:system_info(dirty_cpu_schedulers_online).

+ - Set system flag fullsweep_after + Sets system flag fullsweep_after. -

Number is a non-negative integer which indicates +

Sets system flag fullsweep_after. + Number is a non-negative integer indicating how many times generational garbage collections can be done without forcing a fullsweep collection. The value - applies to new processes; processes already running are + applies to new processes, while processes already running are not affected.

Returns the old value of the flag.

In low-memory systems (especially without virtual - memory), setting the value to 0 can help to conserve + memory), setting the value to 0 can help to conserve memory.

-

An alternative way to set this value is through the - (operating system) environment variable - ERL_FULLSWEEP_AFTER.

+

This value can also be set through (OS) + environment variable ERL_FULLSWEEP_AFTER.

+ - Set system flag min_heap_size - -

Sets the default minimum heap size for processes. The - size is given in words. The new min_heap_size only - effects processes spawned after the change of - min_heap_size has been made. - The min_heap_size can be set for individual - processes by use of + Sets system flag min_heap_size. + +

Sets the default minimum heap size for processes. The size + is given in words. The new min_heap_size effects + only processes spawned after the change of + min_heap_size has been made. min_heap_size + can be set for individual processes by using spawn_opt/N or - process_flag/2.

+ process_flag/2.

Returns the old value of the flag.

+ - Set system flag min_bin_vheap_size + Sets system flag min_bin_vheap_size. -

Sets the default minimum binary virtual heap size for processes. The - size is given in words. The new min_bin_vhheap_size only - effects processes spawned after the change of +

Sets the default minimum binary virtual heap size for + processes. The size is given in words. + The new min_bin_vhheap_size effects only + processes spawned after the change of min_bin_vhheap_size has been made. - The min_bin_vheap_size can be set for individual - processes by use of + min_bin_vheap_size can be set for individual + processes by using spawn_opt/N or - process_flag/2.

+ process_flag/2.

Returns the old value of the flag.

+ - Set system flag multi_scheduling + Sets system flag multi_scheduling.

If multi-scheduling is enabled, more than one scheduler thread is used by the emulator. Multi-scheduling can be - blocked. When multi-scheduling has been blocked, only - one scheduler thread will schedule Erlang processes.

-

If BlockState =:= block, multi-scheduling will - be blocked. If BlockState =:= unblock and no-one - else is blocking multi-scheduling and this process has - only blocked one time, multi-scheduling will be unblocked. - One process can block multi-scheduling multiple times. - If a process has blocked multiple times, it has to + blocked. When multi-scheduling is blocked, only + one scheduler thread schedules Erlang processes.

+

If BlockState =:= block, multi-scheduling is + blocked. If BlockState =:= unblock and no one + else blocks multi-scheduling, and this process has + blocked only once, multi-scheduling is unblocked.

+

One process can block multi-scheduling multiple times. + If a process has blocked multiple times, it must unblock exactly as many times as it has blocked before it has released its multi-scheduling block. If a process that - has blocked multi-scheduling exits, it will release its + has blocked multi-scheduling exits, it releases its blocking of multi-scheduling.

The return values are disabled, blocked, or enabled. The returned value describes the state just after the call to erlang:system_flag(multi_scheduling, BlockState) - has been made. The return values are described in the - documentation of erlang:system_info(multi_scheduling).

-

NOTE: Blocking of multi-scheduling should normally - not be needed. If you feel that you need to - block multi-scheduling, think through the - problem at least a couple of times again. - Blocking multi-scheduling should only be used - as a last resort since it will most likely be - a very inefficient way to solve the - problem.

-

See also erlang:system_info(multi_scheduling), + has been made. For information about the return values, see + erlang:system_info(multi_scheduling).

+

Blocking of multi-scheduling is normally not needed. + If you feel that you need to block multi-scheduling, + consider it a few more times again. Blocking multi-scheduling + is only to be used as a last resort, as it is most likely + a very inefficient way to solve the problem.

+
+

See also + erlang:system_info(multi_scheduling), erlang:system_info(multi_scheduling_blockers), and erlang:system_info(schedulers).

+ + Sets system flag scheduler_bind_type. - Set system flag scheduler_bind_type

- This argument is deprecated and - scheduled for removal in erts-5.10/OTP-R16. Instead of using - this argument you are advised to use the erl command - line argument +sbt. - When this argument has been removed a final scheduler bind type - to use will be determined at emulator boot time.

+ This argument is deprecated and scheduled for + removal in ERTS 5.10/OTP R16. Instead of using this + argument, use command-line argument + +sbt in erl(1). + When this argument is removed, a final scheduler bind + type to use will be determined at emulator boot time.

Controls if and how schedulers are bound to logical processors.

-

When erlang:system_flag(scheduler_bind_type, How) is - called, an asynchronous signal is sent to all schedulers - online which causes them to try to bind or unbind as requested. - NOTE: If a scheduler fails to bind, this - will often be silently ignored. This since it isn't always - possible to verify valid logical processor identifiers. If - an error is reported, it will be reported to the - error_logger. If you want to verify that the - schedulers actually have bound as requested, call - erlang:system_info(scheduler_bindings). -

-

Schedulers can currently only be bound on newer Linux, +

When erlang:system_flag(scheduler_bind_type, How + is called, an asynchronous signal is sent to all schedulers + online, causing them to try to bind or unbind as requested.

+

If a scheduler fails to bind, this is often silently + ignored, as it is not always possible to verify valid + logical processor identifiers. If an error is reported, + it is reported to error_logger. To verify that the + schedulers have bound as requested, call + erlang:system_info(scheduler_bindings).

+
+

Schedulers can be bound on newer Linux, Solaris, FreeBSD, and Windows systems, but more systems will be - supported in the future. -

+ supported in future releases.

In order for the runtime system to be able to bind schedulers, - the CPU topology needs to be known. If the runtime system fails - to automatically detect the CPU topology, it can be defined. + the CPU topology must be known. If the runtime system fails + to detect the CPU topology automatically, it can be defined. For more information on how to define the CPU topology, see - the erl +sct command - line flag. -

-

The runtime system will by default not bind schedulers - to logical processors. -

-

NOTE: If the Erlang runtime system is the only - operating system process that binds threads to logical processors, - this improves the performance of the runtime system. However, - if other operating system processes (as for example another Erlang - runtime system) also bind threads to logical processors, there - might be a performance penalty instead. In some cases this - performance penalty might be severe. If this is the case, you - are advised to not bind the schedulers.

-

Schedulers can be bound in different ways. The How - argument determines how schedulers are bound. How can - currently be one of:

+ command-line flag +sct + in erl(1).

+

The runtime system does by default not bind schedulers + to logical processors.

+

If the Erlang runtime system is the only OS + process binding threads to logical processors, this + improves the performance of the runtime system. However, + if other OS processes (for example, another Erlang + runtime system) also bind threads to logical processors, + there can be a performance penalty instead. Sometimes this + performance penalty can be severe. If so, it is recommended + to not bind the schedulers.

+
+

Schedulers can be bound in different ways. Argument + How determines how schedulers are + bound and can be any of the following:

unbound -

Same as the erl command line argument - +sbt u. +

Same as command-line argument + +sbt u in erl(1).

no_spread -

Same as the erl command line argument - +sbt ns. +

Same as command-line argument + +sbt ns in erl(1).

thread_spread -

Same as the erl command line argument - +sbt ts. +

Same as command-line argument + +sbt ts in erl(1).

processor_spread -

Same as the erl command line argument - +sbt ps. +

Same as command-line argument + +sbt ps in erl(1).

spread -

Same as the erl command line argument - +sbt s. +

Same as command-line argument + +sbt s in erl(1).

no_node_thread_spread -

Same as the erl command line argument - +sbt nnts. +

Same as command-line argument + +sbt nnts in erl(1).

no_node_processor_spread -

Same as the erl command line argument - +sbt nnps. +

Same as command-line argument + +sbt nnps in erl(1).

thread_no_node_processor_spread -

Same as the erl command line argument - +sbt tnnps. +

Same as command-line argument + +sbt tnnps in erl(1).

default_bind -

Same as the erl command line argument - +sbt db. +

Same as command-line argument + +sbt db in erl(1).

-

The value returned equals How before the - scheduler_bind_type flag was changed.

-

Failure:

+

The returned value equals How before flag + scheduler_bind_type was changed.

+

Failures:

notsup @@ -5835,80 +6244,82 @@ ok badarg -

If How isn't one of the documented alternatives.

+

If How is not one of the documented + alternatives.

badarg -

If no CPU topology information is available.

+

If CPU topology information is unavailable.

The scheduler bind type can also be set by passing - the +sbt command - line argument to erl. -

+ command-line argument + +sbt to erl(1).

For more information, see erlang:system_info(scheduler_bind_type), erlang:system_info(scheduler_bindings), - the erl +sbt - and +sct command line - flags. -

+ as well as command-line flags + +sbt + and +sct + in erl(1).

+ - Set system flag scheduler_wall_time + Sets system flag scheduler_wall_time.

- Turns on/off scheduler wall time measurements.

-

For more information see, - erlang:statistics(scheduler_wall_time). -

+ Turns on or off scheduler wall time measurements.

+

For more information, see + erlang:statistics(scheduler_wall_time).

+ - Set system flag schedulers_online + Sets system flag schedulers_online.

- Sets the amount of schedulers online. Valid range is - . -

+ Sets the number of schedulers online. Range is + .

Returns the old value of the flag.

-

Note that if the emulator was built with support for dirty schedulers, - changing the number of schedulers online can also change the number of dirty - CPU schedulers online. For example, if there are 12 schedulers and all are - online, and 6 dirty CPU schedulers, all online as well, and system_flag/2 - is used to set the number of schedulers online to 6, then the number of dirty - CPU schedulers online is automatically decreased by half as well, down to 3. - Similarly, the number of dirty CPU schedulers online increases proportionally - to increases in the number of schedulers online.

-

For more information see, - erlang:system_info(schedulers), +

The emulator was built with support for + dirty schedulers. + Changing the number of schedulers online can also change the + number of dirty CPU schedulers online. For example, if 12 + schedulers and 6 dirty CPU schedulers are online, and + system_flag/2 is used to set the number of schedulers + online to 6, then the number of dirty CPU schedulers online + is automatically decreased by half as well, down to 3. + Similarly, the number of dirty CPU schedulers online increases + proportionally to increases in the number of schedulers online.

+

For more information, see + erlang:system_info(schedulers) and - erlang:system_info(schedulers_online). -

+ erlang:system_info(schedulers_online).

+ - Set system flag trace_control_word + Sets system flag trace_control_word. -

Sets the value of the node's trace control word to - TCW. TCW should be an unsigned integer. For - more information see documentation of the +

Sets the value of the node trace control word to + TCW, which is to be an unsigned integer. + For more information, see the function set_tcw - function in the match specification documentation in the - ERTS User's Guide.

+ in Section "Match Specifications in Erlang" in the + User's Guide.

Returns the old value of the flag.

- + Finalize the Time Offset -

Finalizes the time offset +

+ Finalizes the time offset when the single time warp mode is being used. If another time warp mode than the "single time warp mode" is used, the time offset state will be left @@ -5932,71 +6343,74 @@ ok + + Information about the system allocators. - Information about the allocators of the system -

- Returns various information about the - allocators of the + +

Returns various information about the allocators of the current system (emulator) as specified by Item:

+ - allocated_areas + allocated_areas

Returns a list of tuples with information about miscellaneous allocated memory areas.

-

Each tuple contains an atom describing type of memory as - first element and amount of allocated memory in bytes as - second element. In those cases when there is information - present about allocated and used memory, a third element - is present. This third element contains the amount of +

Each tuple contains an atom describing the type of + memory as first element and the amount of allocated + memory in bytes as second element. When information + about allocated and used memory is present, also a + third element is present, containing the amount of used memory in bytes.

erlang:system_info(allocated_areas) is intended - for debugging, and the content is highly implementation - dependent. The content of the results will therefore - change when needed without prior notice.

-

Note: The sum of these values is not + for debugging, and the content is highly + implementation-dependent. The content of the results + therefore changes when needed without prior notice.

+

Notice that the sum of these values is not the total amount of memory allocated by the emulator. Some values are part of other values, and some memory - areas are not part of the result. If you are interested - in the total amount of memory allocated by the emulator - see erlang:memory/0,1.

+ areas are not part of the result. For information about + the total amount of memory allocated by the emulator, see + erlang:memory/0,1.

- allocator + allocator -

Returns {Allocator, Version, Features, Settings}.

-

Explanation:

+ +

Returns {Allocator, Version, + Features, Settings, where:

-

Allocator corresponds to the malloc() - implementation used. If Allocator equals +

Allocator corresponds to the + malloc() implementation used. If + Allocator equals undefined, the malloc() implementation - used could not be identified. Currently - glibc can be identified.

+ used cannot be identified. glibc can be + identified.

-

Version is a list of integers (but not a - string) representing the version of +

Version is a list of integers + (but not a string) representing the version of the malloc() implementation used.

-

Features is a list of atoms representing - allocation features used.

+

Features is a list of atoms + representing the allocation features used.

-

Settings is a list of subsystems, their - configurable parameters, and used values. Settings - may differ between different combinations of +

Settings is a list of subsystems, + their configurable parameters, and used values. Settings + can differ between different combinations of platforms, allocators, and allocation features. Memory sizes are given in bytes.

@@ -6004,59 +6418,63 @@ ok

See also "System Flags Effecting erts_alloc" in erts_alloc(3).

- alloc_util_allocators + alloc_util_allocators -

Returns a list of the names of all allocators - using the ERTS internal alloc_util framework - as atoms. For more information see the - "the - alloc_util framework" section in the - erts_alloc(3) documentation. -

+ +

Returns a list of the names of all allocators using + the ERTS internal alloc_util framework + as atoms. For more information, see Section + "The + alloc_util framework" in erts_alloc(3).

- {allocator, Alloc} + {allocator, Alloc} +

Returns information about the specified allocator. - As of erts version 5.6.1 the return value is a list - of {instance, InstanceNo, InstanceInfo} tuples + As from ERTS 5.6.1, the return value is a list + of {instance, InstanceNo, InstanceInfo} tuples, where InstanceInfo contains information about - a specific instance of the allocator. As of erts version - 5.10.4 the returned list when calling + a specific instance of the allocator. As from + ERTS 5.10.4, the returned list when calling erlang:system_info({allocator, mseg_alloc}) also - include an {erts_mmap, _} tuple as one element - in the list. - If Alloc is not a recognized allocator, - undefined is returned. If Alloc is disabled, + includes an {erts_mmap, _} tuple as one element + in the list. If Alloc is not a + recognized allocator, undefined is returned. + If Alloc is disabled, false is returned.

-

Note: The information returned is highly - implementation dependent and may be changed, or removed +

Notice that the information returned is highly + implementation-dependent and can be changed or removed at any time without prior notice. It was initially intended as a tool when developing new allocators, but - since it might be of interest for others it has been + as it can be of interest for others it has been briefly documented.

The recognized allocators are listed in erts_alloc(3). After reading the erts_alloc(3) documentation, the returned information - should more or less speak for itself. But it can be worth + more or less speaks for itself, but it can be worth explaining some things. Call counts are presented by two - values. The first value is giga calls, and the second - value is calls. mbcs, and sbcs are - abbreviations for, respectively, multi-block carriers, and - single-block carriers. Sizes are presented in bytes. When - it is not a size that is presented, it is the amount of - something. Sizes and amounts are often presented by three - values, the first is current value, the second is maximum - value since the last call to - erlang:system_info({allocator, Alloc}), and - the third is maximum value since the emulator was started. - If only one value is present, it is the current value. + values, the first value is giga calls, and the second + value is calls. mbcs and sbcs denote + multi-block carriers, and single-block carriers, + respectively. Sizes are presented in bytes. When a + size is not presented, it is the amount of something. + Sizes and amounts are often presented by three values:

+ + The first is the current value. + The second is the maximum value since the last call + to erlang:system_info({allocator, Alloc}). + The third is the maximum value since the emulator + was started. + +

If only one value is present, it is the current value. fix_alloc memory block types are presented by two - values. The first value is memory pool size and - the second value used memory size.

+ values. The first value is the memory pool size and + the second value is the used memory size.

- {allocator_sizes, Alloc} + {allocator_sizes, Alloc} +

Returns various size information for the specified allocator. The information returned is a subset of the information returned by @@ -6066,103 +6484,103 @@ ok + + Information about the CPU topology of the system. - All LevelEntrys of a list must contain the same LevelTag, except on the top level where both node and - processor LevelTags may co-exist. + processor LevelTags can coexist. - {LevelTag, SubLevel} == {LevelTag, [], SubLevel} + {LevelTag, + SubLevel} == {LevelTag, [], + SubLevel} - More LevelTags may be introduced in the future. + More LevelTags can be introduced in a + future release. - The info_list() may be extended in the future. + The info_list() can be extended in a future release. - Information about the CPU topology of the system -

Returns various information about the - CPU topology - of the current system - (emulator) as specified by Item:

+ + +

Returns various information about the CPU topology of + the current system (emulator) as specified by + Item:

cpu_topology -

Returns the CpuTopology which currently is used by the - emulator. The CPU topology is used when binding schedulers +

Returns the CpuTopology currently used by + the emulator. The CPU topology is used when binding schedulers to logical processors. The CPU topology used is the - user - defined CPU topology if such exists; otherwise, the - automatically - detected CPU topology if such exists. If no CPU topology + user-defined CPU topology, + if such exists, otherwise the + automatically detected CPU topology, + if such exists. If no CPU topology exists, undefined is returned.

-

node refers to NUMA (non-uniform memory access) - nodes, and thread refers to hardware threads - (e.g. Intels hyper-threads).

-

A level in the CpuTopology term can be omitted if - only one entry exists and the InfoList is empty. -

+

node refers to Non-Uniform Memory Access (NUMA) + nodes. thread refers to hardware threads + (for example, Intel hyper-threads).

+

A level in term CpuTopology can be + omitted if only one entry exists and + InfoList is empty.

thread can only be a sub level to core. - core can be a sub level to either processor - or node. processor can either be on the + core can be a sub level to processor + or node. processor can be on the top level or a sub level to node. node - can either be on the top level or a sub level to + can be on the top level or a sub level to processor. That is, NUMA nodes can be processor internal or processor external. A CPU topology can consist of a mix of processor internal and external - NUMA nodes, as long as each logical CPU belongs to one - and only one NUMA node. Cache hierarchy is not part of - the CpuTopology type yet, but will be in the - future. Other things may also make it into the CPU - topology in the future. In other words, expect the - CpuTopology type to change. -

-
- {cpu_topology, defined} - -

Returns the user defined CpuTopology. For more - information see the documentation of - the erl +sct command - line flag, and the documentation of the - cpu_topology - argument. -

-
- {cpu_topology, detected} - -

Returns the automatically detected CpuTopology. The - emulator currently only detects the CPU topology on some newer - Linux, Solaris, FreeBSD, and Windows systems. On Windows system with - more than 32 logical processors the CPU topology is not detected. -

-

For more information see the documentation of the - cpu_topology - argument. -

+ NUMA nodes, as long as each logical CPU belongs to + one NUMA node. Cache hierarchy is not part of + the CpuTopology type, but will be in a + future release. Other things can also make it into the CPU + topology in a future release. In other words, expect the + CpuTopology type to change.

+
+ {cpu_topology, defined} + + +

Returns the user-defined CpuTopology. + For more information, see command-line flag + +sct in + erl(1) and argument + cpu_topology.

+
+ {cpu_topology, detected} + + +

Returns the automatically detected + CpuTopology. The + emulator detects the CPU topology on some newer + Linux, Solaris, FreeBSD, and Windows systems. + On Windows system with more than 32 logical processors, + the CPU topology is not detected.

+

For more information, see argument + cpu_topology.

{cpu_topology, used} -

Returns the CpuTopology which is used by the - emulator. For more information see the - documentation of the - cpu_topology - argument. -

+

Returns CpuTopology used by the emulator. + For more information, see argument + cpu_topology.

+ @@ -6224,7 +6642,7 @@ ok - Information about the system + Information about the system.

Returns various information about the current system (emulator) as specified by Item:

@@ -6241,8 +6659,7 @@ ok Other possible return values are debug, purify, quantify, purecov, gcov, valgrind, gprof, and lcnt. Possible return values - may be added and/or removed at any time without prior notice. -

+ can be added or removed at any time without prior notice.

c_compiler_used @@ -6250,26 +6667,25 @@ ok compiling the runtime system. The first element is an atom describing the name of the compiler, or undefined if unknown. The second element is a term describing the - version of the compiler, or undefined if unknown. -

+ version of the compiler, or undefined if unknown.

check_io

Returns a list containing miscellaneous information - regarding the emulators internal I/O checking. Note, - the content of the returned list may vary between - platforms and over time. The only thing guaranteed is + about the emulators internal I/O checking. Notice that + the content of the returned list can vary between + platforms and over time. It is only guaranteed that a list is returned.

compat_rel

Returns the compatibility mode of the local node as an integer. The integer returned represents the - Erlang/OTP release which the current emulator has been + Erlang/OTP release that the current emulator has been set to be backward compatible with. The compatibility - mode can be configured at startup by using the command - line flag +R, see - erl(1).

+ mode can be configured at startup by using command-line flag + +R in + erl(1).

cpu_topology @@ -6282,19 +6698,19 @@ ok creation of a node is stored in process identifiers, port identifiers, and references. This makes it (to some extent) possible to distinguish between identifiers from - different incarnations of a node. Currently valid - creations are integers in the range 1..3, but this may - (probably will) change in the future. If the node is not - alive, 0 is returned.

+ different incarnations of a node. The valid + creations are integers in the range 1..3, but this will + probably change in a future release. If the node is not + alive, 0 is returned.

debug_compiled

Returns true if the emulator has been debug - compiled; otherwise, false. -

+ compiled, otherwise false.

- delayed_node_table_gc + delayed_node_table_gc +

Returns the amount of time in seconds that garbage collection of an entry in a node table will be delayed. This limit can be set on startup by passing the @@ -6302,124 +6718,130 @@ ok flag to erl. For more information see the documentation of the command line flag.

- dirty_cpu_schedulers + dirty_cpu_schedulers +

Returns the number of dirty CPU scheduler threads used by the emulator. Dirty CPU schedulers execute CPU-bound - native functions such as NIFs, linked-in driver code, and BIFs - that cannot be managed cleanly by the emulator's normal schedulers. -

-

The number of dirty CPU scheduler threads is determined at emulator - boot time and cannot be changed after that. The number of dirty CPU - scheduler threads online can however be changed at any time. The number of - dirty CPU schedulers can be set on startup by passing - the +SDcpu or - +SDPcpu command line flags, - see erl(1). -

-

Note that the dirty schedulers functionality is experimental, and - that you have to enable support for dirty schedulers when building OTP in - order to try out the functionality.

-

See also erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline), + native functions, such as NIFs, linked-in driver code, + and BIFs that cannot be managed cleanly by the normal + emulator schedulers.

+

The number of dirty CPU scheduler threads is determined + at emulator boot time and cannot be changed after that. + However, the number of dirty CPU scheduler threads online + can be changed at any time. The number of dirty CPU + schedulers can be set at startup by passing + command-line flag + +SDcpu or + +SDPcpu in + erl(1).

+

Notice that the dirty schedulers functionality is + experimental. Enable support for dirty schedulers when + building OTP to try out the functionality.

+

See also + erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline), erlang:system_info(dirty_cpu_schedulers_online), erlang:system_info(dirty_io_schedulers), erlang:system_info(schedulers), erlang:system_info(schedulers_online), and erlang:system_flag(schedulers_online, SchedulersOnline).

- dirty_cpu_schedulers_online - -

Returns the number of dirty CPU schedulers online. The return value - satisfies the following relationship: - , where N is - the lesser of the return values of erlang:system_info(dirty_cpu_schedulers) and - erlang:system_info(schedulers_online). -

-

The number of dirty CPU schedulers online can be set on startup by passing - the +SDcpu command line flag, see - erl(1). -

-

Note that the dirty schedulers functionality is experimental, and - that you have to enable support for dirty schedulers when building OTP in - order to try out the functionality.

+ dirty_cpu_schedulers_online + + +

Returns the number of dirty CPU schedulers online. + The return value satisfies + , + where N is the smallest of the return values of + erlang:system_info(dirty_cpu_schedulers) and + erlang:system_info(schedulers_online).

+

The number of dirty CPU schedulers online can be set at + startup by passing command-line flag + +SDcpu in + erl(1).

+

Notice that the dirty schedulers functionality is + experimental. Enable support for dirty schedulers when + building OTP to try out the functionality.

For more information, see erlang:system_info(dirty_cpu_schedulers), erlang:system_info(dirty_io_schedulers), erlang:system_info(schedulers_online), and - erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline). -

-
- dirty_io_schedulers - -

Returns the number of dirty I/O schedulers as an integer. Dirty I/O schedulers - execute I/O-bound native functions such as NIFs and linked-in driver code that - cannot be managed cleanly by the emulator's normal schedulers. -

-

This value can be set on startup by passing - the +SDio command line flag, see - erl(1). -

-

Note that the dirty schedulers functionality is experimental, and - that you have to enable support for dirty schedulers when building OTP in - order to try out the functionality.

+ erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline).

+
+ dirty_io_schedulers + + +

Returns the number of dirty I/O schedulers as an integer. + Dirty I/O schedulers execute I/O-bound native functions, + such as NIFs and linked-in driver code, which cannot be + managed cleanly by the normal emulator schedulers.

+

This value can be set at startup by passing command-line + argument +SDio + in erl(1).

+

Notice that the dirty schedulers functionality is + experimental. Enable support for dirty schedulers when + building OTP to try out the functionality.

For more information, see erlang:system_info(dirty_cpu_schedulers), erlang:system_info(dirty_cpu_schedulers_online), and - erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline). -

+ erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline).

dist

Returns a binary containing a string of distribution information formatted as in Erlang crash dumps. For more - information see the "How to interpret the Erlang crash dumps" - chapter in the ERTS User's Guide.

+ information, see Section + "How to interpret the Erlang crash dumps" + in the User's Guide.

- dist_buf_busy_limit + dist_buf_busy_limit +

Returns the value of the distribution buffer busy limit - in bytes. This limit can be set on startup by passing the - +zdbbl command line - flag to erl.

+ in bytes. This limit can be set at startup by passing + command-line flag + +zdbbl + to erl.

dist_ctrl

Returns a list of tuples - {Node, ControllingEntity}, one entry for each - connected remote node. The Node is the name of the - node and the ControllingEntity is the port or pid - responsible for the communication to that node. More - specifically, the ControllingEntity for nodes - connected via TCP/IP (the normal case) is the socket - actually used in communication with the specific node.

+ {Node, ControllingEntity}, + one entry for each connected remote node. + Node is the node name + and ControllingEntity is the port or process + identifier responsible for the communication to that node. + More specifically, ControllingEntity for + nodes connected through TCP/IP (the normal case) is the socket + used in communication with the specific node.

driver_version -

Returns a string containing the erlang driver version - used by the runtime system. It will be on the form +

Returns a string containing the Erlang driver version + used by the runtime system. It has the form "<major ver>.<minor ver>".

dynamic_trace

Returns an atom describing the dynamic trace framework - compiled into the virtual machine. It can currently be either - dtrace, systemtap or none. For a - commercial or standard build, this is always none, - the other return values indicate a custom configuration - (e.g. ./configure --with-dynamic-trace=dtrace). See - the dyntrace - manual page and the + compiled into the virtual machine. It can be + dtrace, systemtap, or none. For a + commercial or standard build, it is always none. + The other return values indicate a custom configuration + (for example, ./configure --with-dynamic-trace=dtrace). + For more information about dynamic tracing, see the + dyntrace + manual page and the README.dtrace/README.systemtap files in the - Erlang source code top directory for more information - about dynamic tracing.

+ Erlang source code top directory.

dynamic_trace_probes -

Returns a boolean() indicating if dynamic trace probes - (either dtrace or systemtap) are built into the - emulator. This can only be true if the virtual - machine was built for dynamic tracing - (i.e. system_info(dynamic_trace) returns +

Returns a boolean() indicating if dynamic trace + probes (dtrace or systemtap) are built into + the emulator. This can only be true if the Virtual + Machine was built for dynamic tracing (that is, + system_info(dynamic_trace) returns dtrace or systemtap).

end_time @@ -6433,8 +6855,8 @@ ok elib_malloc

This option will be removed in a future release. - The return value will always be false since - the elib_malloc allocator has been removed.

+ The return value will always be false, as the + elib_malloc allocator has been removed.

eager_check_io @@ -6448,27 +6870,28 @@ ok ets_limit -

Returns the maximum number of ETS tables allowed. This limit - can be increased on startup by passing the +e command line flag to - erl or by setting the environment variable - ERL_MAX_ETS_TABLES before starting the Erlang runtime - system.

+

Returns the maximum number of ETS tables allowed. This + limit can be increased at startup by passing + command-line flag + +e to + erl(1) or by setting environment variable + ERL_MAX_ETS_TABLES before starting the Erlang + runtime system.

fullsweep_after -

Returns {fullsweep_after, integer() >= 0} which is the - fullsweep_after garbage collection setting used - by default. For more information see - garbage_collection described below.

+

Returns {fullsweep_after, integer() >= 0}, which is + the fullsweep_after garbage collection setting used + by default. For more information, see + garbage_collection described in the following.

garbage_collection

Returns a list describing the default garbage collection settings. A process spawned on the local node by a - spawn or spawn_link will use these + spawn or spawn_link uses these garbage collection settings. The default settings can be - changed by use of + changed by using system_flag/2. spawn_opt/4 can spawn a process that does not use the default @@ -6482,8 +6905,8 @@ ok heap_type -

Returns the heap type used by the current emulator. - Currently only the following heap type exists:

+

Returns the heap type used by the current emulator. One + heap type exists:

private @@ -6498,51 +6921,51 @@ ok

Returns a binary containing a string of miscellaneous system information formatted as in Erlang crash dumps. - For more information see the - "How to interpret the Erlang crash dumps" chapter in the ERTS - User's Guide.

+ For more information, see Section + "How to interpret the Erlang crash dumps" + in the User's Guide.

kernel_poll

Returns true if the emulator uses some kind of - kernel-poll implementation; otherwise, false.

+ kernel-poll implementation, otherwise false.

loaded

Returns a binary containing a string of loaded module information formatted as in Erlang crash dumps. For more - information see the "How to interpret the Erlang crash dumps" chapter - in the ERTS User's Guide.

+ information, see Section + "How to interpret the Erlang crash dumps" + in the User's Guide.

- logical_processors + logical_processors +

Returns the detected number of logical processors configured - on the system. The return value is either an integer, or - the atom unknown if the emulator wasn't able to - detect logical processors configured. -

+ in the system. The return value is either an integer, or + the atom unknown if the emulator cannot + detect the configured logical processors.

- logical_processors_available + logical_processors_available -

Returns the detected number of logical processors available to - the Erlang runtime system. The return value is either an - integer, or the atom unknown if the emulator wasn't - able to detect logical processors available. The number - of logical processors available is less than or equal to - the number of logical - processors online. -

+ +

Returns the detected number of logical processors available + to the Erlang runtime system. The return value is either an + integer, or the atom unknown if the emulator + cannot detect the available logical processors. The number + of available logical processors is less than or equal to + the number of + logical processors online.

- logical_processors_online + logical_processors_online +

Returns the detected number of logical processors online on the system. The return value is either an integer, - or the atom unknown if the emulator wasn't able to + or the atom unknown if the emulator cannot detect logical processors online. The number of logical processors online is less than or equal to the number of - logical processors - configured. -

+ logical processors configured.

machine @@ -6550,27 +6973,30 @@ ok min_heap_size -

Returns {min_heap_size, MinHeapSize} where MinHeapSize is the current system wide - minimum heap size for spawned processes.

+

Returns {min_heap_size, MinHeapSize}, + where MinHeapSize is the current + system-wide minimum heap size for spawned processes.

min_bin_vheap_size -

Returns {min_bin_vheap_size, MinBinVHeapSize} where MinBinVHeapSize is the current system wide +

Returns {min_bin_vheap_size, + MinBinVHeapSize}, where + MinBinVHeapSize is the current system-wide minimum binary virtual heap size for spawned processes.

modified_timing_level -

Returns the modified timing level (an integer) if - modified timing has been enabled; otherwise, - undefined. See the +T command line flag - in the documentation of the - erl(1) - command for more information on modified timing.

+

Returns the modified timing-level (an integer) if + modified timing is enabled, otherwise, undefined. + For more information about modified timing, see + command-line flag + +T + in erl(1)

- multi_scheduling + multi_scheduling -

Returns disabled, blocked, or enabled. - A description of the return values:

+ +

Returns disabled, blocked, or enabled:

disabled @@ -6581,32 +7007,38 @@ ok blocked

The emulator has more than one scheduler thread, - but all scheduler threads but one have been blocked, - i.e., only one scheduler thread will schedule - Erlang processes and execute Erlang code.

+ but all scheduler threads except one are blocked, + that is, only one scheduler thread schedules + Erlang processes and executes Erlang code.

enabled

The emulator has more than one scheduler thread, - and no scheduler threads have been blocked, i.e., - all available scheduler threads will schedule + and no scheduler threads are blocked, that is, + all available scheduler threads schedule Erlang processes and execute Erlang code.

-

See also erlang:system_flag(multi_scheduling, BlockState), - erlang:system_info(multi_scheduling_blockers), and +

See also + erlang:system_flag(multi_scheduling, BlockState), + erlang:system_info(multi_scheduling_blockers), + and erlang:system_info(schedulers).

- multi_scheduling_blockers + multi_scheduling_blockers -

Returns a list of PIDs when multi-scheduling - is blocked; otherwise, the empty list. The PIDs - in the list is PIDs of the processes currently - blocking multi-scheduling. A PID will only be - present once in the list, even if the corresponding + +

Returns a list of Pids when + multi-scheduling is blocked, otherwise the empty list is + returned. The Pids in the list are + Pids of the processes currently + blocking multi-scheduling. A Pid is + present only once in the list, even if the corresponding process has blocked multiple times.

-

See also erlang:system_flag(multi_scheduling, BlockState), - erlang:system_info(multi_scheduling), and +

See also + erlang:system_flag(multi_scheduling, BlockState), + erlang:system_info(multi_scheduling), + and erlang:system_info(schedulers).

nif_version @@ -6614,19 +7046,19 @@ ok

Returns a string containing the erlang NIF version used by the runtime system. It will be on the form "<major ver>.<minor ver>".

- otp_release + otp_release +

Returns a string containing the OTP release number of the - OTP release that the currently executing ERTS application is + OTP release that the currently executing ERTS application is part of.

-

As of OTP release 17, the OTP release number corresponds to - the major OTP version number. There is no - erlang:system_info() argument giving the exact OTP - version. This since the exact OTP version in the general case - is hard to determine. For more information see - the - documentation of versions in the system principles - guide.

+

As from OTP 17, the OTP release number corresponds to + the major OTP version number. No + erlang:system_info() argument gives the exact OTP + version. This is because the exact OTP version in the general case + is difficult to determine. For more information, see the description + of versions in + System principles in System Documentation.

os_monotonic_time_source @@ -6745,130 +7177,137 @@ ok time unit.

- port_parallelism -

Returns the default port parallelism scheduling hint used. - For more information see the - +spp command line argument - of erl(1).

+ port_parallelism
+ + +

Returns the default port parallelism scheduling hint used. + For more information, see command-line argument + +spp in erl(1).

port_count -

Returns the number of ports currently existing at - the local node as an integer. The same value as - length(erlang:ports()) returns, but more efficient.

+

Returns the number of ports currently existing at the + local node. The value is given as an integer. This is + the same value as returned by + length(erlang:ports()), but more efficient.

- port_limit + port_limit +

Returns the maximum number of simultaneously existing - ports at the local node as an integer. This limit - can be configured at startup by using the - +Q - command line flag of - erl(1).

+ ports at the local node as an integer. This limit can be + configured at startup by using command-line flag + +Q in erl(1).

process_count -

Returns the number of processes currently existing at - the local node as an integer. The same value as - length(processes()) returns, but more efficient.

+

Returns the number of processes currently existing at the + local node. The value is given as an integer. This is + the same value as returned by + length(processes()), but more efficient.

- process_limit + process_limit +

Returns the maximum number of simultaneously existing - processes at the local node as an integer. This limit - can be configured at startup by using the - +P - command line flag of - erl(1).

+ processes at the local node. The value is given as an + integer. This limit can be configured at startup by using + command-line flag +P + in erl(1).

procs

Returns a binary containing a string of process and port information formatted as in Erlang crash dumps. For more - information see the "How to interpret the Erlang crash dumps" chapter - in the ERTS User's Guide.

+ information, see Section + "How to interpret the Erlang crash dumps" + in the User's Guide.

- scheduler_bind_type + scheduler_bind_type -

Returns information on how user has requested + +

Returns information about how the user has requested schedulers to be bound or not bound.

-

NOTE: Even though user has requested - schedulers to be bound, they might have silently failed - to bind. In order to inspect actual scheduler bindings call - erlang:system_info(scheduler_bindings). -

-

For more information, see - the erl +sbt - command line argument, and - erlang:system_info(scheduler_bindings). -

-
- scheduler_bindings - -

Returns information on currently used scheduler +

Notice that even though a user has requested + schedulers to be bound, they can silently have failed + to bind. To inspect the scheduler bindings, call + erlang:system_info(scheduler_bindings).

+

For more information, see command-line argument + +sbt + in erl(1) and + erlang:system_info(scheduler_bindings).

+
+ scheduler_bindings + + +

Returns information about the currently used scheduler bindings.

A tuple of a size equal to - erlang:system_info(schedulers) is returned. The elements of the tuple are integers + erlang:system_info(schedulers) + is returned. The tuple elements are integers or the atom unbound. Logical processor identifiers are represented as integers. The Nth element of the tuple equals the current binding for the scheduler with the scheduler identifier equal to - N. E.g., if the schedulers have been bound, + N. For example, if the schedulers are bound, element(erlang:system_info(scheduler_id), - erlang:system_info(scheduler_bindings)) will return + erlang:system_info(scheduler_bindings)) returns the identifier of the logical processor that the calling - process is executing on. -

-

Note that only schedulers online can be bound to logical + process is executing on.

+

Notice that only schedulers online can be bound to logical processors.

-

For more information, see - the erl +sbt - command line argument, +

For more information, see command-line argument + +sbt + in erl(1) and erlang:system_info(schedulers_online).

- scheduler_id + scheduler_id -

Returns the scheduler id (SchedulerId) of the + +

Returns the scheduler ID (SchedulerId) of the scheduler thread that the calling process is executing - on. SchedulerId is a positive integer; where - . See also + on. SchedulerId is a positive integer, + where + . + See also erlang:system_info(schedulers).

- schedulers + schedulers +

Returns the number of scheduler threads used by the emulator. Scheduler threads online schedules Erlang processes and Erlang ports, and execute Erlang code - and Erlang linked in driver code.

+ and Erlang linked-in driver code.

The number of scheduler threads is determined at - emulator boot time and cannot be changed after - that. The amount of schedulers online can - however be changed at any time.

-

See also erlang:system_flag(schedulers_online, SchedulersOnline), + emulator boot time and cannot be changed later. + However, the number of schedulers online can + be changed at any time.

+

See also + erlang:system_flag(schedulers_online, SchedulersOnline), erlang:system_info(schedulers_online), erlang:system_info(scheduler_id), erlang:system_flag(multi_scheduling, BlockState), - erlang:system_info(multi_scheduling), and - and erlang:system_info(multi_scheduling_blockers).

+ erlang:system_info(multi_scheduling), + and + erlang:system_info(multi_scheduling_blockers).

- schedulers_online + schedulers_online -

Returns the amount of schedulers online. The scheduler - identifiers of schedulers online satisfy the following - relationship: - . -

+ +

Returns the number of schedulers online. The scheduler + identifiers of schedulers online satisfy the relationship + .

For more information, see - erlang:system_info(schedulers), + erlang:system_info(schedulers) and - erlang:system_flag(schedulers_online, SchedulersOnline). -

- + erlang:system_flag(schedulers_online, SchedulersOnline).

+
smp_support

Returns true if the emulator has been compiled - with smp support; otherwise, false.

+ with SMP support, otherwise false is returned.

start_time

The Erlang monotonic @@ -6880,7 +7319,7 @@ ok system_version

Returns a string containing version number and - some important properties such as the number of schedulers.

+ some important properties, such as the number of schedulers.

system_architecture @@ -6890,23 +7329,28 @@ ok threads

Returns true if the emulator has been compiled - with thread support; otherwise, false is - returned.

+ with thread support, otherwise false is returned.

- thread_pool_size + thread_pool_size +

Returns the number of async threads in the async thread pool used for asynchronous driver calls - (driver_async()) - as an integer.

+ (driver_async()). + The value is given as an integer.

- time_correction -

Returns a boolean value indicating whether + + time_correction + + +

Returns a boolean value indicating whether time correction is enabled or not.

- time_offset -

Returns the state of the time offset:

+ time_offset + + +

Returns the state of the time offset:

preliminary

The time offset is preliminary, and will be changed @@ -6949,8 +7393,9 @@ ok time warp mode is being used.

- tolerant_timeofday + tolerant_timeofday +

Returns whether a pre erts-7.0 backwards compatible compensation for sudden changes of system time is enabled or disabled. Such compensation is enabled when the @@ -6961,89 +7406,91 @@ ok trace_control_word -

Returns the value of the node's trace control word. - For more information see documentation of the function - get_tcw in "Match Specifications in Erlang", - ERTS User's Guide.

+

Returns the value of the node trace control word. For + more information, see function get_tcw in Section + Match Specifications in Erlang in the User's Guide.

- update_cpu_info + update_cpu_info -

The runtime system rereads the CPU information available and - updates its internally stored information about the - detected CPU - topology and the amount of logical processors + +

The runtime system rereads the CPU information available + and updates its internally stored information about the + detected + CPU topology and the number of logical processors configured, online, and - available. - If the CPU information has changed since the last time it was read, - the atom changed is returned; otherwise, the atom - unchanged is returned. If the CPU information has changed + available.

+

If the CPU information has changed since the last time + it was read, the atom changed is returned, otherwise + the atom unchanged. If the CPU information has changed, you probably want to - adjust the amount - of schedulers online. You typically want to have as - many schedulers online as - logical processors - available. -

+ adjust the + number of schedulers online. You typically want + to have as many schedulers online as + logical + processors available.

- version + version +

Returns a string containing the version number of the emulator.

wordsize -

Same as {wordsize, internal}.

+

Same as {wordsize, internal}.

{wordsize, internal}

Returns the size of Erlang term words in bytes as an - integer, i.e. on a 32-bit architecture 4 is returned, - and on a pure 64-bit architecture 8 is returned. On a + integer, that is, 4 is returned on a 32-bit architecture, + and 8 is returned on a pure 64-bit architecture. On a halfword 64-bit emulator, 4 is returned, as the Erlang - terms are stored using a virtual wordsize of half the - system's wordsize.

+ terms are stored using a virtual word size of half the + system word size.

{wordsize, external} -

Returns the true wordsize of the emulator, i.e. the size - of a pointer, in bytes as an integer. On a pure 32-bit - architecture 4 is returned, on both a halfword and pure +

Returns the true word size of the emulator, that is, + the size of a pointer. The value is given in bytes + as an integer. On a pure 32-bit architecture, 4 is + returned. On both a half word and on a pure 64-bit architecture, 8 is returned.

-

The scheduler argument has changed name to - scheduler_id. This in order to avoid mixup with - the schedulers argument. The scheduler - argument was introduced in ERTS version 5.5 and renamed - in ERTS version 5.5.1.

+

Argument scheduler has changed name to + scheduler_id to avoid mix up with argument + schedulers. Argument scheduler was + introduced in ERTS 5.5 and renamed in + ERTS 5.5.1.

+ Current system performance monitoring settings. - Current system performance monitoring settings

Returns the current system monitoring settings set by erlang:system_monitor/2 - as {MonitorPid, Options}, or undefined if there - are no settings. The order of the options may be different + as {MonitorPid, Options}, + or undefined if there + are no settings. The order of the options can be different from the one that was set.

+ Sets or clears system performance monitoring options. - Set or clear system performance monitoring options -

When called with the argument undefined, all +

When called with argument undefined, all system performance monitoring settings are cleared.

-

Calling the function with {MonitorPid, Options} as - argument, is the same as calling +

Calling the function with {MonitorPid, + Options} as argument is the same as calling erlang:system_monitor(MonitorPid, Options).

Returns the previous system monitor settings just like erlang:system_monitor/0.

@@ -7052,102 +7499,101 @@ ok + Sets system performance monitoring options. - Set system performance monitoring options -

Sets system performance monitoring options. MonitorPid - is a local pid that will receive system monitor messages, and - the second argument is a list of monitoring options:

+

Sets the system performance monitoring options. + MonitorPid is a local process identifier (pid) + receiving system monitor messages. The + second argument is a list of monitoring options:

{long_gc, Time}

If a garbage collection in the system takes at least - Time wallclock milliseconds, a message + Time wall clock milliseconds, a message {monitor, GcPid, long_gc, Info} is sent to - MonitorPid. GcPid is the pid that was - garbage collected and Info is a list of two-element - tuples describing the result of the garbage collection. - One of the tuples is {timeout, GcTime} where - GcTime is the actual time for the garbage + MonitorPid. GcPid is the pid that + was garbage collected. Info is a list of two-element + tuples describing the result of the garbage collection.

+

One of the tuples is {timeout, GcTime}, where + GcTime is the time for the garbage collection in milliseconds. The other tuples are - tagged with heap_size, heap_block_size, - stack_size, mbuf_size, old_heap_size, - and old_heap_block_size. These tuples are - explained in the documentation of the - gc_start - trace message (see - erlang:trace/3). - New tuples may be added, and the order of the tuples in - the Info list may be changed at any time without prior - notice. -

+ tagged with heap_size, heap_block_size + stack_size, mbuf_size, old_heap_size, + and old_heap_block_size. These tuples are + explained in the description of trace message + gc_start (see + erlang:trace/3). + New tuples can be added, and the order of the tuples in + the Info list can be changed at any time without + prior notice.

{long_schedule, Time} -

If a process or port in the system runs uninterrupted +

If a process or port in the system runs uninterrupted for at least Time wall clock milliseconds, a message {monitor, PidOrPort, long_schedule, Info} is sent to MonitorPid. PidOrPort is the - process or port that was running and Info is a - list of two-element tuples describing the event. In case - of a pid(), the tuples {timeout, Millis}, - {in, Location} and {out, Location} will be + process or port that was running. Info is a + list of two-element tuples describing the event.

+

If a pid(), the tuples {timeout, Millis}, + {in, Location}, and {out, Location} are present, where Location is either an MFA ({Module, Function, Arity}) describing the function where the process was scheduled in/out, or the - atom undefined. In case of a port(), the + atom undefined.

+

If a port(), the tuples {timeout, Millis} and {port_op,Op} - will be present. Op will be one of proc_sig, + are present. Op is one of proc_sig, timeout, input, output, - event or dist_cmd, depending on which - driver callback was executing. proc_sig is an - internal operation and should never appear, while the + event, or dist_cmd, depending on which + driver callback was executing.

+

proc_sig is an + internal operation and is never to appear, while the others represent the corresponding driver callbacks timeout, ready_input, ready_output, - event and finally outputv (when the port - is used by distribution). The Millis value in - the timeout tuple will tell you the actual - uninterrupted execution time of the process or port, - which will always be >= the Time value - supplied when starting the trace. New tuples may be - added to the Info list in the future, and the - order of the tuples in the list may be changed at any - time without prior notice. -

-

This can be used to detect problems with NIF's or - drivers that take too long to execute. Generally, 1 ms - is considered a good maximum time for a driver callback - or a NIF. However, a time sharing system should usually - consider everything below 100 ms as "possible" and - fairly "normal". Schedule times above that might however - indicate swapping or a NIF/driver that is - misbehaving. Misbehaving NIF's and drivers could cause - bad resource utilization and bad overall performance of - the system.

+ event, and outputv (when the port + is used by distribution). Value Millis in + the timeout tuple informs about the + uninterrupted execution time of the process or port, which + always is equal to or higher than the Time value + supplied when starting the trace. New tuples can be + added to the Info list in a future release. The + order of the tuples in the list can be changed at any + time without prior notice.

+

This can be used to detect problems with NIFs or + drivers that take too long to execute. 1 ms is + considered a good maximum time for a driver callback + or a NIF. However, a time-sharing system is usually to + consider everything below 100 ms as "possible" and + fairly "normal". However, longer schedule times can + indicate swapping or a misbehaving NIF/driver. + Misbehaving NIFs and drivers can cause bad resource + use and bad overall system performance.

{large_heap, Size}

If a garbage collection in the system results in the allocated size of a heap being at least Size words, a message {monitor, GcPid, large_heap, Info} - is sent to MonitorPid. GcPid and Info - are the same as for long_gc above, except that - the tuple tagged with timeout is not present. - Note: As of erts version 5.6 the monitor message - is sent if the sum of the sizes of all memory blocks allocated - for all heap generations is equal to or larger than Size. - Previously the monitor message was sent if the memory block - allocated for the youngest generation was equal to or larger - than Size. -

+ is sent to MonitorPid. + GcPid and Info + are the same as for long_gc earlier, except that + the tuple tagged with timeout is not present.

+

As of ERTS 5.6, the monitor message is sent + if the sum of the sizes of all memory blocks allocated + for all heap generations is equal to or higher than Size. + Previously the monitor message was sent if the memory block + allocated for the youngest generation was equal to or higher + than Size.

busy_port

If a process in the system gets suspended because it sends to a busy port, a message {monitor, SusPid, busy_port, Port} is sent to - MonitorPid. SusPid is the pid that got - suspended when sending to Port.

+ MonitorPid. SusPid is the pid + that got suspended when sending to Port.

busy_dist_port @@ -7155,8 +7601,8 @@ ok sends to a process on a remote node whose inter-node communication was handled by a busy port, a message {monitor, SusPid, busy_dist_port, Port} is sent to - MonitorPid. SusPid is the pid that got - suspended when sending through the inter-node + MonitorPid. SusPid is the pid + that got suspended when sending through the inter-node communication port Port.

@@ -7165,74 +7611,77 @@ ok

If a monitoring process gets so large that it itself starts to cause system monitor messages when garbage - collecting, the messages will enlarge the process's + collecting, the messages enlarge the process message queue and probably make the problem worse.

Keep the monitoring process neat and do not set the system monitor limits too tight.

-

Failure: badarg if MonitorPid does not exist or is not a local process.

+

Failures:

+ + badarg + If MonitorPid does not exist. + badarg + If MonitorPid is not a local process. +
+ Current system profiling settings. - Current system profiling settings

Returns the current system profiling settings set by erlang:system_profile/2 - as {ProfilerPid, Options}, or undefined if there - are no settings. The order of the options may be different + as {ProfilerPid, Options}, + or undefined if there + are no settings. The order of the options can be different from the one that was set.

+ Current system profiling settings. - Current system profiling settings

Sets system profiler options. ProfilerPid - is a local pid or port that will receive profiling messages. The - receiver is excluded from all profiling. + is a local process identifier (pid) or port receiving profiling + messages. The receiver is excluded from all profiling. The second argument is a list of profiling options:

exclusive -

- If a synchronous call to a port from a process is done, the +

If a synchronous call to a port from a process is done, the calling process is considered not runnable during the call runtime to the port. The calling process is notified as - inactive and subsequently active when the port - callback returns. -

+ inactive, and later active when the port + callback returns.

runnable_procs -

If a process is put into or removed from the run queue a message, - {profile, Pid, State, Mfa, Ts}, is sent to - ProfilerPid. Running processes that is reinserted into the - run queue after having been preemptively scheduled out will not trigger this - message. -

+

If a process is put into or removed from the run queue, a + message, {profile, Pid, State, Mfa, Ts}, is sent to + ProfilerPid. Running processes that + are reinserted + into the run queue after having been pre-emptively + scheduled out do not trigger this message.

runnable_ports -

If a port is put into or removed from the run queue a message, - {profile, Port, State, 0, Ts}, is sent to - ProfilerPid. -

+

If a port is put into or removed from the run queue, a + message, {profile, Port, State, 0, Ts}, is sent to + ProfilerPid.

scheduler -

If a scheduler is put to sleep or awoken a message, - {profile, scheduler, Id, State, NoScheds, Ts}, is sent - to ProfilerPid. -

+

If a scheduler is put to sleep or awoken, a message, + {profile, scheduler, Id, State, NoScheds, Ts}, is + sent to ProfilerPid.

-

erlang:system_profile is considered experimental and - its behaviour may change in the future.

+

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

@@ -7276,11 +7725,12 @@ ok
- Encode a term to an Erlang external term format binary + Encodes a term to an Erlang external term format binary. -

Returns a binary data object which is the result of encoding - Term according to the Erlang external term format.

-

This can be used for a variety of purposes, for example +

Returns a binary data object that is the result of encoding + Term according to the Erlang external + term format.

+

This can be used for various purposes, for example, writing a term to a file in an efficient way, or sending an Erlang term to some type of communications channel not supported by distributed Erlang.

@@ -7288,67 +7738,81 @@ ok binary_to_term/1.

+ - Encode a term to en Erlang external term format binary - -

Returns a binary data object which is the result of encoding - Term according to the Erlang external term format.

-

If the option compressed is provided, the external - term format will be compressed. The compressed format is - automatically recognized by binary_to_term/1 in R7B and later.

-

It is also possible to specify a compression level by giving - the option {compressed, Level}, where Level is an - integer from 0 through 9. 0 means that no compression - will be done (it is the same as not giving any compressed option); - 1 will take the least time but may not compress as well as - the higher levels; 9 will take the most time and may produce - a smaller result. Note the "mays" in the preceding sentence; depending - on the input term, level 9 compression may or may not produce a smaller - result than level 1 compression.

-

Currently, compressed gives the same result as - {compressed, 6}.

-

The option {minor_version, Version} can be use to control - some details of the encoding. This option was - introduced in R11B-4. Currently, the allowed values for Version - are 0 and 1.

-

{minor_version, 1} is since 17.0 the default, it forces any floats in - the term to be encoded - in a more space-efficient and exact way (namely in the 64-bit IEEE format, - rather than converted to a textual representation). binary_to_term/1 - in R11B-4 and later is able decode this representation.

-

{minor_version, 0} meaning that floats - will be encoded using a textual representation; this option is useful if - you want to ensure that releases prior to R11B-4 can decode resulting + Encodes a term to en Erlang external term format binary. + +

Returns a binary data object that is the result of encoding + Term according to the Erlang external + term format.

+

If option compressed is provided, the external term + format is compressed. The compressed format is automatically + recognized by binary_to_term/1 as from Erlang R7B.

+

A compression level can be specified by giving option + {compressed, Level}. + Level is an integer + with range 0..9, where:

+ + 0 - No compression is done (it is the same as + giving no compressed option). + 1 - Takes least time but cannot compress, + as well as the higher levels. + 9 - Takes most time and can produce a smaller + result. Notice "can" in the preceding sentence; depending + on the input term, level 9 compression either does or does + not produce a smaller result than level 1 compression. + +

compressed and {compressed, 6} give the same + result.

+

Option {minor_version, Version} + can be used to control + some encoding details. This option was introduced in OTP R11B-4. + The valid values for Version are + 0 and 1.

+

As from OTP 17.0, {minor_version, 1} is the default. It + forces any floats in the term to be encoded in a more + space-efficient and exact way (namely in the 64-bit IEEE format, + rather than converted to a textual representation).

+

As from OTP R11B-4, binary_to_term/1 can decode this + representation.

+

{minor_version, 0} means that floats are encoded + using a textual representation. This option is useful to + ensure that releases before OTP R11B-4 can decode resulting binary.

See also binary_to_term/1.

+ - Throw an exception + Throws an exception.

A non-local return from a function. If evaluated within a - catch, catch will return the value Any.

+ catch, catch returns value Any.

+

Example:

 > catch throw({hello, there}).
 {hello,there}

Failure: nocatch if not evaluated within a catch.

+ - Current time + Current time.

Returns the current time as {Hour, Minute, Second}.

-

The time zone and daylight saving time correction depend on +

The time zone and Daylight Saving Time correction depend on the underlying OS.

+

Example:

 > time().
 {9,42,44}
+ Current time offset @@ -7433,147 +7897,150 @@ timestamp() -> - Tail of a list + Tail of a list. -

Returns the tail of List, that is, the list minus - the first element.

+

Returns the tail of List, that is, + the list minus the first element, for example:

 > tl([geesties, guilies, beasties]).
 [guilies, beasties]

Allowed in guard tests.

-

Failure: badarg if List is the empty list [].

+

Failure: badarg if List + is the empty list [].

+ + Sets trace flags for a process or processes. - Set trace flags for a process or processes

Turns on (if How == true) or off (if - How == false) the trace flags in FlagList for - the process or processes represented by PidSpec.

-

PidSpec is either a pid for a local process, or one of - the following atoms:

+ How == false) the trace flags in + FlagList for + the process or processes represented by + PidSpec.

+

PidSpec is either a process identifier + (pid) for a local process, or one of the following atoms:

existing -

All processes currently existing.

+

All currently existing processes.

new -

All processes that will be created in the future.

+

All processes that are created in the future.

all

All currently existing processes and all processes that - will be created in the future.

+ are created in the future.

-

FlagList can contain any number of the following - flags (the "message tags" refers to the list of messages - following below):

+

FlagList can contain any number of the + following flags (the "message tags" refers to the list of the + following messages):

all -

Set all trace flags except {tracer, Tracer} and - cpu_timestamp that are in their nature different +

Sets all trace flags except {tracer, Tracer} and + cpu_timestamp, which are in their nature different than the others.

send -

Trace sending of messages.

-

Message tags: send, +

Traces sending of messages.

+

Message tags: send and send_to_non_existing_process.

'receive' -

Trace receiving of messages.

+

Traces receiving of messages.

Message tags: 'receive'.

procs -

Trace process related events.

+

Traces process-related events.

Message tags: spawn, exit, register, unregister, link, - unlink, getting_linked, + unlink, getting_linked, and getting_unlinked.

call -

Trace certain function calls. Specify which function +

Traces certain function calls. Specify which function calls to trace by calling erlang:trace_pattern/3.

-

Message tags: call, return_from.

+

Message tags: call and return_from.

silent -

Used in conjunction with the call trace flag. - The call, return_from and return_to - trace messages are inhibited if this flag is set, - but if there are match specs they are executed as normal.

+

Used with the call trace flag. + The call, return_from, and return_to + trace messages are inhibited if this flag is set, but they + are executed as normal if there are match specifications.

Silent mode is inhibited by executing erlang:trace(_, false, [silent|_]), - or by a match spec executing the {silent, false} - function.

+ or by a match specification executing the function + {silent, false}.

The silent trace flag facilitates setting up a trace on many or even all processes in the system. - Then the interesting trace can be activated and - deactivated using the {silent,Bool} - match spec function, giving a high degree - of control of which functions with which - arguments that triggers the trace.

-

Message tags: call, return_from, + The trace is activated and deactivated using the match + specification function {silent,Bool}, giving + a high degree of control of which functions with which + arguments that trigger the trace.

+

Message tags: call, return_from, and return_to. Or rather, the absence of.

return_to -

Used in conjunction with the call trace flag. - Trace the actual return from a traced function back to +

Used with the call trace flag. + Traces the return from a traced function back to its caller. Only works for functions traced with - the local option to + option local to erlang:trace_pattern/3.

The semantics is that a trace message is sent when a - call traced function actually returns, that is, when a - chain of tail recursive calls is ended. There will be - only one trace message sent per chain of tail recursive - calls, why the properties of tail recursiveness for + call traced function returns, that is, when a + chain of tail recursive calls ends. Only one trace + message is sent per chain of tail recursive calls, + so the properties of tail recursiveness for function calls are kept while tracing with this flag. Using call and return_to trace together makes it possible to know exactly in which function a process executes at any time.

To get trace messages containing return values from - functions, use the {return_trace} match_spec - action instead.

+ functions, use the {return_trace} match + specification action instead.

Message tags: return_to.

running -

Trace scheduling of processes.

-

Message tags: in, and out.

+

Traces scheduling of processes.

+

Message tags: in and out.

exiting -

Trace scheduling of an exiting processes.

+

Traces scheduling of exiting processes.

Message tags: in_exiting, out_exiting, and out_exited.

garbage_collection -

Trace garbage collections of processes.

-

Message tags: gc_start, gc_end.

+

Traces garbage collections of processes.

+

Message tags: gc_start and gc_end.

timestamp -

Include a time stamp in all trace messages. The time - stamp (Ts) is of the same form as returned by +

Includes a time-stamp in all trace messages. The + time-stamp (Ts) has the same form as returned by erlang:now().

cpu_timestamp

A global trace flag for the Erlang node that makes all - trace timestamps be in CPU time, not wallclock. It is - only allowed with PidSpec==all. If the host - machine operating system does not support high resolution + trace time-stamps to be in CPU time, not wall clock time. + Only allowed with PidSpec==all. If the host + machine OS does not support high-resolution CPU time measurements, trace/3 exits with badarg. Note that most operating systems do not synchronize this value across cores, so be prepared @@ -7581,38 +8048,39 @@ timestamp() -> arity -

Used in conjunction with the call trace flag. - {M, F, Arity} will be specified instead of +

Used with the call trace flag. + {M, F, Arity} is specified instead of {M, F, Args} in call trace messages.

set_on_spawn

Makes any process created by a traced process inherit - its trace flags, including the set_on_spawn flag.

+ its trace flags, including flag set_on_spawn.

set_on_first_spawn

Makes the first process created by a traced process - inherit its trace flags, excluding - the set_on_first_spawn flag.

+ inherit its trace flags, excluding flag + set_on_first_spawn.

set_on_link

Makes any process linked by a traced process inherit its - trace flags, including the set_on_link flag.

+ trace flags, including flag set_on_link.

set_on_first_link

Makes the first process linked to by a traced process - inherit its trace flags, excluding - the set_on_first_link flag.

+ inherit its trace flags, excluding flag + set_on_first_link.

{tracer, Tracer} -

Specify where to send the trace messages. Tracer - must be the pid of a local process or the port identifier +

Specifies where to send the trace messages. Tracer + must be the process identifier of a local process + or the port identifier of a local port. If this flag is not given, trace - messages will be sent to the process that called + messages are sent to the process that called erlang:trace/3.

@@ -7620,27 +8088,28 @@ timestamp() -> set_on_link is the same as having set_on_first_link alone. Likewise for set_on_spawn and set_on_first_spawn.

-

If the timestamp flag is not given, the tracing - process will receive the trace messages described below. - Pid is the pid of the traced process in which - the traced event has occurred. The third element of the tuple +

If flag timestamp is not given, the tracing + process receives the trace messages described in the + following. 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 the timestamp flag is given, the first element of - the tuple will be trace_ts instead and the timestamp +

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

{trace, Pid, 'receive', Msg} -

When Pid receives the message Msg.

+

When Pid receives message Msg.

{trace, Pid, send, Msg, To} -

When Pid sends the message Msg to - the process To.

+

When Pid sends message Msg to + process To.

{trace, Pid, send_to_non_existing_process, Msg, To} -

When Pid sends the message Msg to +

When Pid sends message Msg to the non-existing process To.

{trace, Pid, call, {M, F, Args}} @@ -7648,7 +8117,7 @@ timestamp() ->

When Pid calls a traced function. The return values of calls are never supplied, only the call and its arguments.

-

Note that the trace flag arity can be used to +

Trace flag arity can be used to change the contents of this message, so that Arity is specified instead of Args.

@@ -7656,35 +8125,34 @@ timestamp() ->

When Pid returns to the specified function. This trace message is sent if both - the call and the return_to flags are set, + the flags call and return_to are set, and the function is set to be traced on local function calls. The message is only sent when returning - from a chain of tail recursive function calls where at + from a chain of tail recursive function calls, where at least one call generated a call trace message - (that is, the functions match specification matched and + (that is, the functions match specification matched, and {message, false} was not an action).

{trace, Pid, return_from, {M, F, Arity}, ReturnValue}

When Pid returns from the specified - function. This trace message is sent if the call - flag is set, and the function has a match specification + function. This trace message is sent if flag call + is set, and the function has a match specification with a return_trace or exception_trace action.

{trace, Pid, exception_from, {M, F, Arity}, {Class, Value}}

When Pid exits from the specified - function due to an exception. This trace message is sent - if the call flag is set, and the function has + function because of an exception. This trace message is + sent if flag call is set, and the function has a match specification with an exception_trace action.

{trace, Pid, spawn, Pid2, {M, F, Args}}

When Pid spawns a new process Pid2 with the specified function call as entry point.

-

Note that Args is supposed to be the argument - list, but may be any term in the case of an erroneous - spawn.

+

Args is supposed to be the argument list, + but can be any term if the spawn is erroneous.

{trace, Pid, exit, Reason} @@ -7714,148 +8182,159 @@ timestamp() -> {trace, Pid, unregister, RegName}

When Pid gets the name RegName unregistered. - Note that this is done automatically when a registered + This is done automatically when a registered process exits.

{trace, Pid, in, {M, F, Arity} | 0} -

When Pid is scheduled to run. The process will - run in function {M, F, Arity}. On some rare - occasions the current function cannot be determined, then - the last element Arity is 0.

+

When Pid is scheduled to run. The process + runs in function {M, F, Arity}. On some rare + occasions, the current function cannot be determined, + then the last element Arity is 0.

{trace, Pid, out, {M, F, Arity} | 0}

When Pid is scheduled out. The process was - running in function {M, F, Arity}. On some rare occasions + running in function {M, F, Arity}. On some rare occasions, the current function cannot be determined, then the last - element Arity is 0.

+ element Arity is 0.

- {trace, Pid, gc_start, Info} + {trace, Pid, gc_start, Info} +

Sent when garbage collection is about to be started. Info is a list of two-element tuples, where the first element is a key, and the second is the value. - You should not depend on the tuples have any defined - order. Currently, the following keys are defined:

+ Do not depend on any order of the tuples. + The following keys are defined:

heap_size The size of the used part of the heap. heap_block_size The size of the memory block used for storing - the heap and the stack. + the heap and the stack.
old_heap_size The size of the used part of the old heap. old_heap_block_size The size of the memory block used for storing - the old heap. + the old heap.
stack_size - The actual size of the stack. + The size of the stack. recent_size The size of the data that survived the previous garbage - collection. + collection.
mbuf_size The combined size of message buffers associated with - the process. - + the process. bin_vheap_size - The total size of unique off-heap binaries referenced from the process heap. + The total size of unique off-heap binaries referenced + from the process heap. bin_vheap_block_size - The total size of binaries, in words, allowed in the virtual - heap in the process before doing a garbage collection. + The total size of binaries allowed in the virtual + heap in the process before doing a garbage collection. bin_old_vheap_size - The total size of unique off-heap binaries referenced from the process old heap. + The total size of unique off-heap binaries referenced + from the process old heap. bin_vheap_block_size - The total size of binaries, in words, allowed in the virtual - old heap in the process before doing a garbage collection. - - + The total size of binaries allowed in the virtual + old heap in the process before doing a garbage collection.

All sizes are in words.

{trace, Pid, gc_end, Info}

Sent when garbage collection is finished. Info - contains the same kind of list as in the gc_start - message, but the sizes reflect the new sizes after + contains the same kind of list as in message gc_start, + but the sizes reflect the new sizes after garbage collection.

-

If the tracing process dies, the flags will be silently +

If the tracing process dies, the flags are silently removed.

-

Only one process can trace a particular process. For this - reason, attempts to trace an already traced process will fail.

+

Only one process can trace a particular process. Therefore, + attempts to trace an already traced process fail.

Returns: A number indicating the number of processes that - matched PidSpec. If PidSpec is a pid, - the return value will be 1. If PidSpec is - all or existing the return value will be + matched PidSpec. + If PidSpec is a process + identifier, the return value is 1. + If PidSpec + is all or existing, the return value is the number of processes running, excluding tracer processes. - If PidSpec is new, the return value will be + If PidSpec is new, the return value is 0.

-

Failure: If specified arguments are not supported. For - example cpu_timestamp is not supported on all - platforms.

+

Failure: badarg if the specified arguments are + not supported. For example, cpu_timestamp is not + supported on all platforms.

+ - Notification when trace has been delivered + Notification when trace has been delivered.

The delivery of trace messages is dislocated on the time-line - compared to other events in the system. If you know that the - Tracee has passed some specific point in its execution, + compared to other events in the system. If you know that + Tracee has passed some specific point + in its execution, and you want to know when at least all trace messages - corresponding to events up to this point have reached the tracer - you can use erlang:trace_delivered(Tracee). A + corresponding to events up to this point have reached the + tracer, use erlang:trace_delivered(Tracee). A {trace_delivered, Tracee, Ref} message is sent to the caller of erlang:trace_delivered(Tracee) when it - is guaranteed that all trace messages have been delivered to - the tracer up to the point that the Tracee had reached + is guaranteed that all trace messages are delivered to + the tracer up to the point that Tracee reached at the time of the call to erlang:trace_delivered(Tracee).

-

Note that the trace_delivered message does not - imply that trace messages have been delivered; instead, it implies - that all trace messages that should be delivered have - been delivered. It is not an error if Tracee isn't, and - hasn't been traced by someone, but if this is the case, - no trace messages will have been delivered when the +

Notice that message trace_delivered does not + imply that trace messages have been delivered. + Instead it implies that all trace messages that + are to be delivered have been delivered. + It is not an error if Tracee is not, and + has not been traced by someone, but if this is the case, + no trace messages have been delivered when the trace_delivered message arrives.

-

Note that Tracee has to refer to a process currently, +

Notice that that Tracee must refer + to a process currently, or previously existing on the same node as the caller of erlang:trace_delivered(Tracee) resides on. - The special Tracee atom all denotes all processes + The special Tracee atom all + denotes all processes that currently are traced in the node.

-

An example: Process A is Tracee, port B is +

Example: Process A is Tracee, + port B is tracer, and process C is the port owner of B. C wants to close B when A exits. C - can ensure that the trace isn't truncated by calling - erlang:trace_delivered(A) when A exits and wait - for the {trace_delivered, A, Ref} message before closing - B.

-

Failure: badarg if Tracee does not refer to a + can ensure that the trace is not truncated by calling + erlang:trace_delivered(A) when A exits and waits + for message {trace_delivered, A, Ref} + before closing B.

+

Failure: badarg if Tracee + does not refer to a process (dead or alive) on the same node as the caller of erlang:trace_delivered(Tracee) resides on.

+ + Traces information about a process or function. - Trace information about a process or function

Returns trace information about a process or function.

-

To get information about a process, PidOrFunc should - be a pid or the atom new. The atom new means - that the default trace state for processes to be created will - be returned. Item must have one of the following - values:

+

To get information about a process, + PidOrFunc is to + be a process identifier (pid) or the atom new. + The atom new means that the default trace state for + processes to be created is returned.

+

The following Items are valid:

flags -

Return a list of atoms indicating what kind of traces is - enabled for the process. The list will be empty if no +

Returns a list of atoms indicating what kind of traces is + enabled for the process. The list is empty if no traces are enabled, and one or more of the followings atoms if traces are enabled: send, 'receive', set_on_spawn, call, @@ -7866,129 +8345,132 @@ timestamp() -> tracer -

Return the identifier for process or port tracing this +

Returns the identifier for process or port tracing this process. If this process is not being traced, the return - value will be [].

+ value is [].

-

To get information about a function, PidOrFunc should - be a three-element tuple: {Module, Function, Arity} or +

To get information about a function, PidOrFunc is to + be the three-element tuple {Module, Function, Arity} or the atom on_load. No wildcards are allowed. Returns - undefined if the function does not exist or - false if the function is not traced at all. Item - must have one of the following values:

+ undefined if the function does not exist, or + false if the function is not traced.

+

The following Items are valid::

traced -

Return global if this function is traced on +

Returns global if this function is traced on global function calls, local if this function is - traced on local function calls (i.e local and global - function calls), and false if neither local nor - global function calls are traced.

+ traced on local function calls (that is, local and global + function calls), and false if local or + global function calls are not traced.

match_spec -

Return the match specification for this function, if it +

Returns the match specification for this function, if it has one. If the function is locally or globally traced but has no match specification defined, the returned value is [].

meta -

Return the meta trace tracer process or port for this - function, if it has one. If the function is not meta - traced the returned value is false, and if - the function is meta traced but has once detected that - the tracer proc is invalid, the returned value is [].

+

Returns the meta-trace tracer process or port for this + function, if it has one. If the function is not + meta-traced, the returned value is false. If + the function is meta-traced but has once detected that + the tracer process is invalid, the returned value is [].

meta_match_spec -

Return the meta trace match specification for this - function, if it has one. If the function is meta traced +

Returns the meta-trace match specification for this + function, if it has one. If the function is meta-traced but has no match specification defined, the returned value is [].

call_count -

Return the call count value for this function or +

Returns the call count value for this function or true for the pseudo function on_load if call - count tracing is active. Return false otherwise. + count tracing is active. Otherwise false is returned. See also erlang:trace_pattern/3.

call_time -

Return the call time values for this function or +

Returns the call time values for this function or true for the pseudo function on_load if call - time tracing is active. Returns false otherwise. + time tracing is active. Otherwise false is returned. The call time values returned, [{Pid, Count, S, Us}], - is a list of each process that has executed the function and its specific counters. - See also + is a list of each process that executed the function + and its specific counters. See also erlang:trace_pattern/3.

all -

Return a list containing the {Item, Value} tuples - for all other items, or return false if no tracing +

Returns a list containing the + {Item, Value} tuples + for all other items, or returns false if no tracing is active for this function.

-

The actual return value will be {Item, Value}, where - Value is the requested information as described above. +

The return value is {Item, Value}, where + Value is the requested information as described earlier. If a pid for a dead process was given, or the name of a - non-existing function, Value will be undefined.

-

If PidOrFunc is the on_load, the information + non-existing function, Value is undefined.

+

If PidOrFunc is on_load, the information returned refers to the default value for code that will be loaded.

+ + Sets trace patterns for global call tracing. - Set trace patterns for global call tracing

The same as erlang:trace_pattern(MFA, MatchSpec, []), retained for backward compatibility.

+ + Sets trace patterns for tracing of function calls. - Set trace patterns for tracing of function calls -

This BIF is used to enable or disable call tracing for - exported functions. It must be combined with +

Enables or disables call tracing for + exported functions. Must be combined with erlang:trace/3 to set the call trace flag for one or more processes.

-

Conceptually, call tracing works like this: Inside - the Erlang virtual machine there is a set of processes to be - traced and a set of functions to be traced. Tracing will be +

Conceptually, call tracing works as follows. Inside + the Erlang Virtual Machine, a set of processes and + a set of functions are to be traced. Tracing is enabled on the intersection of the set. That is, if a process included in the traced process set calls a function included - in the traced function set, the trace action will be taken. - Otherwise, nothing will happen.

-

Use - erlang:trace/3 to - add or remove one or more processes to the set of traced - processes. Use erlang:trace_pattern/2 to add or remove - exported functions to the set of traced functions.

-

The erlang:trace_pattern/3 BIF can also add match + in the traced function set, the trace action is taken. + Otherwise, nothing happens.

+

To add or remove one or more processes to the set of traced + processes, use + erlang:trace/3.

+

To add or remove exported functions to the set of traced + functions, use erlang:trace_pattern/2.

+

The BIF erlang:trace_pattern/3 can also add match specifications to an exported function. A match specification - comprises a pattern that the arguments to the function must - match, a guard expression which must evaluate to true + comprises a pattern that the function arguments must + match, a guard expression that must evaluate to true, and an action to be performed. The default action is to send a trace message. If the pattern does not match or the guard - fails, the action will not be executed.

-

The MFA argument should be a tuple like - {Module, Function, Arity} or the atom on_load - (described below). It can be the module, function, and arity - for an exported function (or a BIF in any module). - The '_' atom can be used to mean any of that kind. + fails, the action is not executed.

+

Argument MFA is to be a tuple, such as + {Module, Function, Arity}, or the atom on_load + (described in the following). It can be the module, function, + and arity for an exported function (or a BIF in any module). + The atom '_' can be used to mean any of that kinds. Wildcards can be used in any of the following ways:

{Module,Function,'_'} @@ -8006,197 +8488,213 @@ timestamp() ->

Other combinations, such as {Module,'_',Arity}, are - not allowed. Local functions will match wildcards only if - the local option is in the FlagList.

-

If the MFA argument is the atom on_load, - the match specification and flag list will be used on all + not allowed. Local functions match wildcards only if + option local is in FlagList.

+

If argument MFA is the atom on_load, + the match specification and flag list are used on all modules that are newly loaded.

-

The MatchSpec argument can take any of the following - forms:

+

Argument MatchSpec can take the + following forms:

false -

Disable tracing for the matching function(s). Any match - specification will be removed.

+

Disables tracing for the matching function or functions. + Any match specification is removed.

true -

Enable tracing for the matching function(s).

+

Enables tracing for the matching function or functions.

MatchSpecList

A list of match specifications. An empty list is - equivalent to true. See the ERTS User's Guide - for a description of match specifications.

+ equivalent to true. For a description of match + specifications, see the User's Guide.

restart -

For the FlagList option call_count and call_time: - restart the existing counters. The behaviour is undefined +

For the FlagList options call_count + and call_time: restarts + the existing counters. The behavior is undefined for other FlagList options.

pause -

For the FlagList option call_count and call_time: pause - the existing counters. The behaviour is undefined for - other FlagList options.

+

For the FlagList options + call_count and call_time: pauses + the existing counters. The behavior is undefined for + other FlagList options.

-

The FlagList parameter is a list of options. - The following options are allowed:

+

Parameter FlagList is a list of options. + The following are the valid options:

global -

Turn on or off call tracing for global function calls +

Turns on or off call tracing for global function calls (that is, calls specifying the module explicitly). Only - exported functions will match and only global calls will + exported functions match and only global calls generate trace messages. This is the default.

local -

Turn on or off call tracing for all types of function - calls. Trace messages will be sent whenever any of +

Turns on or off call tracing for all types of function + calls. Trace messages are sent whenever any of the specified functions are called, regardless of how they - are called. If the return_to flag is set for - the process, a return_to message will also be sent + are called. If flag return_to is set for + the process, a return_to message is also sent when this function returns to its caller.

meta | {meta, Pid} -

Turn on or off meta tracing for all types of function - calls. Trace messages will be sent to the tracer process +

Turns on or off meta-tracing for all types of function + calls. Trace messages are sent to the tracer process or port Pid whenever any of the specified functions are called, regardless of how they are called. - If no Pid is specified, self() is used as a - default tracer process.

-

Meta tracing traces all processes and does not care + If no Pid is specified, + self() is used as a default tracer process.

+

Meta-tracing traces all processes and does not care about the process trace flags set by trace/3, the trace flags are instead fixed to [call, timestamp].

-

The match spec function {return_trace} works with - meta trace and send its trace message to the same tracer - process.

+

The match specification function {return_trace} + works with meta-trace and sends its trace message to the + same tracer process.

call_count

Starts (MatchSpec == true) or stops - (MatchSpec == false) call count tracing for all - types of function calls. For every function a counter is + (MatchSpec == false) + call count tracing for all + types of function calls. For every function, a counter is incremented when the function is called, in any process. No process trace flags need to be activated.

If call count tracing is started while already running, - the count is restarted from zero. Running counters can be - paused with MatchSpec == pause. Paused and running - counters can be restarted from zero with + the count is restarted from zero. To pause running + counters, use MatchSpec == pause. + Paused and running counters can be restarted from zero with MatchSpec == restart.

-

The counter value can be read with +

To read the counter value, use erlang:trace_info/2.

call_time

Starts (MatchSpec == true) or stops - (MatchSpec == false) call time tracing for all - types of function calls. For every function a counter is - incremented when the function is called. Time spent in the function - is accumulated in two other counters, seconds and micro-seconds. + (MatchSpec == false) call time + tracing for all + types of function calls. For every function, a counter is + incremented when the function is called. + Time spent in the function is accumulated in + two other counters, seconds and microseconds. The counters are stored for each call traced process.

If call time tracing is started while already running, - the count and time is restarted from zero. Running counters can be - paused with MatchSpec == pause. Paused and running - counters can be restarted from zero with + the count and time is restarted from zero. To pause + running counters, use MatchSpec == pause. + Paused and running counters can be restarted from zero with MatchSpec == restart.

-

The counter value can be read with +

To read the counter value, use erlang:trace_info/2.

-
-

The global and local options are mutually - exclusive and global is the default (if no options are - specified). The call_count and meta options - perform a kind of local tracing, and can also not be combined - with global. A function can be either globally or +

The options global and local are mutually + exclusive, and global is the default (if no options are + specified). The options call_count and meta + perform a kind of local tracing, and cannot be combined + with global. A function can be globally or locally traced. If global tracing is specified for a - specified set of functions; local, meta, call time and call count - tracing for the matching set of local functions will be - disabled, and vice versa.

+ set of functions, then local, meta, call time, and call count + tracing for the matching set of local functions is + disabled, and conversely.

When disabling trace, the option must match the type of trace - that is set on the function, so that local tracing must be - disabled with the local option and global tracing with - the global option (or no option at all), and so forth.

-

There is no way to directly change part of a match - specification list. If a function has a match specification, - you can replace it with a completely new one. If you need to - change an existing match specification, use the + set on the function. That is, local tracing must be + disabled with option local and global tracing with + option global (or no option), and so forth.

+

Part of a match specification list cannot be changed directly. + If a function has a match specification, it can be replaced + with a new one. To change an existing match specification, + use the BIF erlang:trace_info/2 - BIF to retrieve the existing match specification.

-

Returns the number of exported functions that matched - the MFA argument. This will be zero if none matched at - all.

+ to retrieve the existing match specification.

+

Returns the number of exported functions matching + argument MFA. This is zero if none matched.

+ - Return an integer by the truncating a number + Returns an integer by truncating a number -

Returns an integer by the truncating Number.

+

Returns an integer by truncating Number, + for example:

 > trunc(5.5).
 5

Allowed in guard tests.

+ - Return the size of a tuple + Returns the size of a tuple. -

Returns an integer which is the number of elements in Tuple.

+

Returns an integer that is the number of elements in + Tuple, for example:

 > tuple_size({morni, mulle, bwange}).
 3

Allowed in guard tests.

+ - Convert a tuple to a list + Converts a tuple to a list. -

Returns a list which corresponds to Tuple. - Tuple may contain any Erlang terms.

+

Returns a list corresponding to Tuple. + Tuple can contain any Erlang terms.

+

Example:

 > tuple_to_list({share, {'Ericsson_B', 163}}).
 [share,{'Ericsson_B',163}]
+ - Current date and time according to Universal Time Coordinated (UTC) + Current date and time according to Universal Time Coordinated (UTC).

Returns the current date and time according to Universal - Time Coordinated (UTC), also called GMT, in the form + Time Coordinated (UTC) in the form {{Year, Month, Day}, {Hour, Minute, Second}} if - supported by the underlying operating system. If not, - erlang:universaltime() is equivalent to + supported by the underlying OS. + Otherwise erlang:universaltime() is equivalent to erlang:localtime().

+

Example:

 > erlang:universaltime().
 {{1996,11,6},{14,18,43}}
+ - Convert from Universal Time Coordinated (UTC) to local date and time + Converts from Universal Time Coordinated (UTC) to local date and time.

Converts Universal Time Coordinated (UTC) date and time to - local date and time, if this is supported by the underlying - OS. Otherwise, no conversion is done, and + local date and time in the form + {{Year, Month, Day}, {Hour, Minute, Second}} if + supported by the underlying OS. + Otherwise no conversion is done, and Universaltime is returned.

+

Example:

 > erlang:universaltime_to_localtime({{1996,11,6},{14,18,43}}).
 {{1996,11,7},{15,18,43}}
-

Failure: badarg if Universaltime does not denote - a valid date and time.

+

Failure: badarg if Universaltime denotes + an invalid date and time.

+ Get a unique integer value @@ -8293,25 +8791,30 @@ timestamp() -> - Remove a link, if there is one, to another process or port + Removes a link, if there is one, to another process or port.

Removes the link, if there is one, between the calling - process and the process or port referred to by Id.

+ process and the process or port referred to by + Id.

Returns true and does not fail, even if there is no - link to Id, or if Id does not exist.

-

Once unlink(Id) has returned it is guaranteed that + link to Id, or if Id + does not exist.

+

Once unlink(Id) has returned, + it is guaranteed that the link between the caller and the entity referred to by - Id has no effect on the caller in the future (unless - the link is setup again). If caller is trapping exits, an - {'EXIT', Id, _} message due to the link might have - been placed in the caller's message queue prior to the call, - though. Note, the {'EXIT', Id, _} message can be the - result of the link, but can also be the result of Id - calling exit/2. Therefore, it may be - appropriate to cleanup the message queue when trapping exits - after the call to unlink(Id), as follow:

+ Id has no effect on the caller + in the future (unless + the link is setup again). If the caller is trapping exits, an + {'EXIT', Id, _} + message is received, as the link can have + been placed in the caller's message queue before the call.

+

Notice that the {'EXIT', Id, _} + message can be the + result of the link, but can also be the result of Id + calling exit/2. Therefore, it can be + appropriate to clean up the message queue when trapping exits + after the call to unlink(Id), as follows:

- unlink(Id), receive {'EXIT', Id, _} -> @@ -8320,23 +8823,25 @@ timestamp() -> true end -

Prior to OTP release R11B (erts version 5.5) unlink/1 - behaved completely asynchronous, i.e., the link was active +

Before OTP R11B (ERTS 5.5) unlink/1 + behaved asynchronous, that is, the link was active until the "unlink signal" reached the linked entity. This - had one undesirable effect, though. You could never know when + had an undesirable effect, as you could never know when you were guaranteed not to be effected by the link.

-

Current behavior can be viewed as two combined operations: +

The current behavior can be viewed as two combined operations: asynchronously send an "unlink signal" to the linked entity and ignore any future results of the link.

+ - Remove the registered name for a process (or port) + Removes the registered name for a process (or port). -

Removes the registered name RegName, associated with a - pid or a port identifier.

+

Removes the registered name RegName + associated with a + process identifier or a port identifier, for example:

 > unregister(db).
 true
@@ -8345,31 +8850,34 @@ true name.

+ - Get the pid (or port) with a given registered name + Gets the pid (or port) with a given registered name. -

Returns the pid or port identifier with the registered name - RegName. Returns undefined if the name is not - registered.

+

Returns the process identifier or port identifier with + the registered name RegName. Returns undefined + if the name is not registered.

+

Example:

 > whereis(db).
 <0.43.0>
+ - Let other processes get a chance to execute + Lets other processes get a chance to execute. -

Voluntarily let other processes (if any) get a chance to +

Voluntarily lets other processes (if any) get a chance to execute. Using erlang:yield() is similar to receive after 1 -> ok end, except that yield() is faster.

There is seldom or never any need to use this BIF, - especially in the SMP-emulator as other processes will have a - chance to run in another scheduler thread anyway. - Using this BIF without a thorough grasp of how the scheduler - works may cause performance degradation.

+ especially in the SMP emulator, as other processes have a + chance to run in another scheduler thread anyway. + Using this BIF without a thorough grasp of how the scheduler + works can cause performance degradation.

-- cgit v1.2.3 From 07c1d0d975fbecf295a3c9f04f7b09e7a8b6ff99 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 23 Sep 2015 20:09:49 +0200 Subject: erts: Review module erlang docs --- erts/doc/src/erlang.xml | 455 +++++++++++++++++++++++------------------------- 1 file changed, 222 insertions(+), 233 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 8b20a5c12f..a51774b9f0 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -251,10 +251,7 @@

Example:

 > apply(lists, reverse, [[a, b, c]]).
-[c,b,a]
-

apply evaluates BIFs by using - the module name erlang.

-
+[c,b,a]
 > apply(erlang, atom_to_list, ['Erlang']).
 "Erlang"

If the number of arguments are known at compile time, @@ -282,16 +279,16 @@ in the text representation. If Encoding is utf8 or unicode, the characters are encoded using UTF-8 - (that is, characters from 16#80 through 0xFF are + (that is, characters from 128 through 255 are encoded in two bytes).

atom_to_binary(Atom, latin1) never fails because the text representation of an atom can only - contain characters from 0 through 16#FF. In a future release, + contain characters from 0 through 255. In a future release, the text representation of atoms can be allowed to contain any Unicode character and atom_to_binary(Atom, latin1) will then fail if the text representation for Atom contains a Unicode - character greater than 16#FF.

+ character greater than 255.

Example:

 > atom_to_binary('Erlang', latin1).
@@ -358,9 +355,9 @@
         If Encoding
         is utf8 or unicode, the binary must contain
         valid UTF-8 sequences. Only Unicode characters up
-        to 0xFF are allowed.

+ to 255 are allowed.

binary_to_atom(Binary, utf8) fails if - the binary contains Unicode characters greater than 16#FF. + the binary contains Unicode characters greater than 255. In a future release, such Unicode characters can be allowed and binary_to_atom(Binary, utf8) does then not fail. For more information on Unicode support in atoms, see the @@ -450,11 +447,11 @@ position Stop in Binary. The positions in the binary are numbered starting from 1.

-

The indexing style of using one-based indices for - binaries is deprecated for this function. New code is to - use the functions in module binary in STDLIB - instead. They therefore - use the same (zero-based) style of indexing.

+

The one-based indexing for binaries used by + this function is deprecated. New code is to use + binary:bin_to_list/3 + in STDLIB instead. All functions in module + binary consistently use zero-based indexing.

@@ -698,7 +695,7 @@

Checks if the node local process identified by Pid executes old code for Module.

-

The available Options are as follows:

+

The available Options are as follows:

{allow_gc, boolean()} @@ -770,7 +767,7 @@ - Convert time unit of a time value + Converts time unit of a time value.

Converts the Time value of time unit FromUnit to the corresponding @@ -878,7 +875,7 @@ line -

A packet is a line-terminated with newline. The +

A packet is a line terminated with newline. The newline character is included in the returned packet unless the line was truncated according to option line_length.

@@ -1809,7 +1806,7 @@ os_prompt%
Hash function (deprecated).

Returns a hash value for Term within the range - 1..Range. The range is 1..2^27-1.

+ 1..Range. The maximum range is 1..2^27-1.

This BIF is deprecated, as the hash value can differ on different architectures. The hash values for integer @@ -2034,7 +2031,7 @@ os_prompt%

This BIF is useful for builders of cross-reference tools.

Returns true if Module:Function/Arity - ia a BIF implemented in C, otherwise false.

+ is a BIF implemented in C, otherwise false.

@@ -2366,8 +2363,8 @@ os_prompt%

Failure: badarg if String contains a bad representation of a process identifier.

-

This BIF is intended for debugging and for use in the - Erlang OS. It is not to be used in application programs.

+

This BIF is intended for debugging and is not to be used + in application programs.

@@ -3161,9 +3158,9 @@ os_prompt% - At which node a pid, port, or reference is located. + At which node a pid, port, or reference originates. -

Returns the node where Arg is located. +

Returns the node where Arg originates. Arg can be a process identifier, a reference, or a port. If the local node is not @@ -3208,17 +3205,19 @@ os_prompt% known -

Nodes that are known to this node, for example, connected - and previously connected.

+

Nodes that are known to this node. That is, connected + nodes and nodes referred to by process identifiers, port + identifiers and references located on this node. + The set of known nodes is garbage collected. Notice that + this garbage collection can be delayed. For more + information, see + delayed_node_table_gc. +

Some equalities: [node()] = nodes(this), nodes(connected) = nodes([visible, hidden]), and nodes() = nodes(visible).

-

If the local node is not alive, - nodes(this) == nodes(known) == [nonode@nohost]. For - any other Arg the empty list - [] is returned.

@@ -3260,7 +3259,7 @@ os_prompt% given in cd, env, args, and arg0 are subject to Unicode filename translation if the system is running in Unicode filename mode. To avoid - translation or force, that is, UTF-8, supply the executable + translation or to force, for example UTF-8, supply the executable and/or arguments as a binary in the correct encoding. For details, see the module file, the function @@ -3585,9 +3584,10 @@ os_prompt%

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and ERTS version (the BIF was introduced in ERTS 4.9.1.1). - Range is 1..2^32. The function returns a hash value for + The function returns a hash value for Term within the range - 1..Range.

+ 1..Range. The maximum value for + Range is 2^32.

This BIF can be used instead of the old deprecated BIF erlang:hash/2, as it calculates better hashes for all data types, but consider using phash2/1,2 instead.

@@ -3604,9 +3604,10 @@ os_prompt%

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and ERTS version (the BIF was introduced in ERTS 5.2). - Range is 1..2^32. The function returns a hash value for - Term within the range - 0..Range-1. When without argument + The function returns a hash value for + Term within the range + 0..Range-1. The maximum value for + Range is 2^32. When without argument Range, a value in the range 0..2^27-1 is returned.

This BIF is always to be used for hashing terms. It @@ -3625,8 +3626,8 @@ os_prompt%

Returns a string corresponding to the text representation of Pid.

-

This BIF is intended for debugging and for use in the - Erlang OS. It is not to be used in application programs.

+

This BIF is intended for debugging and is not to be used + in application programs.

@@ -3641,19 +3642,18 @@ os_prompt% not reply with {Port, closed}. Any process can close a port with port_close/1, not only the port owner (the connected process). If the calling process is linked to - a port identified by Port, an exit signal is sent - because that link will be received before the return from - port_close/1

-

For comparison: Port ! {self(), close} fails with - badarg if Port cannot be sent to (that is, - Port refers not to a port and not to a process). If - Port is a closed port, nothing happens. - If Port + the port identified by Port, the exit + signal from the port is guaranteed to be delivered before + port_close/1 returns.

+

For comparison: Port ! {self(), close} + only fails with badarg if Port does + not refer to a port or a process. If Port + is a closed port, nothing happens. If Port is an open port and the calling process is the port owner, - the port replies with {Port, closed} when all buffers - have been flushed and the port really closes. If - the calling process is not the port owner, the - port owner fails with badsig.

+ the port replies with {Port, closed} when all buffers + have been flushed and the port really closes. If the calling + process is not the port owner, the port owner fails + with badsig.

Notice that any process can close a port using Port ! {PortOwner, close} as if it itself was the port owner, but the reply always goes to the port owner.

@@ -3665,10 +3665,10 @@ os_prompt% behavior.

Failure: badarg if Port is not an identifier of an open port, or the registered name of an open port. - If the calling process was linked to the port, the exit - identified by Port, the exit signal is sent because - this link was delivered to the calling process before this - exception occurs.

+ If the calling process was previously linked to the closed + port, identified by Port, the exit + signal from the port is guaranteed to be delivered before + this badarg exception occurs.

@@ -3683,10 +3683,10 @@ os_prompt% can send data to a port with port_command/2, not only the port owner (the connected process).

For comparison: Port ! {PortOwner, {command, Data}} - fails with badarg if Port - cannot be sent to (that - is, Port refers not to a port and not to a process). - If Port is a closed port, the data message disappears + only fails with badarg if Port + does not refer to a port or a process. If + Port is a closed port, the data message + disappears without a sound. If Port is open and the calling process is not the port owner, the port owner fails with badsig. The port owner fails with badsig @@ -3707,10 +3707,11 @@ os_prompt% badarg If Port is not an identifier of an open - port, or the registered name of an open port. If the calling - process was linked to the port, the exit signal is sent - because this link was delivered to the calling process - before this exception occurs. + port, or the registered name of an open port. If the + calling process was previously linked to the closed port, + identified by Port, the exit signal + from the port is guaranteed to be delivered before this + badarg exception occurs. badarg @@ -3754,10 +3755,11 @@ os_prompt% badarg If Port is not an identifier of an open - port, or the registered name of an open port. If the calling - process was linked to the port, the exit signal is sent - because this link was delivered to the calling process - before this exception occurs. + port, or the registered name of an open port. If the + calling process was previously linked to the closed port, + identified by Port, the exit signal + from the port is guaranteed to be delivered before this + badarg exception occurs. badarg @@ -3805,9 +3807,9 @@ os_prompt% set the port owner to be any process with port_connect/2.

For comparison: - Port ! {self(), {connect, Pid}} fails - with badarg if Port cannot be sent to (that is, - Port refers not to a port and not to a process). If + Port ! {self(), {connect, Pid}} + only fails with badarg if Port + does not refer to a port or a process. If Port is a closed port, nothing happens. If Port is an open port and the calling process is the port owner, @@ -3835,9 +3837,10 @@ os_prompt% If Port is not an identifier of an open port, or the registered name of an open port. If the calling - process was linked to the port, the exit signal is sent - because this link was delivered to the calling process - before this exception occurs. + process was previously linked to the closed port, + identified by Port, the exit signal + from the port is guaranteed to be delivered before this + badarg exception occurs. badarg If process identified by Pid is not an existing @@ -3906,9 +3909,10 @@ os_prompt% If Port is not an identifier of an open port, or the registered name of an open port. If the calling - process was linked to the port, the exit signal is sent - because this link was delivered to the calling process - before this exception occurs. + process was previously linked to the closed port, + identified by Port, the exit signal + from the port is guaranteed to be delivered before this + badarg exception occurs. badarg @@ -3937,11 +3941,10 @@ os_prompt% Port, or undefined if the port is not open. The order of the tuples is undefined, and all the tuples are not mandatory. - If undefined is returned and the calling process - was linked to a previously open port identified by - Port, an exit signal is sent because this link - was received by the process before the return from - port_info/1.

+ If the port is closed and the calling process + was previously linked to the port, the exit signal from the + port is guaranteed to be delivered before port_info/1 + returns undefined.

The result contains information about the following Items:

@@ -3968,11 +3971,10 @@ os_prompt%

Pid is the process identifier of the process connected to the port.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -3985,11 +3987,10 @@ os_prompt%

Index is the internal index of the port. This index can be used to separate ports.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4002,11 +4003,10 @@ os_prompt%

Bytes is the total number of bytes read from the port.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4019,11 +4019,10 @@ os_prompt%

Pids is a list of the process identifiers of the processes that the port is linked to.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4042,11 +4041,10 @@ os_prompt%

Notice that these results are highly implementation-specific and can change in a future release.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4061,11 +4059,10 @@ os_prompt% port itself can have allocated memory that is not included in Bytes.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4078,11 +4075,10 @@ os_prompt%

Monitors represent processes that this port monitors.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4095,11 +4091,10 @@ os_prompt%

Name is the command name set by open_port/2.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4115,11 +4110,10 @@ os_prompt% Command}, Options). If the port is not the result of spawning an OS process, the value is undefined.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4135,11 +4129,10 @@ os_prompt% port_command/3, or Port ! {Owner, {command, Data}.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent before this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4164,11 +4157,10 @@ os_prompt% of bytes queued by the port using the ERTS driver queue implementation.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4181,11 +4173,10 @@ os_prompt%

RegisteredName is the registered name of the port. If the port has no registered name, [] is returned.

If the port identified by Port is not open, - undefined is returned. If undefined is returned and - the calling process was linked to a previously open port identified - by Port, an exit signal is sent because this link - was received by the process before the return from - port_info/2.

+ undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

Failure: badarg if Port is not a local port identifier, or an atom.

@@ -4198,15 +4189,15 @@ os_prompt%

Returns a string corresponding to the text representation of the port identifier Port.

-

This BIF is intended for debugging and for use in the - Erlang OS. It is not to be used in application programs.

+

This BIF is intended for debugging. It is not to be used + in application programs.

- Lists all open ports. + Lists all existing ports.

Returns a list of port identifiers corresponding to all the ports existing on the local node.

@@ -4502,8 +4493,8 @@ os_prompt%

Returns information about the process identified by Pid, as specified by - Item or ItemList, - or undefined if the process is not alive.

+ Item or ItemList. + Returns undefined if the process is not alive.

If the process is alive and a single Item is given, the returned value is the corresponding InfoTuple, unless Item =:= registered_name @@ -4774,8 +4765,7 @@ os_prompt% badarg If Pid is not a local process. badarg - If Item is an invalid - Item. + If Item is an invalid item. @@ -4847,8 +4837,7 @@ os_prompt% exception of given class, reason, and call stack backtrace (stacktrace).

-

This BIF is intended for debugging and for use in - the Erlang OS. Avoid to use it in applications, +

This BIF is intended for debugging. Avoid to use it in applications, unless you really know what you are doing.

Class is error, exit, or @@ -4963,8 +4952,8 @@ os_prompt%

Returns a string corresponding to the text representation of Ref.

-

This BIF is intended for debugging and for use in the - Erlang OS. It is not to be used in application programs.

+

This BIF is intended for debugging and is not to be used + in application programs.

@@ -5208,7 +5197,7 @@ true Msg, [nosuspend | Options]), but with a Boolean return value.

This function behaves like - erlang:send_nosuspend/2), + erlang:send_nosuspend/2, but takes a third parameter, a list of options. The only option is noconnect, which makes the function return false if @@ -5267,13 +5256,23 @@ true Size of a tuple or binary. -

Returns an integer that is the size of argument - Item, which must be a tuple or a binary, - for example:

+

Returns the number of elements in a tuple or the number of + bytes in a binary or bitstring, for example:

 > size({morni, mulle, bwange}).
-3
+3 +> size(<<11, 22, 33>>). +3 + +

For bitstrings the number of whole bytes is returned. That is, if the number of bits + in the bitstring is not divisible by 8, the resulting + number of bytes is rounded down.

Allowed in guard tests.

+

See also + tuple_size/1, + byte_size/1 + and + bit_size/1.

@@ -5307,9 +5306,7 @@ true

Returns the process identifier of a new process started by the application of Module:Function - to Args. - The new created process is placed in the system scheduler - queue and will be run some time later.

+ to Args.

error_handler:undefined_function(Module, Function, Args) is evaluated by the new process if @@ -5319,8 +5316,8 @@ true can be redefined (see process_flag/2). If error_handler is undefined, or the user has - redefined the default error_handler, its replacement is - undefined, and a failure with reason undef occurs.

+ redefined the default error_handler and its replacement is + undefined, a failure with reason undef occurs.

Example:

 > spawn(speed, regulator, [high_speed, thin_cut]).
@@ -5364,10 +5361,9 @@ true
list [] on Node. A link is created between the calling process and the new process, atomically. If Node does not exist, - a useless pid is - returned (and, because of the link, an exit signal with exit - reason noconnection is received). Otherwise works - like spawn/3.

+ a useless pid is returned and an exit signal with + reason noconnection is sent to the calling + process. Otherwise works like spawn/3.

@@ -5376,7 +5372,7 @@ true Creates and links to a new process with a function as entry point.

Returns the process identifier of a new process started by - the applicatio of Module:Function + the application of Module:Function to Args. A link is created between the calling process and the new process, atomically. Otherwise works like @@ -5394,10 +5390,9 @@ true to Args on Node. A link is created between the calling process and the new process, atomically. If Node does - not exist, a useless pid - is returned (and, because of the link, an exit signal with exit - reason noconnection is received). Otherwise works - like spawn/3.

+ not exist, a useless pid is returned and an exit signal with + reason noconnection is sent to the calling + process. Otherwise works like spawn/3.

@@ -5761,7 +5756,7 @@ true Information about runtime.

Returns information about runtime, in milliseconds.

-

The runtime is the sum of the runtime for all threads +

This is the sum of the runtime for all threads in the Erlang runtime system and can therefore be greater than the wall clock time.

Example:

@@ -5787,7 +5782,7 @@ true activation. The time unit is undefined and can be subject to change between releases, OSs, and system restarts. scheduler_wall_time is only to be used to - calculate relative values for scheduler-use. + calculate relative values for scheduler-utilization. ActiveTime can never exceed TotalTime.

The definition of a busy scheduler is when it is not idle @@ -5808,14 +5803,14 @@ true is turned off.

The list of scheduler information is unsorted and can appear in different order between calls.

-

Using scheduler_wall_time to calculate scheduler-use:

+

Using scheduler_wall_time to calculate scheduler-utilization:

 > erlang:system_flag(scheduler_wall_time, true).
 false
 > Ts0 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
 ok

Some time later the user takes another snapshot and calculates - scheduler-use per scheduler, for example:

+ scheduler-utilization per scheduler, for example:

 > Ts1 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.
 ok
@@ -5829,7 +5824,7 @@ ok
  {6,0.9739235846420741},
  {7,0.973237033077876},
  {8,0.9741297293248656}]
-

Using the same snapshots to calculate a total scheduler-use:

+

Using the same snapshots to calculate a total scheduler-utilization:

 > {A, T} = lists:foldl(fun({{_, A0, T0}, {_, A1, T1}}, {Ai,Ti}) ->
 	{Ai + (A1 - A0), Ti + (T1 - T0)} end, {0, 0}, lists:zip(Ts0,Ts1)), A/T.
@@ -5961,9 +5956,7 @@ ok
         

Suspends the process identified by Suspendee. The same as calling erlang:suspend_process(Suspendee, - []). - For more information, see - erlang:suspend_process/2.

+ []).

This BIF is intended for debugging only.

@@ -6163,7 +6156,7 @@ ok

Controls if and how schedulers are bound to logical processors.

-

When erlang:system_flag(scheduler_bind_type, How +

When erlang:system_flag(scheduler_bind_type, How) is called, an asynchronous signal is sent to all schedulers online, causing them to try to bind or unbind as requested.

If a scheduler fails to bind, this is often silently @@ -6283,9 +6276,9 @@ ok Sets the number of schedulers online. Range is .

Returns the old value of the flag.

-

The emulator was built with support for - dirty schedulers. - Changing the number of schedulers online can also change the +

If the emulator was built with support for + dirty schedulers, + changing the number of schedulers online can also change the number of dirty CPU schedulers online. For example, if 12 schedulers and 6 dirty CPU schedulers are online, and system_flag/2 is used to set the number of schedulers @@ -6563,7 +6556,7 @@ ok

Returns the automatically detected - CpuTopology. The + CpuTopologyy. The emulator detects the CPU topology on some newer Linux, Solaris, FreeBSD, and Windows systems. On Windows system with more than 32 logical processors, @@ -7030,10 +7023,10 @@ ok

Returns a list of Pids when multi-scheduling is blocked, otherwise the empty list is - returned. The Pids in the list are - Pids of the processes currently - blocking multi-scheduling. A Pid is - present only once in the list, even if the corresponding + returned. The Pids in the list + represent all the processes currently + blocking multi-scheduling. A Pid occurs + only once in the list, even if the corresponding process has blocked multiple times.

See also erlang:system_flag(multi_scheduling, BlockState), @@ -7177,7 +7170,7 @@ ok time unit.

- port_parallelism + port_parallelism

Returns the default port parallelism scheduling hint used. @@ -7569,7 +7562,7 @@ ok fairly "normal". However, longer schedule times can indicate swapping or a misbehaving NIF/driver. Misbehaving NIFs and drivers can cause bad resource - use and bad overall system performance.

+ utilization and bad overall system performance.

{large_heap, Size} @@ -7756,15 +7749,15 @@ ok 0 - No compression is done (it is the same as giving no compressed option). - 1 - Takes least time but cannot compress, + 1 - Takes least time but may not compress as well as the higher levels. - 9 - Takes most time and can produce a smaller - result. Notice "can" in the preceding sentence; depending + 6 - Default level when option compressed + is provided. + 9 - Takes most time and tries to produce a smaller + result. Notice "tries" in the preceding sentence; depending on the input term, level 9 compression either does or does not produce a smaller result than level 1 compression. -

compressed and {compressed, 6} give the same - result.

Option {minor_version, Version} can be used to control some encoding details. This option was introduced in OTP R11B-4. @@ -7938,8 +7931,8 @@ timestamp() ->

FlagList can contain any number of the - following flags (the "message tags" refers to the list of the - following messages):

+ following flags (the "message tags" refers to the list of + trace messages):

all @@ -7985,7 +7978,7 @@ timestamp() -> {silent, false}.

The silent trace flag facilitates setting up a trace on many or even all processes in the system. - The trace is activated and deactivated using the match + The trace can then be activated and deactivated using the match specification function {silent,Bool}, giving a high degree of control of which functions with which arguments that trigger the trace.

@@ -8088,15 +8081,14 @@ timestamp() -> set_on_link is the same as having set_on_first_link alone. Likewise for set_on_spawn and set_on_first_spawn.

-

If flag timestamp is not given, the tracing - process receives the trace messages described in the - following. Pid is the process identifier of the - traced process in which - the traced event has occurred. The third tuple element - is the message tag.

+

The tracing process receives the trace messages described + 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 tuple.

+ is added last in the message tuple.

+ {trace, Pid, 'receive', Msg} @@ -8301,13 +8293,12 @@ timestamp() -> denotes all processes that currently are traced in the node.

Example: Process A is Tracee, - port B is - tracer, and process C is the port owner of B. - C wants to close B when A exits. C - can ensure that the trace is not truncated by calling - erlang:trace_delivered(A) when A exits and waits - for message {trace_delivered, A, Ref} - before closing B.

+ port B is tracer, and process C is the port + owner of B. C wants to close B when + A exits. To ensure that the trace is not truncated, + C can call erlang:trace_delivered(A), when + A exits, and wait for message {trace_delivered, A, + Ref} before closing B.

Failure: badarg if Tracee does not refer to a process (dead or alive) on the same node as the caller of @@ -8317,7 +8308,7 @@ timestamp() -> - Traces information about a process or function. + Trace information about a process or function. @@ -8444,23 +8435,21 @@ timestamp() ->

Enables or disables call tracing for - exported functions. Must be combined with + one or more functions. Must be combined with erlang:trace/3 to set the call trace flag for one or more processes.

Conceptually, call tracing works as follows. Inside the Erlang Virtual Machine, a set of processes and - a set of functions are to be traced. Tracing is - enabled on the intersection of the set. That is, if a process - included in the traced process set calls a function included - in the traced function set, the trace action is taken. + a set of functions are to be traced. If a traced process + calls a traced function, the trace action is taken. Otherwise, nothing happens.

To add or remove one or more processes to the set of traced processes, use erlang:trace/3.

-

To add or remove exported functions to the set of traced - functions, use erlang:trace_pattern/2.

+

To add or remove functions to the set of traced + functions, use erlang:trace_pattern/3.

The BIF erlang:trace_pattern/3 can also add match - specifications to an exported function. A match specification + specifications to a function. A match specification comprises a pattern that the function arguments must match, a guard expression that must evaluate to true, and an action to be performed. The default action is to send a @@ -8469,22 +8458,22 @@ timestamp() ->

Argument MFA is to be a tuple, such as {Module, Function, Arity}, or the atom on_load (described in the following). It can be the module, function, - and arity for an exported function (or a BIF in any module). - The atom '_' can be used to mean any of that kinds. - Wildcards can be used in any of the following ways:

+ and arity for a function (or a BIF in any module). + The atom '_' can be used as a wildcard in any of the + following ways:

{Module,Function,'_'} -

All exported functions of any arity named Function +

All functions of any arity named Function in module Module.

{Module,'_','_'} -

All exported functions in module Module.

+

All functions in module Module.

{'_','_','_'} -

All exported functions in all loaded modules.

+

All functions in all loaded modules.

Other combinations, such as {Module,'_',Arity}, are @@ -8498,12 +8487,12 @@ timestamp() -> false -

Disables tracing for the matching function or functions. +

Disables tracing for the matching functions. Any match specification is removed.

true -

Enables tracing for the matching function or functions.

+

Enables tracing for the matching functions.

MatchSpecList @@ -8534,7 +8523,7 @@ timestamp() ->

Turns on or off call tracing for global function calls (that is, calls specifying the module explicitly). Only exported functions match and only global calls - generate trace messages. This is the default.

+ generate trace messages. This is the default.

local @@ -8615,7 +8604,7 @@ timestamp() -> use the BIF erlang:trace_info/2 to retrieve the existing match specification.

-

Returns the number of exported functions matching +

Returns the number of functions matching argument MFA. This is zero if none matched.

@@ -8791,7 +8780,7 @@ timestamp() -> - Removes a link, if there is one, to another process or port. + Removes a link to another process or port.

Removes the link, if there is one, between the calling process and the process or port referred to by @@ -8805,9 +8794,9 @@ timestamp() -> Id has no effect on the caller in the future (unless the link is setup again). If the caller is trapping exits, an - {'EXIT', Id, _} - message is received, as the link can have - been placed in the caller's message queue before the call.

+ {'EXIT', Id, _} message from the link + can have been placed in the caller's message queue before + the call.

Notice that the {'EXIT', Id, _} message can be the result of the link, but can also be the result of Id -- cgit v1.2.3 From db5f5eeaa8ffab49758beb95552c1cf14b49a55d Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 1 Oct 2015 18:57:21 +0200 Subject: erts: Review newer additions to erlang.xml Trying to adopt same style as done by xsipewe in e17e236cd1661bc for later additions. --- erts/doc/src/erlang.xml | 274 ++++++++++++++++++++++++------------------------ 1 file changed, 136 insertions(+), 138 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index a51774b9f0..221869799d 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -66,7 +66,7 @@ -

Currently supported time unit representations:

+

Supported time unit representations:

PartsPerSecond :: integer() >= 1

Time unit expressed in parts per second. That is, @@ -93,11 +93,11 @@ used by the Erlang runtime system.

The native time unit is determined at - runtime system start, and will remain the same until + runtime system start, and remains the same until the runtime system terminates. If a runtime system is stopped and then started again (even on the same machine), the native time unit of the new - runtime system instance may differ from the + runtime system instance can differ from the native time unit of the old runtime system instance.

@@ -106,8 +106,7 @@ seconds, native). The result equals the number of whole native time units per second. In case the number of native time units per second does - not add up to a whole number, the result will be - rounded downwards.

+ not add up to a whole number, the result is rounded downwards.

The value of the native time unit gives @@ -121,7 +120,7 @@ but it gives absolutely no information at all about the accuracy of time values. The resolution of the native time - unit and the resolution of time values may differ + unit and the resolution of time values can differ significantly.

@@ -578,7 +577,7 @@ TimerRef identifies the timer, and was returned by the BIF that created the timer.

-

Currently available Options:

+

Available Options:

{async, Async} @@ -587,7 +586,7 @@ defaults to false which will cause the cancellation to be performed synchronously. When Async is set to true, the cancel - operation will be performed asynchronously. That is, + operation is performed asynchronously. That is, erlang:cancel_timer() will send an asynchronous request for cancellation to the timer service that manages the timer, and then return ok. @@ -598,17 +597,17 @@

Request information about the Result of the cancellation. Info defaults to true - which means that the Result will - be given. When Info is set to false, no + which means the Result is + given. When Info is set to false, no information about the result of the cancellation - will be given. When the operation is performed

+ is given. When the operation is performed

synchronously

- If Info is true, the Result will + If Info is true, the Result is returned by erlang:cancel_timer(); otherwise, - ok will be returned. + ok is returned.

asynchronously @@ -616,10 +615,10 @@

If Info is true, a message on the form {cancel_timer, TimerRef, - Result} will be sent to the + Result} is sent to the caller of erlang:cancel_timer() when the cancellation operation has been performed; otherwise, - no message will be sent. + no message is sent.

@@ -628,30 +627,30 @@

More Options may be added in the future.

+

If Result is an integer, it represents + the time in milli-seconds left until the canceled timer would + have expired.

- When the Result equals false, a + If Result is false, a timer corresponding to TimerRef could not be found. This can be either because the timer had expired, already had been canceled, or because TimerRef - never has corresponded to a timer. If the timer has expired, - the timeout message has been sent, but it does not tell you - whether or not it has arrived at its destination yet. When the - Result is an integer, it represents the - time in milli-seconds left until the timer would have expired. + never corresponded to a timer. Even if the timer had expired, + it does not tell you whether or not the timeout message has + arrived at its destination yet.

The timer service that manages the timer may be co-located with another scheduler than the scheduler that the calling process is executing on. If this is the case, communication - with the timer service will take much longer time than if it + with the timer service takes much longer time than if it is located locally. If the calling process is in critical path, and can do other things while waiting for the result of this operation, or is not interested in the result of - the operation, you want to use the {async, true} - option. If using the {async, false} option, the calling - process will be blocked until the operation has been - performed. + the operation, you want to use option {async, true}. + If using option {async, false}, the calling + process blocks until the operation has been performed.

See also @@ -2537,7 +2536,7 @@ os_prompt%

Returns a unique reference. -

Return a unique +

Returns a unique reference. The reference is unique among connected nodes.

Known issue: When a node is restarted multiple @@ -2863,7 +2862,7 @@ os_prompt% following format if the monitored state is changed:

{Tag, MonitorRef, Type, Object, Info}

The monitor request is an asynchronous signal. That is, it - takes time before the signal reach its destination.

+ takes time before the signal reaches its destination.

Valid Types:

process @@ -2976,8 +2975,8 @@ os_prompt% single time warp mode is used. When a change from preliminary to final time offset is made, the monitor will be triggered once - regardless of whether the time offset value was changed due to - the finalization or not.

+ regardless of whether the time offset value was actually changed + or not.

If the runtime system is in multi @@ -3077,7 +3076,7 @@ os_prompt% - Current Erlang monotonic time + Current Erlang monotonic time.

Returns the current Erlang @@ -3090,7 +3089,7 @@ os_prompt% monotonically increasing time, but not a strictly monotonically increasing time. That is, consecutive calls to - erlang:monotonic_time/0 may produce the same result.

+ erlang:monotonic_time/0 can produce the same result.

Different runtime system instances will use different unspecified points in time as base for their Erlang monotonic clocks. @@ -3098,9 +3097,9 @@ os_prompt% different runtime system instances. Different runtime system instances may also place this unspecified point in time different relative runtime system start. It may be placed in the future (time at start - will be a negative value), the past (time at start will be a - positive value), or the runtime system start (time at start will - be zero). The monotonic time as of runtime system start can be + is a negative value), the past (time at start is a + positive value), or the runtime system start (time at start is + zero). The monotonic time at runtime system start can be retrieved by calling erlang:system_info(start_time).

@@ -4881,7 +4880,7 @@ os_prompt% TimerRef identifies the timer, and was returned by the BIF that created the timer.

-

Currently available Options:

+

Available Options:

{async, Async} @@ -4889,12 +4888,12 @@ os_prompt% Asynchronous request for state information. Async defaults to false which will cause the operation to be performed synchronously. In this case, the Result - will be returned by erlang:read_timer(). When - Async is set to true, erlang:read_timer() - will send an asynchronous request for the state information - to the timer service that manages the timer, and then return + is returned by erlang:read_timer(). When + Async is true, erlang:read_timer() + sends an asynchronous request for the state information + to the timer service that manages the timer, and then returns ok. A message on the format {read_timer, - TimerRef, Result} will be + TimerRef, Result} is sent to the caller of erlang:read_timer() when the operation has been processed.

@@ -4904,26 +4903,27 @@ os_prompt% More Options may be added in the future.

- When the Result equals false, a + If Result is an integer, it represents the + time in milli-seconds left until the timer expires.

+

+ If Result is false, a timer corresponding to TimerRef could not - be found. This can be either because the timer had expired, - had been canceled, or because TimerRef - never has corresponded to a timer. If the timer has expired, - the timeout message has been sent, but it does not tell you - whether or not it has arrived at its destination yet. When the - Result is an integer, it represents the - time in milli-seconds left until the timer expires. + be found. This can be because the timer had expired, + it had been canceled, or because TimerRef + never has corresponded to a timer. Even if the timer has expired, + it does not tell you whether or not the timeout message has + arrived at its destination yet.

The timer service that manages the timer may be co-located with another scheduler than the scheduler that the calling process is executing on. If this is the case, communication - with the timer service will take much longer time than if it + with the timer service takes much longer time than if it is located locally. If the calling process is in critical path, and can do other things while waiting for the result - of this operation you want to use the {async, true} - option. If using the {async, false} option, the calling + of this operation, you want to use option {async, true}. + If using option {async, false}, the calling process will be blocked until the operation has been performed.

@@ -5119,10 +5119,9 @@ true

Starts a timer. When the timer expires, the message - Msg will be sent to the process + Msg is sent to the process identified by Dest. Appart from - the format of the message sent to - Dest when the timer expires + the format of the timeout message, erlang:send_after/4 works exactly as erlang:start_timer/4.

@@ -5609,24 +5608,27 @@ true

Starts a timer. When the timer expires, the message {timeout, TimerRef, Msg} - will be sent to the process identified by + is sent to the process identified by Dest.

-

Currently available Options:

+

Available Options:

- {abs, Abs} + {abs, false}

- Absolute Time value. Abs - defaults to false which means that the - Time value will be interpreted - as a time in milli-seconds relative current + This is the default. It means the + Time value is interpreted + as a time in milli-seconds relative current Erlang - monotonic time. When Abs is set to - true, the Time value will - be interpreted as an absolute Erlang monotonic time of - milli-seconds - time unit. + monotonic time. +

+
+ {abs, true} + +

+ Absolute Time value. The + Time value is interpreted as an + absolute Erlang monotonic time in milli-seconds.

@@ -5634,7 +5636,7 @@ true More Options may be added in the future.

- The absolute point in time that the timer is set to expire on + The absolute point in time, the timer is set to expire on, has to be in the interval [erlang:system_info(start_time), erlang:system_info(end_time)]. @@ -5646,7 +5648,7 @@ true be a pid() of a process created on the current runtime system instance. This process may or may not have terminated. If Dest is an - atom(), it will be interpreted as the name of a + atom(), it is interpreted as the name of a locally registered process. The process referred to by the name is looked up at the time of timer expiration. No error is given if the name does not refer to a process. @@ -5654,7 +5656,7 @@ true

If Dest is a pid(), the timer is automatically canceled if the process referred to by the - pid() is not alive, or when the process exits. This + pid() is not alive, or if the process exits. This feature was introduced in ERTS version 5.4.11. Notice that timers are not automatically canceled when Dest is an atom(). @@ -5990,7 +5992,7 @@ ok +sct in erl(1).

When this argument is removed, a final CPU topology - to use will be determined at emulator boot time.

+ to use is determined at emulator boot time.

Sets the user-defined CpuTopology. The user-defined @@ -6152,7 +6154,7 @@ ok argument, use command-line argument +sbt in erl(1). When this argument is removed, a final scheduler bind - type to use will be determined at emulator boot time.

+ type to use is determined at emulator boot time.

Controls if and how schedulers are bound to logical processors.

@@ -6313,26 +6315,24 @@ ok

Finalizes the time offset - when the single - time warp mode is being used. If another time warp mode than - the "single time warp mode" is used, the time offset state will be left - unchanged.

-

Returns the old state identifier. That is, if:

+ when single + time warp mode is used. If another time warp mode + is used, the time offset state is left unchanged.

+

Returns the old state identifier. That is:

-

preliminary is returned, finalization was +

If preliminary is returned, finalization was performed and the time offset is now final.

-

final is returned, the time offset was - already in the final state. This either due to another +

If final is returned, the time offset was + already in the final state. This either because another erlang:system_flag(time_offset, finalize) call, or - due to the - no - time warp mode being used.

+ because no + time warp mode is used.

-

volatile is returned, the time offset - cannot be finalized due to the +

If volatile is returned, the time offset + cannot be finalized because multi - time warp mode being used.

+ time warp mode is used.

@@ -6704,11 +6704,11 @@ ok delayed_node_table_gc -

Returns the amount of time in seconds that garbage collection - of an entry in a node table will be delayed. This limit can be set - on startup by passing the - +zdntgc command line - flag to erl. For more information see the documentation of the +

Returns the amount of time in seconds garbage collection + of an entry in a node table is delayed. This limit can be set + on startup by passing the command line flag + +zdntgc + to erl. For more information see the documentation of the command line flag.

dirty_cpu_schedulers @@ -6854,9 +6854,9 @@ ok eager_check_io

- Returns the value of the erl - +secio command line - flag which is either true or false. See the + Returns the value of the erl command line flag + +secio + which is either true or false. See the documentation of the command line flag for information about the different values.

@@ -7036,8 +7036,9 @@ ok
nif_version -

Returns a string containing the erlang NIF version - used by the runtime system. It will be on the form "<major ver>.<minor ver>".

+

Returns a string containing the version of the Erlang NIF interface + used by the runtime system. It is on the form + "<major ver>.<minor ver>".

otp_release @@ -7058,11 +7059,11 @@ ok

Returns a list containing information about the source of OS monotonic time that is used by the runtime system.

-

In case [] is returned, no OS monotonic time is +

If [] is returned, no OS monotonic time is available. The list contains two-tuples with Keys as first element, and Values as second element. The - order if these tuples is undefined. Currently the following - tuples may be part of the list, but more tuples may be + order of these tuples is undefined. The following + tuples can be part of the list, but more tuples can be introduced in the future:

{function, Function} @@ -7081,18 +7082,17 @@ ok resolution of current OS monotonic time source as parts per second. If no resolution information can be retreived - from the OS, OsMonotonicTimeResolution will be + from the OS, OsMonotonicTimeResolution is set to the resolution of the time unit of Functions return value. That is, the actual - resolution may be lower than + resolution can be lower than OsMonotonicTimeResolution. Also note that the resolution does not say anything about the accuracy, - and that the + and whether the precision - might not align with the resolution. You do, - however, know that the precision won't be - better than + do align with the resolution. You do, + however, know that the precision is not better than OsMonotonicTimeResolution.

{extended, Extended} @@ -7124,8 +7124,8 @@ ok system time that is used by the runtime system.

The list contains two-tuples with Keys as first element, and Values as second element. The - order if these tuples is undefined. Currently the following - tuples may be part of the list, but more tuples may be + order if these tuples is undefined. The following + tuples can be part of the list, but more tuples can be introduced in the future:

{function, Function} @@ -7143,18 +7143,17 @@ ok resolution of current OS system time source as parts per second. If no resolution information can be retreived - from the OS, OsSystemTimeResolution will be + from the OS, OsSystemTimeResolution is set to the resolution of the time unit of Functions return value. That is, the actual resolution may be lower than OsSystemTimeResolution. Also note that the resolution does not say anything about the accuracy, - and that the + and whether the precision - might not align with the resolution. You do, - however, know that the precision won't be - better than + do align with the resolution. You do, + however, know that the precision is not better than OsSystemTimeResolution.

{parallel, Parallel} @@ -7353,19 +7352,18 @@ ok time warp mode.

final -

The time offset is final. This - either due to the use of the +

The time offset is final. This either because no - time warp mode, or due to the time offset having - been finalized when using the + time warp mode is used, or because the time + offset have been finalized when single - time warp mode.

+ time warp mode is used.

volatile -

The time offset is volatile. That is, it may - change at any time. This due to the +

The time offset is volatile. That is, it can + change at any time. This is because multi - time warp mode being used.

+ time warp mode is used.

time_warp_mode @@ -7375,15 +7373,15 @@ ok no_time_warp

The no - time warp mode is being used.

+ time warp mode is used.

single_time_warp

The single - time warp mode is being used.

+ time warp mode is used.

multi_time_warp

The multi - time warp mode is being used.

+ time warp mode is used.

tolerant_timeofday @@ -7862,8 +7860,8 @@ ok

Returns current Erlang system time on the format {MegaSecs, Secs, MicroSecs}. This format is - the same that os:timestamp/0 - and the now deprecated erlang:now/0 + the same as os:timestamp/0 + and the deprecated erlang:now/0 uses. The reason for the existence of erlang:timestamp() is purely to simplify usage for existing code that assumes this timestamp format. Current Erlang system time can more efficiently be retrieved in @@ -7877,7 +7875,7 @@ timestamp() -> Secs = ErlangSystemTime div 1000000 - MegaSecs*1000000, MicroSecs = ErlangSystemTime rem 1000000, {MegaSecs, Secs, MicroSecs}. -

It however use a native implementation which does +

The BIF uses a native implementation which does not build garbage on the heap and with slightly better performance.

@@ -8035,7 +8033,7 @@ timestamp() -> Only allowed with PidSpec==all. If the host machine OS does not support high-resolution CPU time measurements, trace/3 exits with - badarg. Note that most operating systems do + badarg. Notice that most OS do not synchronize this value across cores, so be prepared that time might seem to go backwards when using this option.

@@ -8708,17 +8706,17 @@ timestamp() -> Each integer value can of course be constructed by other means.

-

By default, i.e. when [] is passed as +

By default, when [] is passed as ModifierList, both negative and - positive integers will be returned. This is order - to be able to utilize the range of integers that do - not need to be heap allocated as much as possible. + positive integers can be returned. This in order + to utilize the range of integers that do + not need heap memory allocation as much as possible. By default the returned integers are also only - guaranteed to be unique, i.e., any integer returned - may be either smaller, or larger than previously + guaranteed to be unique, that is, any returned integer + can be smaller or larger than previously returned integers.

-

Currently valid Modifiers:

+

Valid Modifiers:

positive @@ -8736,7 +8734,7 @@ timestamp() -> returned will always be larger than previously returned integers on the current runtime system instance.

-

These values can be used when ordering events +

These values can be used to determine order between events on the runtime system instance. That is, if both X = erlang:unique_integer([monotonic]) and Y = erlang:unique_integer([monotonic]) are @@ -8746,15 +8744,15 @@ timestamp() -> before Y.

Strictly monotonically increasing values are inherently quite expensive to generate and scales - poorly. This since the values needs to be - synchronized. That is, do not pass the monotonic + poorly. This is because the values need to be + synchronized between cpu cores. That is, do not pass the monotonic modifier unless you really need strictly monotonically increasing values.

-

All currently valid Modifiers +

All valid Modifiers can be combined. Repeated (valid) Modifiers in the ModifierList are ignored.

-- cgit v1.2.3 From ef9119ca3662c4e60e2d49c7edc0622cc73c21a0 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 5 Oct 2015 15:37:20 +0200 Subject: erts: Spell-check erlang.xml --- erts/doc/src/erlang.xml | 63 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 221869799d..e4f3a06cc5 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1693,7 +1693,7 @@ true file The second element of the tuple is a string (list of - characters) representing the filename of the source file + characters) representing the file name of the source file of the function. line @@ -1718,7 +1718,7 @@ true groups have a group leader. All I/O from the group is channeled to the group leader. When a new process is spawned, it gets the same group leader as the spawning - process. Initially, at system startup, init is both + process. Initially, at system start-up, init is both its own group leader and the group leader of all processes.

@@ -2429,7 +2429,7 @@ os_prompt%

Loads and links a dynamic library containing native implemented functions (NIFs) for a module. Path - is a file path to the sharable object/dynamic library file minus + is a file path to the shareable object/dynamic library file minus the OS-dependent file extension (.so for Unix and .dll for Windows. For information on how to implement a NIF library, see @@ -2804,7 +2804,7 @@ os_prompt% badarg If Type is not one of the memory types - listed in the decription of + listed in the description of erlang:memory/0. badarg @@ -3012,7 +3012,7 @@ os_prompt%

Making several calls to monitor/2 for the same Item and/or Type is not - an error; it results in as many independent monitorings.

+ an error; it results in as many independent monitoring instances.

The monitor functionality is expected to be extended. That is, other Types and Items are expected to be supported in a future release.

@@ -3034,7 +3034,7 @@ os_prompt% is false, monitoring is turned off.

Making several calls to monitor_node(Node, true) for the same Node is not an error; it results - in as many independent monitorings.

+ in as many independent monitoring instances.

If Node fails or does not exist, the message {nodedown, Node} is delivered to the process. If a process has made two calls to monitor_node(Node, true) @@ -3256,8 +3256,8 @@ os_prompt% process.

The name of the executable as well as the arguments given in cd, env, args, and arg0 are - subject to Unicode filename translation if the system is running - in Unicode filename mode. To avoid + subject to Unicode file name translation if the system is running + in Unicode file name mode. To avoid translation or to force, for example UTF-8, supply the executable and/or arguments as a binary in the correct encoding. For details, see the module @@ -3267,7 +3267,7 @@ os_prompt% User's Guide.

The characters in the name (if given as a list) can only be higher than 255 if the Erlang Virtual Machine is started - in Unicode filename translation mode. Otherwise the name + in Unicode file name translation mode. Otherwise the name of the executable is limited to the ISO-latin-1 character set.

PortName can be any of the following:

@@ -3280,7 +3280,7 @@ os_prompt% runs outside the Erlang work space unless an Erlang driver with the name Command is found. If found, that driver is started. A driver runs in the Erlang - workspace, which means that it is linked with the Erlang + work space, which means that it is linked with the Erlang runtime system.

When starting external programs on Solaris, the system call vfork is used in preference to fork @@ -3296,8 +3296,8 @@ os_prompt% token of the command is considered as the name of the executable (or driver). This (among other things) makes this option unsuitable for running - programs having spaces in filenames or directory names. - If spaces in executable filenames are desired, use + programs having spaces in file names or directory names. + If spaces in executable file names are desired, use {spawn_executable, Command} instead.

{spawn_driver, Command} @@ -3408,14 +3408,14 @@ os_prompt% other platforms, a similar behavior is mimicked.

The arguments are not expanded by the shell before being supplied to the executable. Most notably this - means that file wildcard expansion does not happen. - To expand wildcards for the arguments, use + means that file wild card expansion does not happen. + To expand wild cards for the arguments, use filelib:wildcard/1. Notice that even if the program is a Unix shell script, meaning that the - shell ultimately is invoked, wildcard expansion + shell ultimately is invoked, wild card expansion does not happen, and the script is provided with the - untouched arguments. On Windows, wildcard expansion + untouched arguments. On Windows, wild card expansion is always up to the program itself, therefore this is not an issue issue.

The executable name (also known as argv[0]) @@ -4313,8 +4313,8 @@ os_prompt% high are selected for execution. As with priority high, processes on lower priorities can execute in parallel with processes on priority max.

-

Scheduling is pre-emptive. Regardless of priority, a process - is pre-empted when it has consumed more than a certain number +

Scheduling is preemptive. Regardless of priority, a process + is preempted when it has consumed more than a certain number of reductions since the last time it was selected for execution.

@@ -5120,7 +5120,7 @@ true

Starts a timer. When the timer expires, the message Msg is sent to the process - identified by Dest. Appart from + identified by Dest. Apart from the format of the timeout message, erlang:send_after/4 works exactly as erlang:start_timer/4.

@@ -7067,21 +7067,21 @@ ok introduced in the future:

{function, Function} -

Function is the name of the funcion +

Function is the name of the function used. This tuple always exist if OS monotonic time is available to the runtime system.

{clock_id, ClockId}

This tuple only exist if Function can be used with different clocks. ClockId - corresponds to the clock identifer used when calling + corresponds to the clock identifier used when calling Function.

{resolution, OsMonotonicTimeResolution}

Highest possible resolution of current OS monotonic time source as parts per - second. If no resolution information can be retreived + second. If no resolution information can be retrieved from the OS, OsMonotonicTimeResolution is set to the resolution of the time unit of Functions return value. That is, the actual @@ -7135,14 +7135,14 @@ ok {clock_id, ClockId}

This tuple only exist if Function can be used with different clocks. ClockId - corresponds to the clock identifer used when calling + corresponds to the clock identifier used when calling Function.

{resolution, OsSystemTimeResolution}

Highest possible resolution of current OS system time source as parts per - second. If no resolution information can be retreived + second. If no resolution information can be retrieved from the OS, OsSystemTimeResolution is set to the resolution of the time unit of Functions return value. That is, the actual @@ -7654,9 +7654,8 @@ ok

If a process is put into or removed from the run queue, a message, {profile, Pid, State, Mfa, Ts}, is sent to ProfilerPid. Running processes that - are reinserted - into the run queue after having been pre-emptively - scheduled out do not trigger this message.

+ are reinserted into the run queue after having been + preempted do not trigger this message.

runnable_ports @@ -8341,7 +8340,7 @@ timestamp() ->

To get information about a function, PidOrFunc is to be the three-element tuple {Module, Function, Arity} or - the atom on_load. No wildcards are allowed. Returns + the atom on_load. No wild cards are allowed. Returns undefined if the function does not exist, or false if the function is not traced.

The following Items are valid::

@@ -8457,7 +8456,7 @@ timestamp() -> {Module, Function, Arity}, or the atom on_load (described in the following). It can be the module, function, and arity for a function (or a BIF in any module). - The atom '_' can be used as a wildcard in any of the + The atom '_' can be used as a wild card in any of the following ways:

{Module,Function,'_'} @@ -8475,7 +8474,7 @@ timestamp() ->

Other combinations, such as {Module,'_',Arity}, are - not allowed. Local functions match wildcards only if + not allowed. Local functions match wild cards only if option local is in FlagList.

If argument MFA is the atom on_load, the match specification and flag list are used on all @@ -8722,7 +8721,7 @@ timestamp() -> positive

Return only positive integers.

Note that by passing the positive modifier - you will get heap allocated integers (big-nums) + you will get heap allocated integers (bignums) quicker.

@@ -8758,7 +8757,7 @@ timestamp() -> are ignored.

Note that the set of integers returned by - unique_integer/1 using diffrent sets of + unique_integer/1 using different sets of Modifiers will overlap. For example, by calling unique_integer([monotonic]), and unique_integer([positive, monotonic]) -- cgit v1.2.3 From 6e93fb788aebb9050da2166749b41ff54197e049 Mon Sep 17 00:00:00 2001 From: Kostis Sagonas Date: Thu, 7 May 2015 14:43:02 +0200 Subject: Take out automatic insertion of 'undefined' from typed record fields Background ----------- In record fields with a type declaration but without an initializer, the Erlang parser inserted automatically the singleton type 'undefined' to the list of declared types, if that value was not present there. I.e. the record declaration: -record(rec, {f1 :: float(), f2 = 42 :: integer(), f3 :: some_mod:some_typ()}). was translated by the parser to: -record(rec, {f1 :: float() | 'undefined', f2 = 42 :: integer(), f3 :: some_mod:some_typ() | 'undefined'}). The rationale for this was that creation of a "dummy" #rec{} record should not result in a warning from dialyzer that e.g. the implicit initialization of the #rec.f1 field violates its type declaration. Problems --------- This seemingly innocent action has some unforeseen consequences. For starters, there is no way for programmers to declare that e.g. only floats make sense for the f1 field of #rec{} records when there is no `obvious' default initializer for this field. (This also affects tools like PropEr that use these declarations produced by the Erlang parser to generate random instances of records for testing purposes.) It also means that dialyzer does not warn if e.g. an is_atom/1 test or something more exotic like an atom_to_list/1 call is performed on the value of the f1 field. Similarly, there is no way to extend dialyzer to warn if it finds record constructions where f1 is not initialized to some float. Last but not least, it is semantically problematic when the type of the field is an opaque type: creating a union of an opaque and a structured type is very problematic for analysis because it fundamentally breaks the opacity of the term at that point. Change ------- To solve these problems the parser will not automatically insert the 'undefined' value anymore; instead the user has the option to choose the places where this value makes sense (for the field) and where it does not and insert the | 'undefined' there manually. Consequences of this change ---------------------------- This change means that dialyzer will issue a warning for all places where records with uninitialized fields are created and those fields have a declared type that is incompatible with 'undefined' (e.g. float()). This warning can be suppressed easily by adding | 'undefined' to the type of this field. This also adds documentation that the user really intends to create records where this field is uninitialized. --- erts/doc/src/absform.xml | 6 ------ 1 file changed, 6 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index df2553ced3..49fe784d06 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -246,12 +246,6 @@ Rep(V) = . If V is , then Rep(V) = . - If V is , where is - an atom and is a type and it does not contain - syntactically, then Rep(V) = - . - Note that if is an annotated type, it will be wrapped in - parentheses. If V is , where is an atom and is a type, then Rep(V) = . -- cgit v1.2.3 From 285b4fa13914dc4748c1020213a9c65cad3d2738 Mon Sep 17 00:00:00 2001 From: Serge Aleynikov Date: Tue, 2 Jun 2015 08:44:23 -0400 Subject: erts: Add {line_delimiter, byte()} option to inet:setopts/2 A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'. --- erts/doc/src/erlang.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 0492924164..1963b27915 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -933,6 +933,10 @@ if packet_size itself is not set. This use is only intended for backward compatibility.

+ {line_delimiter, 0 ≤ char() ≤ 255} +

For packet type line, sets delimiting character. + Default $\n.

+

Examples:

-- 
cgit v1.2.3


From 8377afdf5f56d018a1b439bbccc918ce123a834b Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin 
Date: Fri, 16 Oct 2015 11:43:20 +0200
Subject: erts: Clarify documentation

---
 erts/doc/src/erlang.xml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'erts/doc')

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 1963b27915..70d000f763 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -874,10 +874,10 @@
           
           line
           
-            

A packet is a line terminated with newline. The - newline character is included in the returned packet - unless the line was truncated according to option - line_length.

+

A packet is a line terminated by a delimiter byte, + default is the latin1 newline character. The delimiter + byte is included in the returned packet unless the line + was truncated according to option line_length.

asn1 | cdr | sunrm | fcgi | tpkt @@ -933,9 +933,9 @@ if packet_size itself is not set. This use is only intended for backward compatibility.

- {line_delimiter, 0 ≤ char() ≤ 255} -

For packet type line, sets delimiting character. - Default $\n.

+ {line_delimiter, 0 =< byte() =< 255} +

For packet type line, sets the delimiting byte. + Default is the latin1 character $\n.

Examples:

-- cgit v1.2.3 From afac3c7136c48d8630bd400c5454e146915e634f Mon Sep 17 00:00:00 2001 From: Serge Aleynikov Date: Mon, 26 Oct 2015 14:46:54 +0100 Subject: erts: Add {line_delimiter, byte()} option to inet:setopts/2 A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'. --- erts/doc/src/erlang.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 0492924164..1963b27915 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -933,6 +933,10 @@ if packet_size itself is not set. This use is only intended for backward compatibility.

+ {line_delimiter, 0 ≤ char() ≤ 255} +

For packet type line, sets delimiting character. + Default $\n.

+

Examples:

-- 
cgit v1.2.3


From 18270f5c208149323964ff9057b1b740cb72ea85 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin 
Date: Fri, 16 Oct 2015 11:43:20 +0200
Subject: erts: Clarify documentation

---
 erts/doc/src/erlang.xml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'erts/doc')

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 1963b27915..70d000f763 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -874,10 +874,10 @@
           
           line
           
-            

A packet is a line terminated with newline. The - newline character is included in the returned packet - unless the line was truncated according to option - line_length.

+

A packet is a line terminated by a delimiter byte, + default is the latin1 newline character. The delimiter + byte is included in the returned packet unless the line + was truncated according to option line_length.

asn1 | cdr | sunrm | fcgi | tpkt @@ -933,9 +933,9 @@ if packet_size itself is not set. This use is only intended for backward compatibility.

- {line_delimiter, 0 ≤ char() ≤ 255} -

For packet type line, sets delimiting character. - Default $\n.

+ {line_delimiter, 0 =< byte() =< 255} +

For packet type line, sets the delimiting byte. + Default is the latin1 character $\n.

Examples:

-- cgit v1.2.3 From 575b67139d8b1c6dee64b5ee239e3e7b5402959b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=B6m=C3=B6ri?= Date: Thu, 8 Oct 2015 14:52:37 +0200 Subject: Fix typo in trace gc_start doc Conflicts: erts/doc/src/erlang.xml --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 70d000f763..0d0672de3e 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8228,7 +8228,7 @@ timestamp() -> bin_old_vheap_size The total size of unique off-heap binaries referenced from the process old heap. - bin_vheap_block_size + bin_old_vheap_block_size The total size of binaries allowed in the virtual old heap in the process before doing a garbage collection. -- cgit v1.2.3 From 5ae78de4e4f6e220e29ad2f54b95a0098da4b365 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Mon, 12 Oct 2015 12:12:27 +0200 Subject: [erts] Correct documentation Fix mistakes found by 'xmllint'. --- erts/doc/src/driver_entry.xml | 5 ++- erts/doc/src/erl.xml | 83 +++++++++++++++++++------------------- erts/doc/src/erl_dist_protocol.xml | 4 +- erts/doc/src/erl_driver.xml | 16 ++++---- erts/doc/src/erl_ext_dist.xml | 4 +- erts/doc/src/erl_nif.xml | 7 ++-- erts/doc/src/erlang.xml | 37 +++++++++-------- erts/doc/src/erts_alloc.xml | 74 ++++++++++++++++----------------- erts/doc/src/escript.xml | 6 +-- erts/doc/src/notes.xml | 49 ++++++++++++---------- erts/doc/src/time_correction.xml | 4 +- 11 files changed, 148 insertions(+), 141 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index 30772c68fe..bad20d6343 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -4,7 +4,7 @@
- 20012013 + 20012015 Ericsson AB. All Rights Reserved. @@ -126,7 +126,7 @@
DATA TYPES - ErlDrvEntry + ErlDrvEntry

@@ -235,6 +235,7 @@ typedef struct erl_drv_entry { void (*ready_input)(ErlDrvData drv_data, ErlDrvEvent event) + void (*ready_output)(ErlDrvData drv_data, ErlDrvEvent event)

This is called when a driver event (given in the diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index b0322b7d43..63ab2532ab 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -4,7 +4,7 @@

- 19962013 + 19962015 Ericsson AB. All Rights Reserved. @@ -138,7 +138,7 @@ see app(4) and application(3).

- +

Command line arguments are read from the file . The arguments read from the file replace the @@ -203,7 +203,7 @@ app(4) and application(3).

- +

If this flag is present, will not maintain a fully connected network of distributed Erlang nodes, and then @@ -288,7 +288,7 @@

Makes write some debug information while interpreting the boot script.

- (emulator flag) + (emulator flag)

Selects an instrumented Erlang runtime system (virtual machine) to run, instead of the ordinary one. When running an @@ -436,7 +436,7 @@ flag and those running with the flag, as node names must be unique in distributed Erlang systems.

- +

-smp enable and -smp starts the Erlang runtime system with SMP support enabled. This may fail if no runtime @@ -462,7 +462,7 @@

invokes the code for the Erlang emulator (virtual machine), which supports the following flags:

- +

Suggested stack size, in kilowords, for threads in the async-thread pool. Valid range is 16-8192 kilowords. The @@ -477,7 +477,7 @@ suggestion, and it might even be ignored on some platforms.

- +

Sets the number of threads in async thread pool, valid range is 0-1024. If thread support is available, the default is 10.

@@ -496,7 +496,7 @@ , not (). Note also that is used instead of on Windows.

- +

Enable or disable time correction:

@@ -512,7 +512,7 @@ This is interpreted as +c false.

- +

Set time warp mode: @@ -540,7 +540,7 @@ produce a crash dump. On Unix systems, sending an emulator process a SIGUSR1 signal will also force a crash dump.

- +

Set max number of ETS tables.

@@ -625,7 +625,7 @@ information about the file names and line numbers.

- +

Memory allocator specific flags, see erts_alloc(3) for @@ -664,10 +664,10 @@ debugging. - +

Sets the range of characters that the system will consider printable in heuristic detection of strings. This typically affects the shell, debugger and io:format functions (when ~tp is used in the format string).

-

Currently two values for the Range are supported: +

Currently two values for the Range are supported:

latin1 The default. Only characters in the ISO-latin-1 range can be considered printable, which means @@ -682,11 +682,10 @@ example your font does not cover all Unicode characters. -

Se also io:printable_range/0.

- +

Sets the maximum number of simultaneously existing processes for this system if a Number is passed as value. Valid range for @@ -706,7 +705,7 @@ circumstances be extremely expensive. The legacy algoritm is deprecated, and the legacy option is scheduled for removal in OTP-R18.

- +

Sets the maximum number of simultaneously existing ports for this system if a Number is passed as value. Valid range for Number @@ -737,7 +736,7 @@ circumstances be extremely expensive. The legacy algoritm is deprecated, and the legacy option is scheduled for removal in OTP-R18.

- +

Sets the compatibility mode.

The distribution mechanism is not backwards compatible by @@ -757,7 +756,7 @@

Force ets memory block to be moved on realloc.

- +

Limits the amount of reader groups used by read/write locks optimized for read operations in the Erlang runtime system. By @@ -775,7 +774,7 @@ schedulers to logical processors, since the reader groups are distributed better between schedulers.

- +

Sets the number of scheduler threads to create and scheduler threads to set online when SMP support has been enabled. The maximum for @@ -800,7 +799,7 @@ SMP support enabled (see the -smp flag).

- +

Similar to +S but uses percentages to set the number of scheduler threads to create, based on logical processors configured, @@ -821,7 +820,7 @@ SMP support enabled (see the -smp flag).

- +

Sets the number of dirty CPU scheduler threads to create and dirty CPU scheduler threads to set online when threading support has been @@ -845,7 +844,7 @@ enabled (it's disabled by default).

- +

Similar to +SDcpu but uses percentages to set the number of dirty CPU scheduler threads to create and number of dirty CPU scheduler threads @@ -868,7 +867,7 @@ enabled (it's disabled by default).

- +

Sets the number of dirty I/O scheduler threads to create when threading support has been enabled. The valid range is 0-1024. By default, the number @@ -886,7 +885,7 @@

Scheduling specific flags.

- +sbt BindType + +sbt BindType

Set scheduler bind type.

Schedulers can also be bound using the @@ -1010,7 +1009,7 @@ erlang:system_info(scheduler_bindings).

- +sbwt none|very_short|short|medium|long|very_long + +sbwt none|very_short|short|medium|long|very_long

Set scheduler busy wait threshold. Default is medium. The threshold determines how long schedulers should busy @@ -1020,7 +1019,7 @@ without prior notice.

- +scl true|false + +scl true|false

Enable or disable scheduler compaction of load. By default scheduler compaction of load is enabled. When enabled, load @@ -1037,7 +1036,7 @@ between schedulers.

- +sct CpuTopology + +sct CpuTopology = integer(); when 0 =< =< 65535]]> @@ -1159,7 +1158,7 @@

For more information, see erlang:system_info(cpu_topology).

- +secio true|false + +secio true|false

Enable or disable eager check I/O scheduling. The default is currently true. The default was changed from false @@ -1176,7 +1175,7 @@

erlang:system_info(eager_check_io) returns the value of this parameter used when starting the VM.

- +sfwi Interval + +sfwi Interval

Set scheduler forced wakeup interval. All run queues will be scanned each Interval milliseconds. While there are @@ -1190,7 +1189,7 @@ the +sfwi flag will be removed.

- +stbt BindType + +stbt BindType

Try to set scheduler bind type. The same as the +sbt flag with the exception of @@ -1198,7 +1197,7 @@ documentation of the +sbt flag.

- +sub true|false + +sub true|false

Enable or disable scheduler @@ -1221,7 +1220,7 @@ utilization.

- +swct very_eager|eager|medium|lazy|very_lazy + +swct very_eager|eager|medium|lazy|very_lazy

Set scheduler wake cleanup threshold. Default is medium. @@ -1235,7 +1234,7 @@

NOTE: This flag may be removed or changed at any time without prior notice.

- +sws default|legacy + +sws default|legacy

Set scheduler wakeup strategy. Default strategy changed in erts-5.10/OTP-R16A. This strategy was previously known as proposal in OTP-R15. The legacy strategy was used as default from R13 up to and including R15. @@ -1243,7 +1242,7 @@

NOTE: This flag may be removed or changed at any time without prior notice.

- +swt very_low|low|medium|high|very_high + +swt very_low|low|medium|high|very_high

Set scheduler wakeup threshold. Default is medium. The threshold determines when to wake up sleeping schedulers @@ -1257,7 +1256,7 @@ without prior notice.

- +spp Bool + +spp Bool

Set default scheduler hint for port parallelism. If set to true, the VM will schedule port tasks when doing so will @@ -1273,7 +1272,7 @@ option to open_port/2

.
- +

Suggested stack size, in kilowords, for scheduler threads. Valid range is 4-8192 kilowords. The default stack size @@ -1281,11 +1280,11 @@ - +

Set the maximum number of atoms the VM can handle. Default is 1048576.

- +

Enables modified timing and sets the modified timing level. Currently valid range is 0-9. The timing of the runtime system @@ -1339,7 +1338,7 @@

Miscellaneous flags.

- +zdbbl size + +zdbbl size

Set the distribution buffer busy limit (dist_buf_busy_limit) @@ -1352,7 +1351,7 @@ give lower latency and higher throughput at the expense of higher memory usage.

- +zdntgc time + +zdntgc time

Set the delayed node table garbage collection time (delayed_node_table_gc) @@ -1426,7 +1425,7 @@ - +

The content of this environment variable will be added to the beginning of the command line for .

@@ -1436,7 +1435,7 @@ the section, i.e. the end of the command line following after an flag.

- and + and

The content of these environment variables will be added to the end of the command line for .

diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml index e1a58856f3..b435d5c9b4 100644 --- a/erts/doc/src/erl_dist_protocol.xml +++ b/erts/doc/src/erl_dist_protocol.xml @@ -5,7 +5,7 @@
2007 - 2013 + 2015 Ericsson AB, All Rights Reserved @@ -549,10 +549,10 @@ If Result > 0, the packet only consists of [119, Result]. -->
-
Distribution Handshake

+ This section describes the distribution handshake protocol introduced in the OTP-R6 release of Erlang/OTP. This description was previously located in diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 1f7fe0f961..42b6a3bfef 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -4,7 +4,7 @@

- 20012014 + 20012015 Ericsson AB. All Rights Reserved. @@ -223,7 +223,7 @@ asynchronous function calls, using a thread pool provided by Erlang. There is also a select call, that can be used for asynchronous drivers. - Multi-threading + Multi-threading

A POSIX thread like API for multi-threading is provided. The Erlang driver thread API only provide a subset of the functionality @@ -297,7 +297,7 @@

A driver can add and later remove drivers.

Monitoring processes

A driver can monitor a process that does not own a port.

- Version management + Version management

Version management is enabled for drivers that have set the extended_marker @@ -384,12 +384,12 @@

Rewrite driver callback - control + control to use return type ErlDrvSSizeT instead of int.

Rewrite driver callback - call + call to use return type ErlDrvSSizeT instead of int.

@@ -407,19 +407,19 @@

Driver callback - output + output now gets ErlDrvSizeT as 3rd argument instead of previously int.

Driver callback - control + control now gets ErlDrvSizeT as 4th and 6th arguments instead of previously int.

Driver callback - call + call now gets ErlDrvSizeT as 4th and 6th arguments instead of previously int.

diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index caf1e812c4..2ac974f497 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -5,7 +5,7 @@
2007 - 2014 + 2015 Ericsson AB, All Rights Reserved @@ -150,10 +150,10 @@
-
Distribution header

+ As of erts version 5.7.2 the old atom cache protocol was dropped and a new one was introduced. This atom cache protocol introduced the distribution header. Nodes with erts versions diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 23c3d5fcee..dae14b8d08 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -4,7 +4,7 @@

- 20012013 + 20012015 Ericsson AB. All Rights Reserved. @@ -833,9 +833,10 @@ typedef enum { Determine if a term is an empty list

Return true if term is an empty list.

- intenif_is_exception(ErlNifEnv* env, ERL_NIF_TERM term) + intenif_is_exception(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is an exception -

Return true if term is an exception.

+ +

Return true if term is an exception.

intenif_is_map(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is a map diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 70d000f763..df7af3ce6b 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4,7 +4,7 @@
- 19962013 + 19962015 Ericsson AB. All Rights Reserved. @@ -63,10 +63,10 @@

See erlang:timestamp/0.

- -

Supported time unit representations:

+

+ Supported time unit representations:

PartsPerSecond :: integer() >= 1

Time unit expressed in parts per second. That is, @@ -439,7 +439,7 @@ Converts part of a binary to a list. - 1..byte_size(Binary) + 1..byte_size(Binary)

As binary_to_list/1, but returns a list of integers corresponding to the bytes from position Start to @@ -997,7 +997,7 @@ the call, though. It is therefore usually advisable to remove such a 'DOWN' message from the message queue after monitoring has been stopped. - demonitor(MonitorRef, [flush]) + demonitor(MonitorRef, [flush]) can be used instead of demonitor(MonitorRef) if this cleanup is wanted.

@@ -1026,7 +1026,7 @@

The returned value is true unless info is part of OptionList.

demonitor(MonitorRef, []) is equivalent to - demonitor(MonitorRef).

+ demonitor(MonitorRef).

The available Options are as follows:

flush @@ -1114,8 +1114,8 @@ - 1..tuple_size(Tuple) Returns the Nth element of a tuple. + 1..tuple_size(Tuple)

Returns the Nth element (numbering from 1) of Tuple, for example:

@@ -2855,10 +2855,10 @@ os_prompt%
+ Starts monitoring. - Starts monitoring.

Send a monitor request of type Type to the entity identified by Item. The caller of @@ -3581,8 +3581,8 @@ os_prompt%

- Range = 1..2^32, Hash = 1..Range Portable hash function. + Range = 1..2^32, Hash = 1..Range

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and @@ -3600,9 +3600,9 @@ os_prompt% + Portable hash function. 1..2^32 0..Range-1 - Portable hash function.

Portable hash function that gives the same hash for the same Erlang term regardless of machine architecture and @@ -5240,8 +5240,8 @@ true - 1..tuple_size(Tuple1 Sets the Nth element of a tuple. + 1..tuple_size(Tuple1

Returns a tuple that is a copy of argument Tuple1 @@ -5582,8 +5582,8 @@ true - 0..byte_size(Bin) Splits a binary into two. + 0..byte_size(Bin)

Returns a tuple containing the binaries that are the result of splitting Bin into two parts at @@ -6475,7 +6475,7 @@ ok

Returns various size information for the specified allocator. The information returned is a subset of the information returned by - erlang:system_info({allocator, Alloc}). + erlang:system_info({allocator, Alloc}).

@@ -6855,7 +6855,7 @@ ok The return value will always be false, as the elib_malloc allocator has been removed.

- eager_check_io + eager_check_io

Returns the value of the erl command line flag @@ -7058,7 +7058,7 @@ ok of versions in System principles in System Documentation.

- os_monotonic_time_source + os_monotonic_time_source

Returns a list containing information about the source of OS @@ -7121,7 +7121,7 @@ ok time unit.

- os_system_time_source + os_system_time_source

Returns a list containing information about the source of OS @@ -7298,7 +7298,6 @@ ok erlang:system_info(schedulers) and erlang:system_flag(schedulers_online, SchedulersOnline).

-
smp_support @@ -7486,7 +7485,7 @@ ok system performance monitoring settings are cleared.

Calling the function with {MonitorPid, Options} as argument is the same as calling - erlang:system_monitor(MonitorPid, Options).

+ erlang:system_monitor(MonitorPid, Options).

Returns the previous system monitor settings just like erlang:system_monitor/0.

@@ -7857,8 +7856,8 @@ ok
- Current Erlang System time +

Returns current Erlang system time diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 376cae4a95..15b78ffa10 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -4,7 +4,7 @@

- 20022014 + 20022015 Ericsson AB. All Rights Reserved. @@ -260,19 +260,19 @@

The following flags are available for configuration of mseg_alloc:

- ]]> + ]]> Absolute max cache bad fit (in kilobytes). A segment in the memory segment cache is not reused if its size exceeds the requested size with more than the value of this parameter. Default value is 4096. - ]]> + ]]> Relative max cache bad fit (in percent). A segment in the memory segment cache is not reused if its size exceeds the requested size with more than relative max cache bad fit percent of the requested size. Default value is 20. - + Set super carrier only flag. This flag defaults to true. When a super carrier is used and this @@ -292,7 +292,7 @@ disabled on halfword heap systems. This flag will be ignored on halfword heap systems. - ]]> + ]]> Set super carrier reserved free segment descriptors. This parameter defaults to 65536. @@ -305,7 +305,7 @@ erts_mmap tuple part of the result from calling erlang:system_info({allocator, mseg_alloc}). - + Set super carrier reserve physical memory flag. This flag defaults to true. When this flag is @@ -328,7 +328,7 @@ disabled on halfword heap systems. This flag will be ignored on halfword heap systems. - ]]> + ]]> Set super carrier size (in MB). The super carrier size defaults to zero; i.e, the super carrier is by default disabled. The super @@ -343,7 +343,7 @@ disabled on halfword heap systems. This flag will be ignored on halfword heap systems. - ]]> + ]]> Max cached segments. The maximum number of memory segments stored in the memory segment cache. Valid range is @@ -352,15 +352,15 @@

The following flags are available for configuration of sys_alloc:

- +MYe true + +MYe true Enable sys_alloc. Note: sys_alloc cannot be disabled. - +MYm libc + +MYm libc malloc library to use. Currently only libc is available. libc enables the standard libc malloc implementation. By default libc is used. - ]]> + ]]> Trim threshold size (in kilobytes). This is the maximum amount of free memory at the top of the heap (allocated by @@ -372,7 +372,7 @@ trim threshold is 128. Note: This flag will only have any effect when the emulator has been linked with the GNU C library, and uses its malloc implementation. - ]]> + ]]> Top pad size (in kilobytes). This is the amount of extra memory that will be allocated by malloc when @@ -390,7 +390,7 @@ subsystem identifier, only the specific allocator identified will be effected:

- acul |de]]> + acul |de]]> Abandon carrier utilization limit. A valid ]]> is an integer in the range @@ -422,7 +422,7 @@ allocators based on the alloc_util framework with the exception of temp_alloc (which would be pointless). - as bf|aobf|aoff|aoffcbf|aoffcaobf|gf|af]]> + as bf|aobf|aoff|aoffcbf|aoffcaobf|gf|af]]> Allocation strategy. Valid strategies are bf (best fit), aobf (address order best fit), aoff (address order first fit), @@ -430,7 +430,7 @@ aoffcaobf (address order first fit carrier address order best fit), gf (good fit), and af (a fit). See the description of allocation strategies in "the alloc_util framework" section. - asbcst ]]> + asbcst ]]> Absolute singleblock carrier shrink threshold (in kilobytes). When a block located in an @@ -438,23 +438,23 @@ will be left unchanged if the amount of unused memory is less than this threshold; otherwise, the carrier will be shrunk. See also rsbcst. - e true|false]]> + e true|false]]> Enable allocator ]]>. - lmbcs ]]> + lmbcs ]]> Largest (mseg_alloc) multiblock carrier size (in kilobytes). See the description on how sizes for mseg_alloc multiblock carriers are decided in "the alloc_util framework" section. On 32-bit Unix style OS this limit can not be set higher than 128 megabyte. - mbcgs ]]> + mbcgs ]]> (mseg_alloc) multiblock carrier growth stages. See the description on how sizes for mseg_alloc multiblock carriers are decided in "the alloc_util framework" section. - mbsd ]]> + mbsd ]]> Max block search depth. This flag has effect only if the good fit strategy has been selected for allocator @@ -464,40 +464,40 @@ search depth sets a limit on the maximum number of blocks to inspect in a free list during a search for suitable block satisfying the request. - mmbcs ]]> + mmbcs ]]> Main multiblock carrier size. Sets the size of the main multiblock carrier for allocator ]]>. The main multiblock carrier is allocated via and is never deallocated. - mmmbc ]]> + mmmbc ]]> Max mseg_alloc multiblock carriers. Maximum number of multiblock carriers allocated via mseg_alloc by allocator ]]>. When this limit has been reached, new multiblock carriers will be allocated via sys_alloc. - mmsbc ]]> + mmsbc ]]> Max mseg_alloc singleblock carriers. Maximum number of singleblock carriers allocated via mseg_alloc by allocator ]]>. When this limit has been reached, new singleblock carriers will be allocated via sys_alloc. - ramv ]]> + ramv ]]> Realloc always moves. When enabled, reallocate operations will more or less be translated into an allocate, copy, free sequence. This often reduce memory fragmentation, but costs performance. - rmbcmt ]]> + rmbcmt ]]> Relative multiblock carrier move threshold (in percent). When a block located in a multiblock carrier is shrunk, the block will be moved if the ratio of the size of the returned memory compared to the previous size is more than this threshold; otherwise, the block will be shrunk at current location. - rsbcmt ]]> + rsbcmt ]]> Relative singleblock carrier move threshold (in percent). When a block located in a singleblock carrier is shrunk to @@ -506,7 +506,7 @@ the block will be left unchanged in the singleblock carrier if the ratio of unused memory is less than this threshold; otherwise, it will be moved into a multiblock carrier. - rsbcst ]]> + rsbcst ]]> Relative singleblock carrier shrink threshold (in percent). When a block located in an mseg_alloc @@ -514,20 +514,20 @@ unchanged if the ratio of unused memory is less than this threshold; otherwise, the carrier will be shrunk. See also asbcst. - sbct ]]> + sbct ]]> Singleblock carrier threshold. Blocks larger than this threshold will be placed in singleblock carriers. Blocks smaller than this threshold will be placed in multiblock carriers. On 32-bit Unix style OS this threshold can not be set higher than 8 megabytes. - smbcs ]]> + smbcs ]]> Smallest (mseg_alloc) multiblock carrier size (in kilobytes). See the description on how sizes for mseg_alloc multiblock carriers are decided in "the alloc_util framework" section. - t true|false]]> + t true|false]]>

Multiple, thread specific instances of the allocator. This option will only have any effect on the runtime system @@ -544,20 +544,20 @@ alloc_util, i.e. all allocators based on alloc_util will be effected:

- ]]> + ]]> sys_alloc carrier size. Carriers allocated via sys_alloc will be allocated in sizes which are multiples of the sys_alloc carrier size. This is not true for main multiblock carriers and carriers allocated during a memory shortage, though. - ]]> + ]]> Max mseg_alloc carriers. Maximum number of carriers placed in separate memory segments. When this limit has been reached, new carriers will be placed in memory retrieved from sys_alloc. - ]]> + ]]> Allow sys_alloc carriers. By default true. If set to false, sys_alloc carriers will never be @@ -565,19 +565,19 @@

Instrumentation flags:

- +Mim true|false + +Mim true|false A map over current allocations is kept by the emulator. The allocation map can be retrieved via the instrument module. +Mim true implies +Mis true. +Mim true is the same as -instr. - +Mis true|false + +Mis true|false Status over allocated memory is kept by the emulator. The allocation status can be retrieved via the instrument module. - +Mit X + +Mit X Reserved for future use. Do not use this flag. @@ -587,7 +587,7 @@

Other flags:

- +Mea min|max|r9c|r10b|r11b|config + +Mea min|max|r9c|r10b|r11b|config min @@ -617,7 +617,7 @@
- +Mlpm all|no + +Mlpm all|no Lock physical memory. The default value is no, i.e., no physical memory will be locked. If set to all, all memory mappings made by the runtime system, will be locked into diff --git a/erts/doc/src/escript.xml b/erts/doc/src/escript.xml index 46110333f9..f12f76890c 100644 --- a/erts/doc/src/escript.xml +++ b/erts/doc/src/escript.xml @@ -4,7 +4,7 @@
- 20072014 + 20072015 Ericsson AB. All Rights Reserved. @@ -96,8 +96,8 @@ $ escript factorial 5

The encoding specified by the above mentioned comment applies to the script itself. The encoding of the - I/O-server, however, has to be set explicitly like this: -io:setopts([{encoding, unicode}])

+ I/O-server, however, has to be set explicitly like this:

+io:setopts([{encoding, unicode}])

The default encoding of the I/O-server for standard_io is latin1 since the script runs in a non-interactive terminal diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 3f6d5b1d89..f27e73b9d3 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -4,7 +4,7 @@

- 20042013 + 20042015 Ericsson AB. All Rights Reserved. @@ -708,19 +708,20 @@

- Use persistent hashmaps for large Maps

Maps will use a + Use persistent hashmaps for large Maps

+

Maps will use a persistent hashmap implementation when the number of pairs in a Map becomes sufficiently large. The change will occur when a Map reaches 33 pairs in size but this - limit might change in the future.

-

The most significant impact for the user by this + limit might change in the future.

+

The most significant impact for the user by this change is speed, and to a lesser degree memory consumption and introspection of Maps. Memory consumption size is probalistic but lesser than gb_trees or dict for instance. Any other impacts will be transparent for the user except for the following changes.

-

Semantics of Maps have changed in two incompatible +

Semantics of Maps have changed in two incompatible ways compared to the experimental implementation in OTP 17:

Hashing of maps is done different by erlang:phash2/1,2, erlang:phash/1 and @@ -1368,7 +1369,7 @@

Improved support for atomic memory operations provided by the libatomic_ops + href="https://github.com/ivmai/libatomic_ops/">libatomic_ops library. Most importantly support for use of native double word atomics when implemented by libatomic_ops (for example, implemented for ARM).

@@ -2335,22 +2336,28 @@

EEP43: New data type - Maps

- With Maps you may for instance: M0 = - #{ a => 1, b => 2}, % create - associations M1 = M0#{ a := 10 }, % - update values M2 = M1#{ "hi" => - "hello"}, % add new associations #{ - "hi" := V1, a := V2, b := V3} = M2. % match keys with - values

+ With Maps you may for instance:

+ + M0 = #{ a => 1, b => 2}, % create + associations + M1 = M0#{ a := 10 }, % update values + M2 = M1#{ "hi" => + "hello"}, % add new associations + #{ "hi" := V1, a := V2, b := V3} = M2. + % match keys with values +

For information on how to use Maps please see Map Expressions in the Reference Manual.

The current implementation is without the following - features: No variable keys - No single value access No map - comprehensions

+ features:

+ + No variable keys + No single value access + No map comprehensions +

Note that Maps is experimental during OTP 17.0.

@@ -4510,8 +4517,7 @@

Fix erl_prim_loader errors in handling of primary archive. The following errors have been corrected:

-

- If primary archive was named "xxx", then a + If primary archive was named "xxx", then a file in the same directory named "xxxyyy" would be interpreted as a file named "yyy" inside the archive. erl_prim_loader did not correctly create @@ -4526,7 +4532,8 @@ erl_prim_loader:list_dir/1 would sometimes return an empty string inside the file list. This was a virtual element representing the top directory of the archive. - This has been removed.

+ This has been removed.
+

Thanks to Tuncer Ayaz and Shunichi Shinohara for reporting and co-authoring corrections.

@@ -6969,12 +6976,12 @@ Own Id: OTP-8726 Aux Id: seq11617

-

Fix libm linking with --as-needed flag +

Fix libm linking with --as-needed flag

When building with "--as-needed" linker flags on Linux the build will fail. This has now been fixed.

- (Thanks to Christian Faulhammer)

+ (Thanks to Christian Faulhammer)

Own Id: OTP-8728

diff --git a/erts/doc/src/time_correction.xml b/erts/doc/src/time_correction.xml index 4de3739a36..236fe679cb 100644 --- a/erts/doc/src/time_correction.xml +++ b/erts/doc/src/time_correction.xml @@ -4,7 +4,7 @@
- 19992014 + 19992015 Ericsson AB. All Rights Reserved. @@ -897,6 +897,6 @@ EventTag = {Time, UMI} and using these wrappers instead of using the API directly, the problem is solved. These wrappers can, for example, be implemented as in - $ERL_TOP/erts/example/time_compat.erl.

+ $ERL_TOP/erts/example/time_compat.erl.

-- cgit v1.2.3 From dc6d89bc1c08e15f8d4cd32f2e0886713cdc2dc2 Mon Sep 17 00:00:00 2001 From: Derek Brown Date: Wed, 4 Nov 2015 16:05:33 +0100 Subject: Fix typos and grammar --- erts/doc/src/erl.xml | 6 +++--- erts/doc/src/erlang.xml | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 63ab2532ab..ec4a0dee05 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -371,7 +371,7 @@ path, similar to . See code(3). As an alternative to -pa, if several directories are - to be prepended to the code and the directories have a + to be prepended to the code path and the directories have a common parent directory, that parent directory could be specified in the ERL_LIBS environment variable. See code(3).

@@ -1184,7 +1184,7 @@ disables this feature, which also is the default.

This feature has been introduced as a temporary workaround - for lengthy executing native code, and native code that do not + for long-executing native code, and native code that does not bump reductions properly in OTP. When these bugs have be fixed the +sfwi flag will be removed.

@@ -1210,7 +1210,7 @@ balance scheduler utilization between schedulers. That is, strive for equal scheduler utilization on all schedulers.
   +sub true is only supported on - systems where the runtime system detects and use a monotonically + systems where the runtime system detects and uses a monotonically increasing high resolution clock. On other systems, the runtime system will fail to start.
   +sub true implies diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index df7af3ce6b..94f9cd3148 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1001,15 +1001,15 @@ can be used instead of demonitor(MonitorRef) if this cleanup is wanted.

-

Before OTP R11B (ERTS 5.5), demonitor/1 - behaved asynchronous, that is, the monitor was active - until the "demonitor signal" reached the monitored entity. - This had an undesirable effect, as you could never know when - you were guaranteed not to receive a DOWN - message because of the monitor.

-

The current behavior can be viewed as two combined operations: - asynchronously send a "demonitor signal" to the monitored - entity and ignore any future results of the monitor.

+

Prior to OTP release R11B (ERTS version 5.5) demonitor/1 + behaved completely asynchronously, i.e., the monitor was active + until the "demonitor signal" reached the monitored entity. This + had one undesirable effect. You could never know when + you were guaranteed not to receive a DOWN message + due to the monitor.

+

Current behavior can be viewed as two combined operations: + asynchronously send a "demonitor signal" to the monitored entity + and ignore any future results of the monitor.

Failure: It is an error if MonitorRef refers to a monitoring started by another process. Not all such cases are @@ -7877,9 +7877,9 @@ timestamp() -> Secs = ErlangSystemTime div 1000000 - MegaSecs*1000000, MicroSecs = ErlangSystemTime rem 1000000, {MegaSecs, Secs, MicroSecs}. -

The BIF uses a native implementation which does - not build garbage on the heap and with slightly better - performance.

+

It, however, uses a native implementation which does + not build garbage on the heap and with slightly better + performance.

This time is not a monotonically increasing time in the general case. For more information, see the documentation of @@ -8812,8 +8812,8 @@ timestamp() -> true end -

Before OTP R11B (ERTS 5.5) unlink/1 - behaved asynchronous, that is, the link was active +

Prior to OTP release R11B (ERTS version 5.5) unlink/1 + behaved completely asynchronously, i.e., the link was active until the "unlink signal" reached the linked entity. This had an undesirable effect, as you could never know when you were guaranteed not to be effected by the link.

-- cgit v1.2.3 From 01cc99b35c00be86d832693776ee8ed880b59882 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 8 Dec 2014 20:36:28 +0100 Subject: erts: Make key argument constant for erl_drv_{get|put}env This should be a harmless and compatible API change. --- erts/doc/src/erl_driver.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 1f7fe0f961..d829aeda10 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -2811,7 +2811,7 @@ ERL_DRV_MAP int sz - interl_drv_putenv(char *key, char *value) + interl_drv_putenv(const char *key, char *value) Set the value of an environment variable @@ -2840,7 +2840,7 @@ ERL_DRV_MAP int sz - interl_drv_getenv(char *key, char *value, size_t *value_size) + interl_drv_getenv(const char *key, char *value, size_t *value_size) Get the value of an environment variable -- cgit v1.2.3 From 3ac08f9b668613a4292436979eacc61863c2ab94 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 16 Sep 2015 15:02:50 +0200 Subject: Fragmented young heap generation and off_heap_message_queue option * The youngest generation of the heap can now consist of multiple blocks. Heap fragments and message fragments are added to the youngest generation when needed without triggering a GC. After a GC the youngest generation is contained in one single block. * The off_heap_message_queue process flag has been added. When enabled all message data in the queue is kept off heap. When a message is selected from the queue, the message fragment (or heap fragment) containing the actual message is attached to the youngest generation. Messages stored off heap is not part of GC. --- erts/doc/src/erl.xml | 15 ++++++++++ erts/doc/src/erlang.xml | 77 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 90 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index b0322b7d43..8c1be4dff5 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1335,6 +1335,21 @@ error_logger(3) for further information.

+ + +

Default process flag settings.

+ + +xohmq true|false +

+ Sets the default value for the process flag + off_heap_message_queue. If +xohmq is not + passed, false will be the default. For more information, + see the documentation of + process_flag(off_heap_message_queue, + OHMQ). +

+
+

Miscellaneous flags.

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e77532463e..9426d30390 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4058,8 +4058,46 @@ os_prompt% process.

Returns the old value of the flag.

+ + Set process flag off_heap_message_queue for the calling process + +

This flag determines how messages in the message queue + are stored. When the flag is:

+ + true +

+ All messages in the message queue will be stored + outside of the process heap. This implies that no + messages in the message queue will be part of a garbage + collection of the process. +

+ false +

+ Messages may be placed either on the heap or outside + of the heap. +

+
+

+ If the process potentially may get a hugh amount of messages, + you are recommended to set the flag to true. This since + a garbage collection with lots of messages placed on the heap + may become extremly expensive. Performance of the actual + message passing is however generally better when setting the + flag to false. +

+

+ When changing this flag from false to true, + all messages in the message queue are moved off heap. This + work has been initiated but not completed when this function + call returns. +

+

Returns the old value of the flag.

+
+
+ + Set process flag priority for the calling process @@ -4138,7 +4176,7 @@ os_prompt% - + Set process flag save_calls for the calling process

N must be an integer in the interval 0..10000. @@ -4162,7 +4200,7 @@ os_prompt% - + Set process flag sensitive for the calling process

Set or clear the sensitive flag for the current process. @@ -4408,6 +4446,14 @@ os_prompt% monitor by name, the list item is {process, {RegName, Node}}.

+ {off_heap_message_queue, OHMQ} + +

Returns the current state of the off_heap_message_queue + process flag. OHMQ is either true, or + false. For more information, see the documentation of + process_flag(off_heap_message_queue, + OHMQ).

+
{priority, Level}

Level is the current priority level for @@ -5067,6 +5113,7 @@ true + Create a new process with a fun as entry point

Returns the pid of a new process started by the application @@ -5081,6 +5128,7 @@ true + Create a new process with a fun as entry point on a given node

Returns the pid of a new process started by the application @@ -5093,6 +5141,7 @@ true + Create a new process with a function as entry point

Works exactly like @@ -5188,6 +5237,18 @@ true fine-tuning an application and to measure the execution time with various VSize values.

+ {off_heap_message_queue, OHMQ} + +

Sets the state of the off_heap_message_queue process + flag. OHMQ should be either true, or + false. The default off_heap_message_queue process + flag is determined by the + +xohmq erl + command line argument. For more information, see the + documentation of + process_flag(off_heap_message_queue, + OHMQ).

+
@@ -5195,6 +5256,7 @@ true + Create a new process with a function as entry point on a given node

Returns the pid of a new process started by the application @@ -6224,6 +6286,7 @@ ok + Information about the system

Returns various information about the current system @@ -6614,6 +6677,16 @@ ok

Returns a string containing the erlang NIF version used by the runtime system. It will be on the form "<major ver>.<minor ver>".

+ off_heap_message_queue + +

Returns the default value of the off_heap_message_queue + process flag which is either true or false. This + default is set by the erl command line argument + +xohmq. For more information on the + off_heap_message_queue process flag, see documentation of + process_flag(off_heap_message_queue, + OHMQ).

+
otp_release

Returns a string containing the OTP release number of the -- cgit v1.2.3 From c8a7d2d7d1762378e49d3890a8dccde0110bed6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 16 Nov 2015 10:25:21 +0100 Subject: erl_prim_loader doc: Remove description of custom loaders Custom loaders have not been supported for several releases. Remove the documentation for custom loaders. --- erts/doc/src/erl_prim_loader.xml | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index d05f0d9aea..db4f132609 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -36,17 +36,11 @@ the system. The start script is also fetched with this low level loader.

erl_prim_loader knows about the environment and how to - fetch modules. The loader could, for example, fetch files using - the file system (with absolute file names as input), or a - database (where the binary format of a module is stored).

+ fetch modules.

The -loader Loader command line flag can be used to choose the method used by the erl_prim_loader. Two Loader methods are supported by the Erlang runtime system: - efile and inet. If another loader is required, then - it has to be implemented by the user. The Loader provided - by the user must fulfill the protocol defined below, and it is - started with the erl_prim_loader by evaluating - open_port({spawn,Loader},[binary]).

+ efile and inet.

The support for loading of code from archive files is experimental. The sole purpose of releasing it before it is ready @@ -83,9 +77,6 @@ started on each of hosts given in Hosts in order to answer the requests. See erl_boot_server(3).

-

If -loader is something else, the given port program - is started. The port program is supposed to follow - the protocol specified below.

@@ -174,22 +165,6 @@ -
- Protocol -

The following protocol must be followed if a user provided - loader port program is used. The Loader port program is - started with the command - open_port({spawn,Loader},[binary]). The protocol is as - follows:

-
-Function          Send               Receive
--------------------------------------------------------------
-get_file          [102 | FileName]   [121 | BinaryFile] (on success)
-                                     [122]              (failure)
-
-stop              eof                terminate
-
-
Command Line Flags

The erl_prim_loader module interprets the following @@ -199,10 +174,8 @@ stop eof terminate

Specifies the name of the loader used by erl_prim_loader. Loader can be efile - (use the local file system), or inet (load using - the boot_server on another Erlang node). If - Loader is user defined, the defined Loader port - program is started.

+ (use the local file system) or inet (load using + the boot_server on another Erlang node).

If the -loader flag is omitted, it defaults to efile.

-- cgit v1.2.3 From 9d0a5bf2c1cc564fd38268cbb5313cd8813ea138 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 16 Nov 2015 14:57:12 +0100 Subject: erts: Add garbage_collection_info to process_info/2 This info request returns greater details about the current gc state. This info is not included in the default process_info/1 as it would clutter the default printout with too much information. --- erts/doc/src/erlang.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 2e82bb62a9..e4d3533c75 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4621,6 +4621,17 @@ os_prompt% The content of GCInfo can be changed without prior notice.

+ {garbage_collection_info, GCInfo} + +

GCInfo is a list containing miscellaneous + detailed information about garbage collection for this process. + The content of GCInfo can be changed without + prior notice. + See gc_start in + erlang:trace/3 for details about + what each item means. +

+
{group_leader, GroupLeader}

GroupLeader is group leader for the I/O of -- cgit v1.2.3 From ef45d2c9f874354b17c2aca96de7b3306a9eb943 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 8 Dec 2014 20:37:59 +0100 Subject: erts: Add enif_getenv to read OS environment variables in a safe and portable way. --- erts/doc/src/erl_nif.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 23c3d5fcee..3b77b1ffa0 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -791,6 +791,10 @@ typedef enum { and return true, or return false if term is not an unsigned integer or is outside the bounds of type unsigned long.

+ intenif_getenv(const char* key, char* value, size_t *value_size) + Get the value of an environment variable +

Same as erl_drv_getenv.

+
intenif_has_pending_exception(ErlNifEnv* env, ERL_NIF_TERM* reason) Check if an exception has been raised

Return true if a pending exception is associated -- cgit v1.2.3 From ad50eefb67a69d755d46126bf5e436bf85644c8b Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 3 Dec 2015 11:11:17 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index cc224bee49..a64d699cec 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,25 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4.1.4 + +
Fixed Bugs and Malfunctions + + +

+ The 'raw' socket option could not be used multiple times + in one call to any e.g gen_tcp function because only one + of the occurrences were used. This bug has been fixed, + and also a small bug concerning propagating error codes + from within inet:setopts/2.

+

+ Own Id: OTP-11482 Aux Id: seq12872

+
+
+
+ +
+
Erts 6.4.1.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6fd3aba6bc714b779c5c91ed998a7661190ec882 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 4 Dec 2015 15:13:14 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index a64d699cec..9ff2e5de08 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,22 @@

This document describes the changes made to the ERTS application.

+
Erts 6.4.1.5 + +
Fixed Bugs and Malfunctions + + +

+ Fixed a bug that could cause a crash dump to become + almost empty.

+

+ Own Id: OTP-13150

+
+
+
+ +
+
Erts 6.4.1.4
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 23885a8ab609688641098a759110e295052323f8 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 1 Dec 2015 10:58:43 +0100 Subject: erts: Correct the types section in The Abstract Format document The Types section is more consistent with Kostis' text in The Reference Manual. --- erts/doc/src/absform.xml | 375 ++++++++++++++++++++++------------------------- 1 file changed, 178 insertions(+), 197 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index df2553ced3..8584898a9d 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -61,7 +61,7 @@

- Module declarations and forms + Module Declarations and Forms

A module declaration consists of a sequence of forms that are either function declarations or attributes.

@@ -78,204 +78,87 @@ Rep(F) = . If F is an attribute , then Rep(F) = . + If F is an attribute , then + Rep(F) = . If F is an attribute , then Rep(F) = . If F is an attribute , then Rep(F) = . - If F is a record declaration , then - Rep(F) = - . For Rep(V), see below. - If F is a type attribute (i.e. or - ) - where each - is a variable, then Rep(F) = - . - For Rep(T), see below. - If F is a type spec (i.e. or - ) - , - where each is a fun type clause with an - argument sequence of the same length , then - Rep(F) = - . - For Rep(Tc_i), see below. - If F is a type spec (i.e. or - ) - , - where each is a fun type clause with an - argument sequence of the same length , then - Rep(F) = - . - For Rep(Tc_i), see below. + If F is a record declaration + -record(Name,{V_1, ..., V_k}), then Rep(F) = + {attribute,LINE,record,{Name,[Rep(V_1), ..., Rep(V_k)]}}. + For Rep(V), see below. + If F is a type declaration + -Type Name(V_1, ..., V_k) :: T, where + Type is either the atom type or the atom opaque, + each V_i is a variable, and T is a type, then Rep(F) = + {attribute,LINE,Type,{Name,Rep(T),[Rep(V_1), ..., Rep(V_k)]}}. + + If F is a function specification + -Spec Name Ft_1; ...; Ft_k, + where Spec is either the atom spec or the atom + callback, and each Ft_i is a possibly constrained + function type with an argument sequence of the same length + Arity, then Rep(F) = + {attribute,Line,Spec,{{Name,Arity},[Rep(Ft_1), ..., Rep(Ft_k)]}}. + + If F is a function specification + -spec Mod:Name Ft_1; ...; Ft_k, + where each Ft_i is a possibly constrained + function type with an argument sequence of the same length + Arity, then Rep(F) = + {attribute,Line,spec,{{Mod,Name,Arity},[Rep(Ft_1), ..., Rep(Ft_k)]}}. + If F is a wild attribute , then Rep(F) = .

- If F is a function declaration , - where each is a function clause with a - pattern sequence of the same length , then - Rep(F) = . + If F is a function declaration + Name Fc_1 ; ... ; Name Fc_k, + where each Fc_i is a function clause with a + pattern sequence of the same length Arity, then + Rep(F) = {function,LINE,Name,Arity,[Rep(Fc_1), ...,Rep(Fc_k)]}. +
- Type clauses - - If T is a fun type clause - Ret]]>, where each - and are types, then - Rep(T) = - . - - If T is a bounded fun type clause , - where is an unbounded fun type clause and - is a type guard sequence, then Rep(T) = - . - -
- -
- Type guards - - If G is a constraint , where - is an atom and each is a - type, then Rep(G) = - . - - If G is a type definition , - where is a variable and - is a type, then Rep(G) = - . - -
- -
- Types - - If T is a type definition , - where is a variable and - is a type, then Rep(T) = - . - If T is a type union , - where each is a type, then Rep(T) = - . - If T is a type range , - where and are types, then - Rep(T) = . - If T is a binary operation , - where is an arithmetic or bitwise binary operator - and and are types, then - Rep(T) = . - If T is , where is an - arithmetic or bitwise unary operator and is a - type, then Rep(T) = . - If T is a fun type , then Rep(T) = - . - If T is a variable , then Rep(T) = - , where is an atom - with a printname consisting of the same characters as - . - If T is an atomic literal L and L is not a string literal, then - Rep(T) = Rep(L). - If T is a tuple or map type (i.e. - or ), then Rep(T) = - . - If T is a type , where each - is a type, then Rep(T) = - . - If T is a remote type , where - each is a type and and - , then Rep(T) = - . - - If T is the nil type , then Rep(T) = - . - If T is a list type , where - is a type, then Rep(T) = - . - If T is a non-empty list type , where - is a type, then Rep(T) = - . - If T is a map type , where each - is a map pair type, then Rep(T) = - . - If T is a map pair type V]]>, where - and are types, - then Rep(T) = - . - If T is a tuple type , where - each is a type, then Rep(T) = - . - If T is a record type , where - is an atom, then Rep(T) = - . - If T is a record type , - where is an atom, then Rep(T) = - . - - If T is a record field type , - where is an atom, then Rep(T) = - . - If T is a record field type >]]>, then Rep(T) = - . - - If T is a binary type >]]>, where - is a type, then Rep(T) = - . - If T is a binary type >]]>, - where is a type, then Rep(T) = - . - If T is a binary type >]]>, - where and is a type, then - Rep(T) = - . - - If T is a fun type Ret)]]>, then - Rep(T) = . - - If T is a fun type , where - is an unbounded fun type clause, - then Rep(T) = . - -
- -
- Record fields + Record Fields

Each field in a record declaration may have an optional - explicit default initializer expression

+ explicit default initializer expression, as well as an + optional type.

If V is , then Rep(V) = . - If V is , then + If V is , + where E is an expression, then Rep(V) = . - If V is , where is - an atom and is a type and it does not contain - syntactically, then Rep(V) = - . - Note that if is an annotated type, it will be wrapped in - parentheses. - If V is , where is - an atom and is a type, then Rep(V) = - . - - If V is , where - is an atom, is an expression and - is a type, then Rep(V) = - . - + If V is A :: T, where T is a + type and it does not contain + undefined syntactically, then Rep(V) = + {typed_record_field,{record_field,LINE,Rep(A)},Rep(undefined | T)}. + + If V is A :: T, where T is a type, then Rep(V) = + {typed_record_field,{record_field,LINE,Rep(A)},Rep(T)}. + + If V is A = E :: T, where + E is an expression and T is a type, then Rep(V) = + {typed_record_field,{record_field,LINE,Rep(A),Rep(E)},Rep(T)}. +
- Representation of parse errors and end of file + Representation of Parse Errors and End-of-file

In addition to the representations of forms, the list that represents - a module declaration (as returned by functions in and - ) may contain tuples and , denoting - syntactically incorrect forms and warnings, and , denoting an end - of stream encountered before a complete form had been parsed.

+ a module declaration (as returned by functions in erl_parse and + epp) may contain tuples {error,E} and + {warning,W}, denoting syntactically incorrect forms and + warnings, and {eof,LINE}, denoting an end-of-stream + encountered before a complete form had been parsed.

- Atomic literals + Atomic Literals

There are five kinds of atomic literals, which are represented in the same way in patterns, expressions and guards:

@@ -330,12 +213,12 @@ time), then Rep(P) = . If P is a record pattern , then Rep(P) = - . + . If P is , then Rep(P) = . If P is , then Rep(P) = , - i.e., patterns cannot be distinguished from their bodies. + that is, patterns cannot be distinguished from their bodies.

Note that every pattern has the same source form as some expression, and is represented the same way as the corresponding expression.

@@ -372,10 +255,10 @@ Rep(E) = . If E is , then Rep(E) = - . + . If E is , then Rep(E) = - . + . If E is , then Rep(E) = . If E is , then @@ -466,20 +349,13 @@ is a function clause then Rep(E) = . - If E is , - where each is a generator or a filter, then - Rep(E) = . - For Rep(W), see below. - If E is , a Mnesia record access - inside a query, then - Rep(E) = . If E is , then - Rep(E) = , - i.e., parenthesized expressions cannot be distinguished from their bodies. + Rep(E) = Rep(E_0), that is, parenthesized + expressions cannot be distinguished from their bodies.
- Generators and filters + Generators and Filters

When W is a generator or a filter (in the body of a list or binary comprehension), then:

If W is a generator , where is a pattern and @@ -494,20 +370,20 @@
- Binary element type specifiers + Binary Element Type Specifiers

A type specifier list TSL for a binary element is a sequence of type specifiers . Rep(TSL) = .

When TS is a type specifier for a binary element, then:

- If TS is an atom , Rep(TS) = . + If TS is an atom , then Rep(TS) = . If TS is a couple where is an atom and - is an integer, Rep(TS) = . + is an integer, then Rep(TS) = {A,Value}.
- Map assoc and exact fields + Map Assoc and Exact Fields

When W is an assoc or exact field (in the body of a map), then:

If W is an assoc field V]]>, where @@ -595,7 +471,7 @@ Rep(Gt) = . If Gt is , then Rep(E) = - . + . If Gt is , then Rep(Gt) = . If Gt is , then @@ -609,15 +485,120 @@ the atom and is an atom or an operator, then Rep(Gt) = . If Gt is , then - Rep(Gt) = , - i.e., parenthesized guard tests cannot be distinguished from their bodies. + Rep(Gt) = , that is, parenthesized + guard tests cannot be distinguished from their bodies.

Note that every guard test has the same source form as some expression, and is represented the same way as the corresponding expression.

- The abstract format after preprocessing + Types + + If T is an annotated type Anno :: Type, + where Anno is a variable and + Type is a type, then Rep(T) = + {ann_type,LINE,[Rep(Anno),Rep(Type)]}. + If T is an atom or integer literal L, then Rep(T) = Rep(L). + + If T is L Op R, + where Op is a binary operator and L and R + are types (this is an occurrence of an expression that can be + evaluated to an integer at compile time), then + Rep(T) = {op,LINE,Op,Rep(L),Rep(R)}. + If T is Op A, where Op is a + unary operator and A is a type (this is an occurrence of + an expression that can be evaluated to an integer at compile time), + then Rep(T) = {op,LINE,Op,Rep(A)}. + If T is a bitstring type <<_:M,_:_*N>>, + where M and N are singleton integer types, then Rep(T) = + {type,LINE,binary,[Rep(M),Rep(N)]}. + If T is the empty list type [], then Rep(T) = + {type,Line,nil,[]}. + If T is a fun type fun(), then Rep(T) = + {type,LINE,'fun',[]}. + If T is a fun type fun((...) -> B), + where B is a type, then + Rep(T) = {type,LINE,'fun',[{type,LINE,any},Rep(B)]}. + + If T is a fun type fun(Ft), where + Ft is a function type, + then Rep(T) = Rep(Ft). + If T is an integer range type L .. H, + where L and H are singleton integer types, then + Rep(T) = {type,LINE,range,[Rep(L),Rep(H)]}. + If T is a map type map(), then Rep(T) = + {type,LINE,map,any}. + If T is a map type #{P_1, ..., P_k}, where each + P_i is a map pair type, then Rep(T) = + {type,LINE,map,[Rep(P_1), ..., Rep(P_k)]}. + If T is a map pair type K => V, where + K and V are types, then Rep(T) = + {type,LINE,map_field_assoc,[Rep(K),Rep(V)]}. + If T is a predefined (or built-in) type N(A_1, ..., A_k), + where each A_i is a type, then Rep(T) = + {type,LINE,N,[Rep(A_1), ..., Rep(A_k)]}. + If T is a record type #Name{F_1, ..., F_k}, + where each F_i is a record field type, then Rep(T) = + {type,LINE,record,[Rep(Name),Rep(F_1), ..., Rep(F_k)]}. + + If T is a record field type Name :: Type, + where Type is a type, then Rep(T) = + {type,LINE,field_type,[Rep(Name),Rep(Type)]}. + If T is a remote type M:N(A_1, ..., A_k), where + each A_i is a type, then Rep(T) = + {remote_type,LINE,[Rep(M),Rep(N),[Rep(A_1), ..., Rep(A_k)]]}. + + If T is a tuple type tuple(), then Rep(T) = + {type,LINE,tuple,any}. + If T is a tuple type {A_1, ..., A_k}, where + each A_i is a type, then Rep(T) = + {type,LINE,tuple,[Rep(A_1), ..., Rep(A_k)]}. + If T is a type union T_1 | ... | T_k, + where each T_i is a type, then Rep(T) = + {type,LINE,union,[Rep(T_1), ..., Rep(T_k)]}. + If T is a type variable V, then Rep(T) = + {var,LINE,A}, where A is an atom with a printname + consisting of the same characters as V. A type variable + is any variable except underscore (_). + If T is a user-defined type N(A_1, ..., A_k), + where each A_i is a type, then Rep(T) = + {user_type,LINE,N,[Rep(A_1), ..., Rep(A_k)]}. + If T is ( T_0 ), then Rep(T) = Rep(T_0), + that is, parenthesized types cannot be distinguished from their + bodies. + + +
+ Function Types + + If Ft is a constrained function type Ft_1 when Fc, + where Ft_1 is a function type and + Fc is a function constraint, then Rep(T) = + {type,LINE,bounded_fun,[Rep(Ft_1),Rep(Fc)]}. + If Ft is a function type (A_1, ..., A_n) -> B, + where each A_i and B are types, then + Rep(Ft) = {type,LINE,'fun',[{type,LINE,product,[Rep(A_1), + ..., Rep(A_n)]},Rep(B)]}. + +
+ +
+ Function Constraints +

A function constraint Fc is a nonempty sequence of constraints + C_1, ..., C_k, and + Rep(Fc) = [Rep(C_1), ..., Rep(C_k)].

+ + If C is a constraint is_subtype(V, T) or V :: T, + where V is a type variable and T is a type, then + Rep(C) = {type,LINE,constraint,[Rep(F),[Rep(V),Rep(T)]]}. + + +
+
+ +
+ The Abstract Format After Preprocessing

The compilation option can be given to the compiler to have the abstract code stored in the chunk in the BEAM file -- cgit v1.2.3 From af1e0396fda62efb6c0817134b419b166b110d09 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 1 Dec 2015 12:45:03 +0100 Subject: erts: Remove CDATA from The Abstract Format document --- erts/doc/src/absform.xml | 579 +++++++++++++++++++++++------------------------ 1 file changed, 288 insertions(+), 291 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 8584898a9d..ca06794a53 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -11,7 +11,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software @@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - + The Abstract Format @@ -35,24 +35,24 @@

This document describes the standard representation of parse trees for Erlang programs as Erlang terms. This representation is known as the abstract format. - Functions dealing with such parse trees are + Functions dealing with such parse trees are compile:forms/[1,2] and functions in the modules - , - , - , - , - , + epp, + erl_eval, + erl_lint, + erl_pp, + erl_parse, and - . + io. They are also used as input and output for parse transforms (see the module - ).

-

We use the function to denote the mapping from an Erlang source - construct to its abstract format representation , and write - . + compile).

+

We use the function Rep to denote the mapping from an Erlang source + construct C to its abstract format representation R, and write + R = Rep(C).

-

The word below represents an integer, and denotes the +

The word LINE below represents an integer, and denotes the number of the line in the source file where the construction occurred. - Several instances of in the same construction may denote + Several instances of LINE in the same construction may denote different lines.

Since operators are not terms in their own right, when operators are mentioned below, the representation of an operator should be taken to @@ -66,24 +66,24 @@ function declarations or attributes.

If D is a module declaration consisting of the forms - , ..., , then - Rep(D) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . - If F is an attribute , then - Rep(F) = . + F_1, ..., F_k, then + Rep(D) = [Rep(F_1), ..., Rep(F_k)]. + If F is an attribute -module(Mod), then + Rep(F) = {attribute,LINE,module,Mod}. + If F is an attribute -behavior(Behavior), then + Rep(F) = {attribute,LINE,behavior,Behavior}. + If F is an attribute -behaviour(Behaviour), then + Rep(F) = {attribute,LINE,behaviour,Behaviour}. + If F is an attribute -export([Fun_1/A_1, ..., Fun_k/A_k]), then + Rep(F) = {attribute,LINE,export,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}. + If F is an attribute -import(Mod,[Fun_1/A_1, ..., Fun_k/A_k]), then + Rep(F) = {attribute,LINE,import,{Mod,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}}. + If F is an attribute -export_type([Type_1/A_1, ..., Type_k/A_k]), then + Rep(F) = {attribute,LINE,export_type,[{Type_1,A_1}, ..., {Type_k,A_k}]}. + If F is an attribute -compile(Options), then + Rep(F) = {attribute,LINE,compile,Options}. + If F is an attribute -file(File,Line), then + Rep(F) = {attribute,LINE,file,{File,Line}}. If F is a record declaration -record(Name,{V_1, ..., V_k}), then Rep(F) = {attribute,LINE,record,{Name,[Rep(V_1), ..., Rep(V_k)]}}. @@ -109,8 +109,8 @@ Arity, then Rep(F) = {attribute,Line,spec,{{Mod,Name,Arity},[Rep(Ft_1), ..., Rep(Ft_k)]}}. - If F is a wild attribute , then - Rep(F) = . + If F is a wild attribute -A(T), then + Rep(F) = {attribute,LINE,A,T}.

If F is a function declaration Name Fc_1 ; ... ; Name Fc_k, @@ -126,11 +126,11 @@ explicit default initializer expression, as well as an optional type.

- If V is , then - Rep(V) = . - If V is , + If V is A, then + Rep(V) = {record_field,LINE,Rep(A)}. + If V is A = E, where E is an expression, then - Rep(V) = . + Rep(V) = {record_field,LINE,Rep(A),Rep(E)}. If V is A :: T, where T is a type and it does not contain undefined syntactically, then Rep(V) = @@ -163,14 +163,14 @@ same way in patterns, expressions and guards:

If L is an integer or character literal, then - Rep(L) = . + Rep(L) = {integer,LINE,L}.
If L is a float literal, then - Rep(L) = . + Rep(L) = {float,LINE,L}.
If L is a string literal consisting of the characters - , ..., , then - Rep(L) = . + C_1, ..., C_k, then + Rep(L) = {string,LINE,[C_1, ..., C_k]}.
If L is an atom literal, then - Rep(L) = . + Rep(L) = {atom,LINE,L}.

Note that negative integer and float literals do not occur as such; they are parsed as an application of the unary negation operator.

@@ -178,46 +178,46 @@
Patterns -

If is a sequence of patterns , then - Rep(Ps) = . Such sequences occur as the +

If Ps is a sequence of patterns P_1, ..., P_k, then + Rep(Ps) = [Rep(P_1), ..., Rep(P_k)]. Such sequences occur as the list of arguments to a function or fun.

Individual patterns are represented as follows:

If P is an atomic literal L, then Rep(P) = Rep(L). - If P is a compound pattern , then - Rep(P) = . - If P is a variable pattern , then - Rep(P) = , + If P is a compound pattern P_1 = P_2, then + Rep(P) = {match,LINE,Rep(P_1),Rep(P_2)}. + If P is a variable pattern V, then + Rep(P) = {var,LINE,A}, where A is an atom with a printname consisting of the same characters as - . - If P is a universal pattern , then - Rep(P) = . - If P is a tuple pattern , then - Rep(P) = . - If P is a nil pattern , then - Rep(P) = . - If P is a cons pattern , then - Rep(P) = . - If E is a binary pattern >]]>, then - Rep(E) = . + V. + If P is a universal pattern _, then + Rep(P) = {var,LINE,'_'}. + If P is a tuple pattern {P_1, ..., P_k}, then + Rep(P) = {tuple,LINE,[Rep(P_1), ..., Rep(P_k)]}. + If P is a nil pattern [], then + Rep(P) = {nil,LINE}. + If P is a cons pattern [P_h | P_t], then + Rep(P) = {cons,LINE,Rep(P_h),Rep(P_t)}. + If E is a binary pattern <<P_1:Size_1/TSL_1, ..., P_k:Size_k/TSL_k>>, then + Rep(E) = {bin,LINE,[{bin_element,LINE,Rep(P_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(P_k),Rep(Size_k),Rep(TSL_k)}]}. For Rep(TSL), see below. - An omitted is represented by . An omitted - (type specifier list) is represented by . - If P is , where is a binary operator (this - is either an occurrence of applied to a literal string or character + An omitted Size is represented by default. An omitted TSL + (type specifier list) is represented by default. + If P is P_1 Op P_2, where Op is a binary operator (this + is either an occurrence of ++ applied to a literal string or character list, or an occurrence of an expression that can be evaluated to a number at compile time), - then Rep(P) = . - If P is , where is a unary operator (this is an + then Rep(P) = {op,LINE,Op,Rep(P_1),Rep(P_2)}. + If P is Op P_0, where Op is a unary operator (this is an occurrence of an expression that can be evaluated to a number at compile - time), then Rep(P) = . - If P is a record pattern , + time), then Rep(P) = {op,LINE,Op,Rep(P_0)}. + If P is a record pattern #Name{Field_1=P_1, ..., Field_k=P_k}, then Rep(P) = - . - If P is , then - Rep(P) = . - If P is , then - Rep(P) = , + {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(P_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(P_k)}]}. + If P is #Name.Field, then + Rep(P) = {record_index,LINE,Name,Rep(Field)}. + If P is ( P_0 ), then + Rep(P) = Rep(P_0), that is, patterns cannot be distinguished from their bodies.

Note that every pattern has the same source form as some expression, and is @@ -226,159 +226,153 @@

Expressions -

A body B is a sequence of expressions , and - Rep(B) = .

+

A body B is a sequence of expressions E_1, ..., E_k, and + Rep(B) = [Rep(E_1), ..., Rep(E_k)].

An expression E is one of the following alternatives:

- If P is an atomic literal , then - Rep(P) = Rep(L). - If E is , then - Rep(E) = . - If E is a variable , then - Rep(E) = , - where is an atom with a printname consisting of the same - characters as . - If E is a tuple skeleton , then - Rep(E) = . - If E is , then - Rep(E) = . - If E is a cons skeleton , then - Rep(E) = . - If E is a binary constructor >]]>, then - Rep(E) = . + If P is an atomic literal L, then Rep(P) = Rep(L). + If E is P = E_0, then + Rep(E) = {match,LINE,Rep(P),Rep(E_0)}. + If E is a variable V, then Rep(E) = {var,LINE,A}, + where A is an atom with a printname consisting of the same + characters as V. + If E is a tuple skeleton {E_1, ..., E_k}, then + Rep(E) = {tuple,LINE,[Rep(E_1), ..., Rep(E_k)]}. + If E is [], then + Rep(E) = {nil,LINE}. + If E is a cons skeleton [E_h | E_t], then + Rep(E) = {cons,LINE,Rep(E_h),Rep(E_t)}. + If E is a binary constructor <<V_1:Size_1/TSL_1, ..., V_k:Size_k/TSL_k>>, then Rep(E) = + {bin,LINE,[{bin_element,LINE,Rep(V_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(V_k),Rep(Size_k),Rep(TSL_k)}]}. For Rep(TSL), see below. - An omitted is represented by . An omitted - (type specifier list) is represented by . - If E is , where is a binary operator, - then Rep(E) = . - If E is , where is a unary operator, then - Rep(E) = . - If E is , then - Rep(E) = - . - If E is , then - Rep(E) = - . - If E is , then - Rep(E) = . - If E is , then - Rep(E) = . - If E is where each - is a map assoc or exact field, then Rep(E) = - . For Rep(W), see - below. - If E is where - is a map assoc or exact field, then Rep(E) = - . For - Rep(W), see below. - If E is , then - Rep(E) = . - If E is , then - Rep(E) = . - If E is , then + An omitted Size is represented by default. An omitted TSL + (type specifier list) is represented by default. + If E is E_1 Op E_2, where Op is a binary operator, + then Rep(E) = {op,LINE,Op,Rep(E_1),Rep(E_2)}. + If E is Op E_0, where Op is a unary operator, then + Rep(E) = {op,LINE,Op,Rep(E_0)}. + If E is #Name{Field_1=E_1, ..., Field_k=E_k}, + then Rep(E) = + {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(E_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(E_k)}]}. + If E is E_0#Name{Field_1=E_1, ..., Field_k=E_k}, then Rep(E) = - . - If E is a list comprehension , - where each is a generator or a filter, then - Rep(E) = . For Rep(W), see + {record,LINE,Rep(E_0),Name,[{record_field,LINE,Rep(Field_1),Rep(E_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(E_k)}]}. + If E is #Name.Field, then + Rep(E) = {record_index,LINE,Name,Rep(Field)}. + If E is E_0#Name.Field, then + Rep(E) = {record_field,LINE,Rep(E_0),Name,Rep(Field)}. + If E is #{W_1, ..., W_k} where each + W_i is a map assoc or exact field, then Rep(E) = + {map,LINE,[Rep(W_1), ..., Rep(W_k)]}. For Rep(W), see below. - If E is a binary comprehension >]]>, - where each is a generator or a filter, then - Rep(E) = . For Rep(W), see + If E is E_0#{W_1, ..., W_k} where + W_i is a map assoc or exact field, then Rep(E) = + {map,LINE,Rep(E_0),[Rep(W_1), ..., Rep(W_k)]}. + For Rep(W), see below. + If E is catch E_0, then + Rep(E) = {'catch',LINE,Rep(E_0)}. + If E is E_0(E_1, ..., E_k), then + Rep(E) = {call,LINE,Rep(E_0),[Rep(E_1), ..., Rep(E_k)]}. + If E is E_m:E_0(E_1, ..., E_k), then Rep(E) = + {call,LINE,{remote,LINE,Rep(E_m),Rep(E_0)},[Rep(E_1), ..., Rep(E_k)]}. + + If E is a list comprehension [E_0 || W_1, ..., W_k], + where each W_i is a generator or a filter, then Rep(E) = + {lc,LINE,Rep(E_0),[Rep(W_1), ..., Rep(W_k)]}. For Rep(W), see below. - If E is , where is a body, then - Rep(E) = . - If E is , - where each is an if clause then - Rep(E) = - . - If E is , - where is an expression and each is a - case clause then - Rep(E) = - . - If E is , - where is a body and each is a catch clause then + If E is a binary comprehension + <<E_0 || W_1, ..., W_k>>, + where each W_i is a generator or a filter, then + Rep(E) = {bc,LINE,Rep(E_0),[Rep(W_1), ..., Rep(W_k)]}. + For Rep(W), see below. + If E is begin B end, where B is a body, then + Rep(E) = {block,LINE,Rep(B)}. + If E is if Ic_1 ; ... ; Ic_k end, + where each Ic_i is an if clause then Rep(E) = + {'if',LINE,[Rep(Ic_1), ..., Rep(Ic_k)]}. + If E is case E_0 of Cc_1 ; ... ; Cc_k end, + where E_0 is an expression and each Cc_i is a + case clause then Rep(E) = + {'case',LINE,Rep(E_0),[Rep(Cc_1), ..., Rep(Cc_k)]}. + If E is try B catch Tc_1 ; ... ; Tc_k end, + where B is a body and each Tc_i is a catch clause then Rep(E) = - . - If E is , - where is a body, - each is a case clause and - each is a catch clause then + {'try',LINE,Rep(B),[],[Rep(Tc_1), ..., Rep(Tc_k)],[]}. + If E is try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n end, + where B is a body, + each Cc_i is a case clause and + each Tc_j is a catch clause then Rep(E) = + {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[Rep(Tc_1), ..., Rep(Tc_n)],[]}. + If E is try B after A end, + where B and A are bodies then Rep(E) = + {'try',LINE,Rep(B),[],[],Rep(A)}. + If E is try B of Cc_1 ; ... ; Cc_k after A end, + where B and A are a bodies and + each Cc_i is a case clause then Rep(E) = + {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[],Rep(A)}. + If E is try B catch Tc_1 ; ... ; Tc_k after A end, + where B and A are bodies and + each Tc_i is a catch clause then Rep(E) = + {'try',LINE,Rep(B),[],[Rep(Tc_1), ..., Rep(Tc_k)],Rep(A)}. + If E is try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n after A end, + where B and A are a bodies, + each Cc_i is a case clause and + each Tc_j is a catch clause then Rep(E) = - . - If E is , - where and are bodies then - Rep(E) = - . - If E is , - where and are a bodies and - each is a case clause then - Rep(E) = - . - If E is , - where and are bodies and - each is a catch clause then - Rep(E) = - . - If E is , - where and are a bodies, - each is a case clause and - each is a catch clause then - Rep(E) = - . - If E is , - where each is a case clause then - Rep(E) = - . - If E is B_t end]]>, - where each is a case clause, - is an expression and is a body, then - Rep(E) = - . - If E is , then - Rep(E) = . - If E is , then - Rep(E) = . - (Before the R15 release: Rep(E) = .) - If E is - where each is a function clause then Rep(E) = - . - If E is - where is a variable and each - is a function clause then Rep(E) = - . + {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[Rep(Tc_1), ..., Rep(Tc_n)],Rep(A)}. + If E is receive Cc_1 ; ... ; Cc_k end, + where each Cc_i is a case clause then Rep(E) = + {'receive',LINE,[Rep(Cc_1), ..., Rep(Cc_k)]}. + If E is receive Cc_1 ; ... ; Cc_k after E_0 -> B_t end, + where each Cc_i is a case clause, + E_0 is an expression and B_t is a body, then Rep(E) = + {'receive',LINE,[Rep(Cc_1), ..., Rep(Cc_k)],Rep(E_0),Rep(B_t)}. + If E is fun Name / Arity, then + Rep(E) = {'fun',LINE,{function,Name,Arity}}. + If E is fun Module:Name/Arity, then Rep(E) = + {'fun',LINE,{function,Rep(Module),Rep(Name),Rep(Arity)}}. + (Before the R15 release: Rep(E) = + {'fun',LINE,{function,Module,Name,Arity}}.) + If E is fun Fc_1 ; ... ; Fc_k end + where each Fc_i is a function clause then Rep(E) = + {'fun',LINE,{clauses,[Rep(Fc_1), ..., Rep(Fc_k)]}}. + If E is fun Name Fc_1 ; ... ; Name Fc_k end + where Name is a variable and each + Fc_i is a function clause then Rep(E) = + {named_fun,LINE,Name,[Rep(Fc_1), ..., Rep(Fc_k)]}. - If E is , then + If E is ( E_0 ), then Rep(E) = Rep(E_0), that is, parenthesized expressions cannot be distinguished from their bodies.
Generators and Filters -

When W is a generator or a filter (in the body of a list or binary comprehension), then:

+

When W is a generator or a filter (in the body of a list or + binary comprehension), then:

- If W is a generator , where is a pattern and - is an expression, then - Rep(W) = . - If W is a generator , where is a pattern and - is an expression, then - Rep(W) = . - If W is a filter , which is an expression, then - Rep(W) = . + If W is a generator P <- E, where P is + a pattern and E is an expression, then + Rep(W) = {generate,LINE,Rep(P),Rep(E)}. + If W is a generator P <= E, where P is + a pattern and E is an expression, then + Rep(W) = {b_generate,LINE,Rep(P),Rep(E)}. + If W is a filter E, which is an expression, then + Rep(W) = Rep(E).
Binary Element Type Specifiers

A type specifier list TSL for a binary element is a sequence of type - specifiers . - Rep(TSL) = .

+ specifiers TS_1 - ... - TS_k. + Rep(TSL) = [Rep(TS_1), ..., Rep(TS_k)].

When TS is a type specifier for a binary element, then:

- If TS is an atom , then Rep(TS) = . - If TS is a couple where is an atom and - is an integer, then Rep(TS) = {A,Value}. + If TS is an atom A, then Rep(TS) = A. + If TS is a couple A:Value where A is an atom + and Value is an integer, then Rep(TS) = + {A,Value}.
@@ -386,13 +380,13 @@ Map Assoc and Exact Fields

When W is an assoc or exact field (in the body of a map), then:

- If W is an assoc field V]]>, where - and are both expressions, - then Rep(W) = . + If W is an assoc field K => V, where + K and V are both expressions, + then Rep(W) = {map_field_assoc,LINE,Rep(K),Rep(V)}. - If W is an exact field , where - and are both expressions, - then Rep(W) = . + If W is an exact field K := V, where + K and V are both expressions, + then Rep(W) = {map_field_exact,LINE,Rep(K),Rep(V)}.
@@ -400,92 +394,95 @@
Clauses -

There are function clauses, if clauses, case clauses +

There are function clauses, if clauses, case clauses and catch clauses.

-

A clause is one of the following alternatives:

+

A clause C is one of the following alternatives:

- If C is a function clause B]]> - where is a pattern sequence and is a body, then - Rep(C) = . - If C is a function clause B]]> - where is a pattern sequence, - is a guard sequence and is a body, then - Rep(C) = . - If C is an if clause B]]> - where is a guard sequence and is a body, then - Rep(C) = . - If C is a case clause B]]> - where is a pattern and is a body, then - Rep(C) = . - If C is a case clause B]]> - where is a pattern, - is a guard sequence and is a body, then - Rep(C) = . - If C is a catch clause B]]> - where is a pattern and is a body, then - Rep(C) = . - If C is a catch clause B]]> - where is an atomic literal or a variable pattern, - is a pattern and is a body, then - Rep(C) = . - If C is a catch clause B]]> - where is a pattern, is a guard sequence - and is a body, then - Rep(C) = . - If C is a catch clause B]]> - where is an atomic literal or a variable pattern, - is a pattern, is a guard sequence - and is a body, then - Rep(C) = . + If C is a function clause ( Ps ) -> B + where Ps is a pattern sequence and B is a body, then + Rep(C) = {clause,LINE,Rep(Ps),[],Rep(B)}. + If C is a function clause ( Ps ) when Gs -> B + where Ps is a pattern sequence, + Gs is a guard sequence and B is a body, then + Rep(C) = {clause,LINE,Rep(Ps),Rep(Gs),Rep(B)}. + If C is an if clause Gs -> B + where Gs is a guard sequence and B is a body, then + Rep(C) = {clause,LINE,[],Rep(Gs),Rep(B)}. + If C is a case clause P -> B + where P is a pattern and B is a body, then + Rep(C) = {clause,LINE,[Rep(P)],[],Rep(B)}. + If C is a case clause P when Gs -> B + where P is a pattern, + Gs is a guard sequence and B is a body, then + Rep(C) = {clause,LINE,[Rep(P)],Rep(Gs),Rep(B)}. + If C is a catch clause P -> B + where P is a pattern and B is a body, then + Rep(C) = {clause,LINE,[Rep({throw,P,_})],[],Rep(B)}. + If C is a catch clause X : P -> B + where X is an atomic literal or a variable pattern, + P is a pattern and B is a body, then + Rep(C) = {clause,LINE,[Rep({X,P,_})],[],Rep(B)}. + If C is a catch clause P when Gs -> B + where P is a pattern, Gs is a guard sequence + and B is a body, then + Rep(C) = {clause,LINE,[Rep({throw,P,_})],Rep(Gs),Rep(B)}. + If C is a catch clause X : P when Gs -> B + where X is an atomic literal or a variable pattern, + P is a pattern, Gs is a guard sequence + and B is a body, then + Rep(C) = {clause,LINE,[Rep({X,P,_})],Rep(Gs),Rep(B)}.
Guards -

A guard sequence Gs is a sequence of guards , and - Rep(Gs) = . If the guard sequence is - empty, Rep(Gs) = .

-

A guard G is a nonempty sequence of guard tests , and - Rep(G) = .

-

A guard test is one of the following alternatives:

+

A guard sequence Gs is a sequence of guards G_1; ...; G_k, and + Rep(Gs) = [Rep(G_1), ..., Rep(G_k)]. If the guard sequence is + empty, Rep(Gs) = [].

+

A guard G is a nonempty sequence of guard tests + Gt_1, ..., Gt_k, and Rep(G) = + [Rep(Gt_1), ..., Rep(Gt_k)].

+

A guard test Gt is one of the following alternatives:

If Gt is an atomic literal L, then Rep(Gt) = Rep(L). - If Gt is a variable pattern , then - Rep(Gt) = , - where A is an atom with a printname consisting of the same characters as - . - If Gt is a tuple skeleton , then - Rep(Gt) = . - If Gt is , then - Rep(Gt) = . - If Gt is a cons skeleton , then - Rep(Gt) = . - If Gt is a binary constructor >]]>, then - Rep(Gt) = . + If Gt is a variable pattern V, then + Rep(Gt) = {var,LINE,A}, where A is an atom with + a printname consisting of the same characters as V. + If Gt is a tuple skeleton {Gt_1, ..., Gt_k}, then + Rep(Gt) = {tuple,LINE,[Rep(Gt_1), ..., Rep(Gt_k)]}. + If Gt is [], then Rep(Gt) = {nil,LINE}. + If Gt is a cons skeleton [Gt_h | Gt_t], then + Rep(Gt) = {cons,LINE,Rep(Gt_h),Rep(Gt_t)}. + If Gt is a binary constructor + <<Gt_1:Size_1/TSL_1, ..., Gt_k:Size_k/TSL_k>>, then + Rep(Gt) = {bin,LINE,[{bin_element,LINE,Rep(Gt_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(Gt_k),Rep(Size_k),Rep(TSL_k)}]}. For Rep(TSL), see above. - An omitted is represented by . An omitted - (type specifier list) is represented by . - If Gt is , where - is a binary operator, then Rep(Gt) = . - If Gt is , where is a unary operator, then - Rep(Gt) = . - If Gt is , then + An omitted Size is represented by default. + An omitted TSL (type specifier list) is represented + by default. + If Gt is Gt_1 Op Gt_2, where Op + is a binary operator, then Rep(Gt) = + {op,LINE,Op,Rep(Gt_1),Rep(Gt_2)}. + If Gt is Op Gt_0, where Op is a unary operator, then + Rep(Gt) = {op,LINE,Op,Rep(Gt_0)}. + If Gt is #Name{Field_1=Gt_1, ..., Field_k=Gt_k}, then Rep(E) = - . - If Gt is , then - Rep(Gt) = . - If Gt is , then - Rep(Gt) = . - If Gt is , where is an atom, then - Rep(Gt) = . - If Gt is , where is - the atom and is an atom or an operator, then - Rep(Gt) = . - If Gt is , where is - the atom and is an atom or an operator, then - Rep(Gt) = . - If Gt is , then - Rep(Gt) = , that is, parenthesized + {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(Gt_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(Gt_k)}]}. + If Gt is #Name.Field, then + Rep(Gt) = {record_index,LINE,Name,Rep(Field)}. + If Gt is Gt_0#Name.Field, then + Rep(Gt) = {record_field,LINE,Rep(Gt_0),Name,Rep(Field)}. + If Gt is A(Gt_1, ..., Gt_k), where A is an atom, then + Rep(Gt) = {call,LINE,Rep(A),[Rep(Gt_1), ..., Rep(Gt_k)]}. + If Gt is A_m:A(Gt_1, ..., Gt_k), where A_m is + the atom erlang and A is an atom or an operator, then + Rep(Gt) = {call,LINE,{remote,LINE,Rep(A_m),Rep(A)},[Rep(Gt_1), ..., Rep(Gt_k)]}. + If Gt is {A_m,A}(Gt_1, ..., Gt_k), where A_m is + the atom erlang and A is an atom or an operator, then + Rep(Gt) = {call,LINE,Rep({A_m,A}),[Rep(Gt_1), ..., Rep(Gt_k)]}. + + If Gt is ( Gt_0 ), then + Rep(Gt) = Rep(Gt_0), that is, parenthesized guard tests cannot be distinguished from their bodies.

Note that every guard test has the same source form as some expression, @@ -599,18 +596,18 @@

The Abstract Format After Preprocessing -

The compilation option can be given to the - compiler to have the abstract code stored in - the chunk in the BEAM file +

The compilation option debug_info can be given to the + compiler to have the abstract code stored in + the abstract_code chunk in the BEAM file (for debugging purposes).

-

In OTP R9C and later, the chunk will +

In OTP R9C and later, the abstract_code chunk will contain

-

-

where is the abstract code as described +

{raw_abstract_v1,AbstractCode}

+

where AbstractCode is the abstract code as described in this document.

In releases of OTP prior to R9C, the abstract code after some more processing was stored in the BEAM file. The first element of the - tuple would be either (R7B) or + tuple would be either abstract_v1 (R7B) or abstract_v2 (R8B).

-- cgit v1.2.3 From 19c4689eea86f26c5af9b8f712c227ce4f62310b Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 24 Nov 2015 15:57:55 +0100 Subject: Replace off_heap_message_queue option with message_queue_data option The message_queue_data option can have the values - off_heap - on_heap - mixed --- erts/doc/src/erl.xml | 10 +++--- erts/doc/src/erlang.xml | 94 +++++++++++++++++++++++++++++++------------------ 2 files changed, 65 insertions(+), 39 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index c4eb0e16ec..b6fa4c254c 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1338,14 +1338,14 @@

Default process flag settings.

- +xohmq true|false + +xmqd off_heap|on_heap|mixed

Sets the default value for the process flag - off_heap_message_queue. If +xohmq is not - passed, false will be the default. For more information, + message_queue_data. If +xmqd is not + passed, mixed will be the default. For more information, see the documentation of - process_flag(off_heap_message_queue, - OHMQ). + process_flag(message_queue_data, + MQD).

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 2e82bb62a9..6ed03f3dfc 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -58,6 +58,12 @@ + + +

See erlang:process_flag(message_queue_data, MQD).

+
+
+

See erlang:timestamp/0.

@@ -4280,39 +4286,52 @@ os_prompt%

Returns the old value of the flag.

- + - Set process flag off_heap_message_queue for the calling process + Set process flag message_queue_data for the calling process +

This flag determines how messages in the message queue are stored. When the flag is:

- true + off_heap

All messages in the message queue will be stored outside of the process heap. This implies that no messages in the message queue will be part of a garbage collection of the process.

- false + on_heap +

+ All messages in the message queue will eventually be + placed on heap. They may however temporarily be stored + off heap. This is how messages always have been stored + up until ERTS version 8.0. +

+ mixed

Messages may be placed either on the heap or outside of the heap.

+

+ The default message_queue_data process flag is determined + by the +xmqd + erl command line argument. +

If the process potentially may get a hugh amount of messages, - you are recommended to set the flag to true. This since - a garbage collection with lots of messages placed on the heap - may become extremly expensive. Performance of the actual - message passing is however generally better when setting the - flag to false. + you are recommended to set the flag to off_heap. This + since a garbage collection with lots of messages placed on + the heap may become extremly expensive and the process may + consume large amounts of memory. Performance of the + actual message passing is however generally better when not + using the off_heap flag.

- When changing this flag from false to true, - all messages in the message queue are moved off heap. This - work has been initiated but not completed when this function + When changing this flag messages will be moved. This work + has been initiated but not completed when this function call returns.

Returns the old value of the flag.

@@ -4478,6 +4497,7 @@ os_prompt% +

Returns a list containing InfoTuples with miscellaneous information about the process identified by @@ -4530,6 +4550,7 @@ os_prompt% +

Returns information about the process identified by Pid, as specified by @@ -4698,13 +4719,14 @@ os_prompt% monitor by name, the list item is {process, {RegName, Node}}.

- {off_heap_message_queue, OHMQ} + {message_queue_data, MQD} -

Returns the current state of the off_heap_message_queue - process flag. OHMQ is either true, or - false. For more information, see the documentation of - process_flag(off_heap_message_queue, - OHMQ).

+

Returns the current state of the message_queue_data + process flag. MQD is either off_heap, + on_heap, or mixed. For more information, see the + documentation of + process_flag(message_queue_data, + MQD).

{priority, Level} @@ -5474,6 +5496,7 @@ true Creates a new process with a fun as entry point. +

Returns the process identifier (pid) of a new process @@ -5490,6 +5513,7 @@ true Creates a new process with a fun as entry point on a given node. +

Returns the process identifier (pid) of a new process started @@ -5505,6 +5529,7 @@ true Creates a new process with a function as entry point. +

Works as @@ -5607,17 +5632,17 @@ true fine-tuning an application and to measure the execution time with various VSize values.

- {off_heap_message_queue, OHMQ} + {message_queue_data, MQD} -

Sets the state of the off_heap_message_queue process - flag. OHMQ should be either true, or - false. The default off_heap_message_queue process - flag is determined by the - +xohmq erl +

Sets the state of the message_queue_data process + flag. MQD should be either off_heap, + on_heap, or mixed. The default + message_queue_data process flag is determined by the + +xmqd erl command line argument. For more information, see the documentation of - process_flag(off_heap_message_queue, - OHMQ).

+ process_flag(message_queue_data, + MQD).

@@ -5627,6 +5652,7 @@ true Creates a new process with a function as entry point on a given node. +

Returns the process identifier (pid) of a new process started @@ -7106,15 +7132,15 @@ ok used by the runtime system. It is on the form "<major ver>.<minor ver>".

- off_heap_message_queue + message_queue_data -

Returns the default value of the off_heap_message_queue - process flag which is either true or false. This - default is set by the erl command line argument - +xohmq. For more information on the - off_heap_message_queue process flag, see documentation of - process_flag(off_heap_message_queue, - OHMQ).

+

Returns the default value of the message_queue_data + process flag which is either off_heap, on_heap, or mixed. + This default is set by the erl command line argument + +xmqd. For more information on the + message_queue_data process flag, see documentation of + process_flag(message_queue_data, + MQD).

otp_release -- cgit v1.2.3 From ce22e0f430a98cc096b056066d427edbd2449a13 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 9 Dec 2015 08:53:31 +0100 Subject: erts: Correct the types section in The Abstract Format document Fixed a mistake in commit 23885a. --- erts/doc/src/absform.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index ca06794a53..186c9a1143 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -588,7 +588,7 @@ If C is a constraint is_subtype(V, T) or V :: T, where V is a type variable and T is a type, then - Rep(C) = {type,LINE,constraint,[Rep(F),[Rep(V),Rep(T)]]}. + Rep(C) = {type,LINE,constraint,[{atom,LINE,is_subtype},[Rep(V),Rep(T)]]}.
-- cgit v1.2.3 From 41d147339c65d2b6dfcf60c1e63482612774bede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 10 Dec 2015 15:45:55 +0100 Subject: Eliminate mentions of 'random' in documentation --- erts/doc/src/init.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index fe26df61f7..2a33096d04 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -247,10 +247,7 @@ Expr during system initialization. If any of these steps fail (syntax error, parse error or exception during evaluation), Erlang stops with an error message. Here is an - example that seeds the random number generator:

-
-% erl -eval '{X,Y,Z} = now(), random:seed(X,Y,Z).'
-

This example uses Erlang as a hexadecimal calculator:

+ example that uses Erlang as a hexadecimal calculator:

 % erl -noshell -eval 'R = 16#1F+16#A0, io:format("~.16B~n", [R])' \\
 -s erlang halt
-- 
cgit v1.2.3


From f4a0ae1736216feac5ae053610644bba2e12ed34 Mon Sep 17 00:00:00 2001
From: Erlang/OTP 
Date: Tue, 15 Dec 2015 09:45:27 +0100
Subject: Update release notes

---
 erts/doc/src/notes.xml | 105 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)

(limited to 'erts/doc')

diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml
index 5a65115cb2..5cb9bdb690 100644
--- a/erts/doc/src/notes.xml
+++ b/erts/doc/src/notes.xml
@@ -32,6 +32,111 @@
   

This document describes the changes made to the ERTS application.

+
Erts 7.2 + +
Fixed Bugs and Malfunctions + + +

+ Small documentation fixes

+

+ Own Id: OTP-13017

+
+ +

+ Fix memory corruption bug caused by disabling + distribution and then re-enable distribution with a node + name that has previously been used by a remote node.

+

+ Own Id: OTP-13076 Aux Id: seq12959

+
+ +

+ Renamed variables with name bool as Visual Studio 2015 + now treats this is a keyword.

+

+ Own Id: OTP-13079

+
+ +

erl_prim_loader has not supported custom + loaders for several releases. In the documentation for + erl_prim_loader, all references to custom loaders + have now been removed.

+

+ Own Id: OTP-13102

+
+ +

+ Fixed compilation of erts together with libc versions + that do not define __uint32_t.

+

+ Own Id: OTP-13105

+
+ +

+ erl -make now returns non-zero exit codes on failure

+

+ Own Id: OTP-13107

+
+ +

+ Fix crash on init:restart in embedded mode caused by + on_load handler process not being relaunched leading to + load failure for modules such as crypto and asn1rt_nif + that need it to be present for correct NIF loading.

+

+ Own Id: OTP-13115

+
+ +

+ Fix maps decode in erlang:binary_to_term/1

+

Decoding a term with a large (HAMT) map in an small + (FLAT) map could cause a critical error if the external + format was not produced by beam.

+

+ Own Id: OTP-13125

+
+ +

+ Fix very rare bug in GC when big maps with a lot of hash + collisions from a remote node are waiting in inner + message queue.

+

+ Own Id: OTP-13146

+
+ +

+ Fixed a bug that could cause a crash dump to become + almost empty.

+

+ Own Id: OTP-13150

+
+
+
+ + +
Improvements and New Features + + +

Updated the xmllint target to just check the xml + files with real documentation content.
Corrected + some errors and added some missing target in the DTD's. +

+

+ Own Id: OTP-13026

+
+ +

+ Add function enif_getenv to read OS environment variables + in a portable way from NIFs.

+

+ Own Id: OTP-13147

+
+
+
+ +
+
Erts 7.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 4b98e710b9c45481c1cdc7a4ee68f7ce7fca908a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 13 Jul 2015 15:38:41 +0200 Subject: erts: Add support for asynchronous open_port OTP-13086 --- erts/doc/src/driver_entry.xml | 9 ++++++++- erts/doc/src/erl_driver.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index c802693977..ae7f264d0c 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -437,7 +437,14 @@ typedef struct erl_drv_entry { erl_drv_busy_msgq_limits() function. - + ERL_DRV_FLAG_USE_INIT_ACK + When this flag is given the linked-in driver has to manually + acknowledge that the port has been successfully started using + erl_drv_init_ack(). + This allows the implementor to make the erlang:open_port exit with + badarg after some initial asynchronous initialization has been done. + + void *handle2 diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index f7b4187b80..a2a1df37e5 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -2130,6 +2130,34 @@ ERL_DRV_MAP int sz + + voiderl_drv_init_ack(ErlDrvPort port, ErlDrvData res) + Acknowledge the start of the port + + +

Arguments:

+ + port + The port handle of the port (driver instance) creating + doing the acknowledgment. + + res + The result of the port initialization. This can be the same values + as the return value of start, + i.e any of the error codes or the ErlDrvData that is to be used for this + port. + + +

+ When this function is called the initiating erlang:open_port call is + returned as if the start + function had just been called. It can only be used when the + ERL_DRV_FLAG_USE_INIT_ACK + flag has been set on the linked-in driver. +

+
+
+ interl_drv_thread_create(char *name, ErlDrvTid *tid, -- cgit v1.2.3 From 91c1876f70870f450f7e8fd3b02f2396067e3cb8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 14 Jul 2015 11:07:33 +0200 Subject: erts: Add erl_drv_set_pid OTP-13087 --- erts/doc/src/erl_driver.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index a2a1df37e5..ef6d69cbeb 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -2158,6 +2158,25 @@ ERL_DRV_MAP int sz + + voiderl_drv_set_os_pid(ErlDrvPort port, ErlDrvSInt pid) + Set the os_pid for the port + + +

Arguments:

+ + port + The port handle of the port (driver instance) to set the pid on. + + pid + The pid to set. + +

+ Set the os_pid seen when doing erlang:port_info/2 on this port. +

+
+
+ interl_drv_thread_create(char *name, ErlDrvTid *tid, -- cgit v1.2.3 From 566a7f4324376428f3f0f6a77bc57679f04ada78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 16 Dec 2015 15:15:03 +0100 Subject: Clean up start of erl_prim_loader The 'init' module fetches command line parameters and passes them to erl_prim_loader:start/3. The code can be simplified if 'init' calls a new erl_prim_loader:start/0 function that itself fetches the necessary command line parameters. Also remove the documentation for the start() function, since it there is no way that it can be usefully called by a user application. While we are at it, also get rid of '-id' command line parameter, which is fetched and stored but never actually used. --- erts/doc/src/erl_prim_loader.xml | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index db4f132609..6fdec8c89e 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -50,35 +50,8 @@ -loader_debug are also experimental

- - - - - - - - Start the Erlang low level loader - -

Starts the Erlang low level loader. This function is called - by the init process (and module). The init - process reads the command line flags -id Id, - -loader Loader, and -hosts Hosts. These are - the arguments supplied to the start/3 function.

-

If -loader is not given, the default loader is - efile which tells the system to read from the file - system.

-

If -loader is inet, the -id Id, - -hosts Hosts, and -setcookie Cookie flags must - also be supplied. Hosts identifies hosts which this - node can contact in order to load modules. One Erlang - runtime system with a erl_boot_server process must be - started on each of hosts given in Hosts in order to - answer the requests. See erl_boot_server(3).

-
-
Get a file @@ -189,17 +162,12 @@

Specifies which other Erlang nodes the inet loader can use. This flag is mandatory if the -loader inet flag is present. On each host, there must be on Erlang node - with the erl_boot_server which handles the load - requests. Hosts is a list of IP addresses (hostnames + with the erl_boot_server(3) + which handles the load requests. + Hosts is a list of IP addresses (hostnames are not acceptable).

- -id Id - -

Specifies the identity of the Erlang runtime system. If - the system runs as a distributed node, Id must be - identical to the name supplied with the -sname or - -name distribution flags.

-
-setcookie Cookie

Specifies the cookie of the Erlang runtime system. This flag -- cgit v1.2.3 From b74e7f4c1404a334be10c5d4a8b1ef5415405425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 16 Dec 2015 14:38:55 +0100 Subject: erl_prim_loader doc: Remove mention of user supplied loader Custom loaders are no longer supported. Most of the documentation for them were removed in c8a7d2d7. --- erts/doc/src/erl_prim_loader.xml | 2 -- 1 file changed, 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index 6fdec8c89e..8f66e07ae1 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -60,8 +60,6 @@ Filename is either an absolute file name or just the name of the file, for example "lists.beam". If an internal path is set to the loader, this path is used to find the file. - If a user supplied loader is used, the path can be stripped - off if it is obsolete, and the loader does not use a path. FullName is the complete name of the fetched file. Bin is the contents of the file as a binary.

-- cgit v1.2.3 From a96f36890da959bcb134ac4f6d24d5132e7bb5be Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 17 Dec 2015 14:53:04 +0100 Subject: Update release notes --- erts/doc/src/notes.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 5cb9bdb690..a726cc7b97 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,27 @@

This document describes the changes made to the ERTS application.

+
Erts 7.2.1 + +
Fixed Bugs and Malfunctions + + +

+ Revert "Fix erroneous splitting of emulator path"

+

+ Own Id: OTP-13202

+
+ +

+ Fix HiPE enabled emulator for FreeBSD.

+

+ Own Id: OTP-13204 Aux Id: pr926

+
+
+
+ +
+
Erts 7.2
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 37f58ad6bff2bf2bac4f3f20c2684e8cee66af03 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 15 Dec 2015 09:40:30 +0100 Subject: Light weight statistics of run queue lengths - statistics(total_run_queue_lengths) - statistics(run_queue_lengths) - statistics(total_active_tasks) - statistics(active_tasks) Conflicts: erts/emulator/beam/erl_process.c --- erts/doc/src/erlang.xml | 111 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 99 insertions(+), 12 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index c37ed3bea5..64eebec936 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5684,8 +5684,31 @@ true
Dest, Msg, []).

+ + Information about active processes and ports. + +

+ Returns a list where each element represents the amount + of active processes and ports on each run queue and its + associated scheduler. That is, the number of processes and + ports that are ready to run, or are currently running. The + element location in the list corresponds to the scheduler + and its run queue. The first element corresponds to scheduler + number 1 and so on. The information is not gathered + atomically. That is, the result is not necessarily a + consistent snapshot of the state, but instead quite + efficiently gathered. See also, + statistics(total_active_tasks), + statistics(run_queue_lengths), and + statistics(total_run_queue_lengths). +

+
+
+ + + Information about context switches.

Returns the total number of context switches since the @@ -5694,7 +5717,7 @@ true - + Information about exact reductions. @@ -5708,7 +5731,7 @@ true - + Information about garbage collection.

Returns information about garbage collection, for example:

@@ -5720,7 +5743,7 @@ true
- + Information about I/O.

Returns Input, @@ -5731,7 +5754,7 @@ true - + Information about reductions. @@ -5749,16 +5772,43 @@ true - - Information about the run-queue. - -

Returns the total length of run-queues, that is, the number - of processes that are ready to run on all available run-queues.

+ + Information about the run-queues. + +

+ Returns the total length of the run-queues. That is, the number + of processes and ports that are ready to run on all available + run-queues. The information is gathered atomically. That + is, the result is a consistent snapshot of the state, but + this operation is much more expensive compared to + statistics(total_run_queue_lengths). + This especially when a large amount of schedulers is used. +

- + + Information about the run-queue lengths. + +

+ Returns a list where each element represents the amount + of processes and ports ready to run for each run queue. The + element location in the list corresponds to the run queue + of a scheduler. The first element corresponds to the run + queue of scheduler number 1 and so on. The information is + not gathered atomically. That is, the result is + not necessarily a consistent snapshot of the state, but + instead quite efficiently gathered. See also, + statistics(total_run_queue_lengths), + statistics(active_tasks), and + statistics(total_active_tasks). +

+
+
+ + + Information about runtime.

Returns information about runtime, in milliseconds.

@@ -5773,7 +5823,7 @@ true
- + Information about each schedulers work time. @@ -5844,7 +5894,44 @@ ok - + + Information about active processes and ports. + +

+ Returns the total amount of active processes and ports in + the system. That is, the number of processes and ports that + are ready to run, or are currently running. The information + is not gathered atomically. That is, the result + is not necessarily a consistent snapshot of the state, but + instead quite efficiently gathered. See also, + statistics(active_tasks), + statistics(run_queue_lengths), and + statistics(total_run_queue_lengths). +

+
+
+ + + + Information about the run-queue lengths. + +

+ Returns the total length of the run-queues. That is, the number + of processes and ports that are ready to run on all available + run-queues. The information is not gathered atomically. + That is, the result is not necessarily a consistent snapshot of + the state, but much more efficiently gathered compared to + statistics(run_queue). + See also, + statistics(run_queue_lengths), + statistics(total_active_tasks), and + statistics(active_tasks). +

+
+
+ + + Information about wall clock.

Returns information about wall clock. wall_clock can -- cgit v1.2.3 From f5c9dd660f3f098ba1e2a4110be594013a6dff11 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Thu, 14 Jan 2016 12:07:39 +0100 Subject: Add documentation of '-path' flag to 'erl' This flag replaces the path specified in the boot script. It has always existed, but was earlier only documented in SASL (script). --- erts/doc/src/erl.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index ec4a0dee05..e8621fecc3 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -382,6 +382,11 @@ similar to . See code(3).

+ + +

Replaces the path specified in the boot script. See + script(4).

+

Starts Erlang with a remote shell connected to .

-- cgit v1.2.3 From 43a7421c36d3feddb238b92426f938f11ef91174 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 14 Jan 2016 16:10:38 +0100 Subject: erts: Correct faulty doc for erlang:trace/3 The entire MFA tuple is replaced with 0, not just Arity. --- erts/doc/src/erlang.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index c37ed3bea5..20184bd7f3 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8182,14 +8182,14 @@ timestamp() ->

When Pid is scheduled to run. The process runs in function {M, F, Arity}. On some rare occasions, the current function cannot be determined, - then the last element Arity is 0.

+ then the last element is 0.

{trace, Pid, out, {M, F, Arity} | 0}

When Pid is scheduled out. The process was running in function {M, F, Arity}. On some rare occasions, the current function cannot be determined, then the last - element Arity is 0.

+ element is 0.

{trace, Pid, gc_start, Info} -- cgit v1.2.3 From 34e02fed50bbaa2af7b1828968b6ec02a54e98c8 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 20 Jan 2016 09:54:00 +0100 Subject: erts: Improve the documentation of the abstract format --- erts/doc/src/absform.xml | 240 ++++++++++++++++++++++++++--------------------- 1 file changed, 131 insertions(+), 109 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 1c0c3e1319..3f47b3061b 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -4,7 +4,7 @@
- 20012015 + 20012016 Ericsson AB. All Rights Reserved. @@ -80,12 +80,15 @@ Rep(F) = {attribute,LINE,import,{Mod,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}}. If F is an attribute -export_type([Type_1/A_1, ..., Type_k/A_k]), then Rep(F) = {attribute,LINE,export_type,[{Type_1,A_1}, ..., {Type_k,A_k}]}. + If F is an attribute -optional_callbacks([Fun_1/A_1, ..., Fun_k/A_k]), then + Rep(F) = {attribute,LINE,optional_callbacks,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}. If F is an attribute -compile(Options), then Rep(F) = {attribute,LINE,compile,Options}. If F is an attribute -file(File,Line), then Rep(F) = {attribute,LINE,file,{File,Line}}. If F is a record declaration - -record(Name,{V_1, ..., V_k}), then Rep(F) = + -record(Name,{V_1, ..., V_k}), + where each V_i is a record field, then Rep(F) = {attribute,LINE,record,{Name,[Rep(V_1), ..., Rep(V_k)]}}. For Rep(V), see below. If F is a type declaration @@ -173,12 +176,12 @@
Patterns -

If Ps is a sequence of patterns P_1, ..., P_k, then +

If Ps is a sequence of patterns P_1, ..., P_k, then Rep(Ps) = [Rep(P_1), ..., Rep(P_k)]. Such sequences occur as the list of arguments to a function or fun.

Individual patterns are represented as follows:

- If P is an atomic literal L, then Rep(P) = Rep(L). + If P is an atomic literal L, then Rep(P) = Rep(L). If P is a compound pattern P_1 = P_2, then Rep(P) = {match,LINE,Rep(P_1),Rep(P_2)}. If P is a variable pattern V, then @@ -211,6 +214,10 @@ {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(P_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(P_k)}]}. If P is #Name.Field, then Rep(P) = {record_index,LINE,Name,Rep(Field)}. + If P is a map pattern #{A_1, ..., A_k}, where each + A_i is an association P_i_1 := P_i_2, then Rep(P) = + {map,LINE,[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see + below. If P is ( P_0 ), then Rep(P) = Rep(P_0), that is, patterns cannot be distinguished from their bodies. @@ -221,11 +228,11 @@
Expressions -

A body B is a sequence of expressions E_1, ..., E_k, and - Rep(B) = [Rep(E_1), ..., Rep(E_k)].

+

A body B is a nonempty sequence of expressions E_1, ..., E_k, + and Rep(B) = [Rep(E_1), ..., Rep(E_k)].

An expression E is one of the following alternatives:

- If P is an atomic literal L, then Rep(P) = Rep(L). + If E is an atomic literal L, then Rep(E) = Rep(L). If E is P = E_0, then Rep(E) = {match,LINE,Rep(P),Rep(E_0)}. If E is a variable V, then Rep(E) = {var,LINE,A}, @@ -256,14 +263,16 @@ Rep(E) = {record_index,LINE,Name,Rep(Field)}. If E is E_0#Name.Field, then Rep(E) = {record_field,LINE,Rep(E_0),Name,Rep(Field)}. - If E is #{W_1, ..., W_k} where each - W_i is a map assoc or exact field, then Rep(E) = - {map,LINE,[Rep(W_1), ..., Rep(W_k)]}. For Rep(W), see + If E is a map creation #{A_1, ..., A_k}, + where each A_i is an association E_i_1 => E_i_2 + or E_i_1 := E_i_2, then Rep(E) = + {map,LINE,[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see below. - If E is E_0#{W_1, ..., W_k} where - W_i is a map assoc or exact field, then Rep(E) = - {map,LINE,Rep(E_0),[Rep(W_1), ..., Rep(W_k)]}. - For Rep(W), see below. + If E is a map update E_0#{A_1, ..., A_k}, + where each A_i is an association E_i_1 => E_i_2 + or E_i_1 := E_i_2, then Rep(E) = + {map,LINE,Rep(E_0),[Rep(A_1), ..., Rep(A_k)]}. + For Rep(A), see below. If E is catch E_0, then Rep(E) = {'catch',LINE,Rep(E_0)}. If E is E_0(E_1, ..., E_k), then @@ -271,15 +280,15 @@ If E is E_m:E_0(E_1, ..., E_k), then Rep(E) = {call,LINE,{remote,LINE,Rep(E_m),Rep(E_0)},[Rep(E_1), ..., Rep(E_k)]}. - If E is a list comprehension [E_0 || W_1, ..., W_k], - where each W_i is a generator or a filter, then Rep(E) = - {lc,LINE,Rep(E_0),[Rep(W_1), ..., Rep(W_k)]}. For Rep(W), see + If E is a list comprehension [E_0 || Q_1, ..., Q_k], + where each Q_i is a qualifier, then Rep(E) = + {lc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. For Rep(Q), see below. If E is a binary comprehension - <<E_0 || W_1, ..., W_k>>, - where each W_i is a generator or a filter, then - Rep(E) = {bc,LINE,Rep(E_0),[Rep(W_1), ..., Rep(W_k)]}. - For Rep(W), see below. + <<E_0 || Q_1, ..., Q_k>>, + where each Q_i is a qualifier, then + Rep(E) = {bc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. + For Rep(Q), see below. If E is begin B end, where B is a body, then Rep(E) = {block,LINE,Rep(B)}. If E is if Ic_1 ; ... ; Ic_k end, @@ -311,7 +320,7 @@ {'try',LINE,Rep(B),[],[Rep(Tc_1), ..., Rep(Tc_k)],Rep(A)}. If E is try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n after A end, where B and A are a bodies, - each Cc_i is a case clause and + each Cc_i is a case clause, and each Tc_j is a catch clause then Rep(E) = {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[Rep(Tc_1), ..., Rep(Tc_n)],Rep(A)}. @@ -328,10 +337,10 @@ {'fun',LINE,{function,Rep(Module),Rep(Name),Rep(Arity)}}. (Before the R15 release: Rep(E) = {'fun',LINE,{function,Module,Name,Arity}}.) - If E is fun Fc_1 ; ... ; Fc_k end + If E is fun Fc_1 ; ... ; Fc_k end, where each Fc_i is a function clause then Rep(E) = {'fun',LINE,{clauses,[Rep(Fc_1), ..., Rep(Fc_k)]}}. - If E is fun Name Fc_1 ; ... ; Name Fc_k end + If E is fun Name Fc_1 ; ... ; Name Fc_k end, where Name is a variable and each Fc_i is a function clause then Rep(E) = {named_fun,LINE,Name,[Rep(Fc_1), ..., Rep(Fc_k)]}. @@ -342,46 +351,43 @@
- Generators and Filters -

When W is a generator or a filter (in the body of a list or - binary comprehension), then:

+ Qualifiers +

A qualifier Q is one of the following alternatives:

- If W is a generator P <- E, where P is + If Q is a generator P <- E, where P is a pattern and E is an expression, then - Rep(W) = {generate,LINE,Rep(P),Rep(E)}. - If W is a generator P <= E, where P is + Rep(Q) = {generate,LINE,Rep(P),Rep(E)}. + If Q is a generator P <= E, where P is a pattern and E is an expression, then - Rep(W) = {b_generate,LINE,Rep(P),Rep(E)}. - If W is a filter E, which is an expression, then - Rep(W) = Rep(E). + Rep(Q) = {b_generate,LINE,Rep(P),Rep(E)}. + If Q is a filter E, where E is an expression, then + Rep(Q) = Rep(E).
Binary Element Type Specifiers

A type specifier list TSL for a binary element is a sequence of type - specifiers TS_1 - ... - TS_k. + specifiers TS_1 - ... - TS_k, and Rep(TSL) = [Rep(TS_1), ..., Rep(TS_k)].

-

When TS is a type specifier for a binary element, then:

- If TS is an atom A, then Rep(TS) = A. - If TS is a couple A:Value where A is an atom - and Value is an integer, then Rep(TS) = - {A,Value}. + If TS is a type specifier A, where A is an atom, + then Rep(TS) = A. + If TS is a type specifier A:Value, + where A is an atom and Value is an integer, + then Rep(TS) = {A,Value}.
- Map Assoc and Exact Fields -

When W is an assoc or exact field (in the body of a map), then:

+ Associations +

An association A is one of the following alternatives:

- If W is an assoc field K => V, where - K and V are both expressions, - then Rep(W) = {map_field_assoc,LINE,Rep(K),Rep(V)}. + If A is an association K => V, + then Rep(A) = {map_field_assoc,LINE,Rep(K),Rep(V)}. - If W is an exact field K := V, where - K and V are both expressions, - then Rep(W) = {map_field_exact,LINE,Rep(K),Rep(V)}. + If A is an association K := V, + then Rep(A) = {map_field_exact,LINE,Rep(K),Rep(V)}.
@@ -393,37 +399,37 @@ and catch clauses.

A clause C is one of the following alternatives:

- If C is a function clause ( Ps ) -> B + If C is a function clause ( Ps ) -> B, where Ps is a pattern sequence and B is a body, then Rep(C) = {clause,LINE,Rep(Ps),[],Rep(B)}. - If C is a function clause ( Ps ) when Gs -> B + If C is a function clause ( Ps ) when Gs -> B, where Ps is a pattern sequence, Gs is a guard sequence and B is a body, then Rep(C) = {clause,LINE,Rep(Ps),Rep(Gs),Rep(B)}. - If C is an if clause Gs -> B + If C is an if clause Gs -> B, where Gs is a guard sequence and B is a body, then Rep(C) = {clause,LINE,[],Rep(Gs),Rep(B)}. - If C is a case clause P -> B + If C is a case clause P -> B, where P is a pattern and B is a body, then Rep(C) = {clause,LINE,[Rep(P)],[],Rep(B)}. - If C is a case clause P when Gs -> B + If C is a case clause P when Gs -> B, where P is a pattern, Gs is a guard sequence and B is a body, then Rep(C) = {clause,LINE,[Rep(P)],Rep(Gs),Rep(B)}. - If C is a catch clause P -> B + If C is a catch clause P -> B, where P is a pattern and B is a body, then Rep(C) = {clause,LINE,[Rep({throw,P,_})],[],Rep(B)}. - If C is a catch clause X : P -> B + If C is a catch clause X : P -> B, where X is an atomic literal or a variable pattern, - P is a pattern and B is a body, then + P is a pattern, and B is a body, then Rep(C) = {clause,LINE,[Rep({X,P,_})],[],Rep(B)}. - If C is a catch clause P when Gs -> B - where P is a pattern, Gs is a guard sequence + If C is a catch clause P when Gs -> B, + where P is a pattern, Gs is a guard sequence, and B is a body, then Rep(C) = {clause,LINE,[Rep({throw,P,_})],Rep(Gs),Rep(B)}. - If C is a catch clause X : P when Gs -> B + If C is a catch clause X : P when Gs -> B, where X is an atomic literal or a variable pattern, - P is a pattern, Gs is a guard sequence + P is a pattern, Gs is a guard sequence, and B is a body, then Rep(C) = {clause,LINE,[Rep({X,P,_})],Rep(Gs),Rep(B)}. @@ -439,7 +445,7 @@ [Rep(Gt_1), ..., Rep(Gt_k)].

A guard test Gt is one of the following alternatives:

- If Gt is an atomic literal L, then Rep(Gt) = Rep(L). + If Gt is an atomic literal L, then Rep(Gt) = Rep(L). If Gt is a variable pattern V, then Rep(Gt) = {var,LINE,A}, where A is an atom with a printname consisting of the same characters as V. @@ -467,15 +473,21 @@ Rep(Gt) = {record_index,LINE,Name,Rep(Field)}. If Gt is Gt_0#Name.Field, then Rep(Gt) = {record_field,LINE,Rep(Gt_0),Name,Rep(Field)}. + If Gt is a map creation #{A_1, ..., A_k}, + where each A_i is an association Gt_i_1 => Gt_i_2 + or Gt_i_1 := Gt_i_2, then Rep(Gt) = + {map,LINE,[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see + above. + If Gt is a map update Gt_0#{A_1, ..., A_k}, where each + A_i is an association Gt_i_1 => Gt_i_2 + or Gt_i_1 := Gt_i_2, then Rep(Gt) = + {map,LINE,Rep(Gt_0),[Rep(A_1), ..., Rep(A_k)]}. + For Rep(A), see above. If Gt is A(Gt_1, ..., Gt_k), where A is an atom, then Rep(Gt) = {call,LINE,Rep(A),[Rep(Gt_1), ..., Rep(Gt_k)]}. If Gt is A_m:A(Gt_1, ..., Gt_k), where A_m is the atom erlang and A is an atom or an operator, then Rep(Gt) = {call,LINE,{remote,LINE,Rep(A_m),Rep(A)},[Rep(Gt_1), ..., Rep(Gt_k)]}. - If Gt is {A_m,A}(Gt_1, ..., Gt_k), where A_m is - the atom erlang and A is an atom or an operator, then - Rep(Gt) = {call,LINE,Rep({A_m,A}),[Rep(Gt_1), ..., Rep(Gt_k)]}. - If Gt is ( Gt_0 ), then Rep(Gt) = Rep(Gt_0), that is, parenthesized guard tests cannot be distinguished from their bodies. @@ -487,21 +499,20 @@
Types - If T is an annotated type Anno :: Type, - where Anno is a variable and - Type is a type, then Rep(T) = - {ann_type,LINE,[Rep(Anno),Rep(Type)]}. + If T is an annotated type A :: T_0, + where A is a variable, then Rep(T) = + {ann_type,LINE,[Rep(A),Rep(T_0)]}. If T is an atom or integer literal L, then Rep(T) = Rep(L). - If T is L Op R, - where Op is a binary operator and L and R - are types (this is an occurrence of an expression that can be - evaluated to an integer at compile time), then - Rep(T) = {op,LINE,Op,Rep(L),Rep(R)}. - If T is Op A, where Op is a - unary operator and A is a type (this is an occurrence of + If T is an operator type T_1 Op T_2, + where Op is a binary operator (this is an occurrence of + an expression that can be evaluated to an integer at compile + time), then + Rep(T) = {op,LINE,Op,Rep(T_1),Rep(T_2)}. + If T is an operator type Op T_0, where Op is a + unary operator (this is an occurrence of an expression that can be evaluated to an integer at compile time), - then Rep(T) = {op,LINE,Op,Rep(A)}. + then Rep(T) = {op,LINE,Op,Rep(T_0)}. If T is a bitstring type <<_:M,_:_*N>>, where M and N are singleton integer types, then Rep(T) = {type,LINE,binary,[Rep(M),Rep(N)]}. @@ -509,53 +520,44 @@ {type,Line,nil,[]}. If T is a fun type fun(), then Rep(T) = {type,LINE,'fun',[]}. - If T is a fun type fun((...) -> B), - where B is a type, then - Rep(T) = {type,LINE,'fun',[{type,LINE,any},Rep(B)]}. + If T is a fun type fun((...) -> T_0), then + Rep(T) = {type,LINE,'fun',[{type,LINE,any},Rep(T_0)]}. If T is a fun type fun(Ft), where Ft is a function type, - then Rep(T) = Rep(Ft). + then Rep(T) = Rep(Ft). For Rep(Ft), see below. If T is an integer range type L .. H, where L and H are singleton integer types, then Rep(T) = {type,LINE,range,[Rep(L),Rep(H)]}. If T is a map type map(), then Rep(T) = {type,LINE,map,any}. - If T is a map type #{P_1, ..., P_k}, where each - P_i is a map pair type, then Rep(T) = - {type,LINE,map,[Rep(P_1), ..., Rep(P_k)]}. - If T is a map pair type K => V, where - K and V are types, then Rep(T) = - {type,LINE,map_field_assoc,[Rep(K),Rep(V)]}. - If T is a predefined (or built-in) type N(A_1, ..., A_k), - where each A_i is a type, then Rep(T) = - {type,LINE,N,[Rep(A_1), ..., Rep(A_k)]}. + If T is a map type #{A_1, ..., A_k}, where each + A_i is an association type, then Rep(T) = + {type,LINE,map,[Rep(A_1), ..., Rep(A_k)]}. + For Rep(A), see below. + If T is a predefined (or built-in) type N(T_1, ..., T_k), + then Rep(T) = + {type,LINE,N,[Rep(T_1), ..., Rep(T_k)]}. If T is a record type #Name{F_1, ..., F_k}, where each F_i is a record field type, then Rep(T) = {type,LINE,record,[Rep(Name),Rep(F_1), ..., Rep(F_k)]}. - - If T is a record field type Name :: Type, - where Type is a type, then Rep(T) = - {type,LINE,field_type,[Rep(Name),Rep(Type)]}. - If T is a remote type M:N(A_1, ..., A_k), where - each A_i is a type, then Rep(T) = - {remote_type,LINE,[Rep(M),Rep(N),[Rep(A_1), ..., Rep(A_k)]]}. + For Rep(F), see below. + If T is a remote type M:N(T_1, ..., T_k), then Rep(T) = + {remote_type,LINE,[Rep(M),Rep(N),[Rep(T_1), ..., Rep(T_k)]]}. If T is a tuple type tuple(), then Rep(T) = {type,LINE,tuple,any}. - If T is a tuple type {A_1, ..., A_k}, where - each A_i is a type, then Rep(T) = - {type,LINE,tuple,[Rep(A_1), ..., Rep(A_k)]}. - If T is a type union T_1 | ... | T_k, - where each T_i is a type, then Rep(T) = + If T is a tuple type {T_1, ..., T_k}, then Rep(T) = + {type,LINE,tuple,[Rep(T_1), ..., Rep(T_k)]}. + If T is a type union T_1 | ... | T_k, then Rep(T) = {type,LINE,union,[Rep(T_1), ..., Rep(T_k)]}. If T is a type variable V, then Rep(T) = {var,LINE,A}, where A is an atom with a printname consisting of the same characters as V. A type variable is any variable except underscore (_). - If T is a user-defined type N(A_1, ..., A_k), - where each A_i is a type, then Rep(T) = - {user_type,LINE,N,[Rep(A_1), ..., Rep(A_k)]}. + If T is a user-defined type N(T_1, ..., T_k), + then Rep(T) = + {user_type,LINE,N,[Rep(T_1), ..., Rep(T_k)]}. If T is ( T_0 ), then Rep(T) = Rep(T_0), that is, parenthesized types cannot be distinguished from their bodies. @@ -563,15 +565,17 @@
Function Types +

A function type Ft is one of the following alternatives:

If Ft is a constrained function type Ft_1 when Fc, where Ft_1 is a function type and Fc is a function constraint, then Rep(T) = - {type,LINE,bounded_fun,[Rep(Ft_1),Rep(Fc)]}. - If Ft is a function type (A_1, ..., A_n) -> B, - where each A_i and B are types, then - Rep(Ft) = {type,LINE,'fun',[{type,LINE,product,[Rep(A_1), - ..., Rep(A_n)]},Rep(B)]}. + {type,LINE,bounded_fun,[Rep(Ft_1),Rep(Fc)]}. + For Rep(Fc), see below. + If Ft is a function type (T_1, ..., T_n) -> T_0, + where each T_i is a type, then + Rep(Ft) = {type,LINE,'fun',[{type,LINE,product,[Rep(T_1), + ..., Rep(T_n)]},Rep(T_0)]}.
@@ -587,6 +591,24 @@
+ +
+ Association Types + + If A is an association type K => V, where + K and V are types, then Rep(A) = + {type,LINE,map_field_assoc,[Rep(K),Rep(V)]}. + +
+ +
+ Record Field Types + + If F is a record field type Name :: Type, + where Type is a type, then Rep(F) = + {type,LINE,field_type,[Rep(Name),Rep(Type)]}. + +
-- cgit v1.2.3 From 6e2d941bf278191c11f6d1cebdfab5e51419d734 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 20 Jan 2016 09:55:21 +0100 Subject: erts: Improve readability of The Abstract Format More verbose, but hopefully more readable than before. --- erts/doc/src/absform.xml | 420 +++++++++++++++++++++++++---------------------- 1 file changed, 228 insertions(+), 192 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 3f47b3061b..ccdecf44ec 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -68,34 +68,29 @@ If D is a module declaration consisting of the forms F_1, ..., F_k, then Rep(D) = [Rep(F_1), ..., Rep(F_k)]. - If F is an attribute -module(Mod), then - Rep(F) = {attribute,LINE,module,Mod}. If F is an attribute -behavior(Behavior), then Rep(F) = {attribute,LINE,behavior,Behavior}. If F is an attribute -behaviour(Behaviour), then Rep(F) = {attribute,LINE,behaviour,Behaviour}. + If F is an attribute -compile(Options), then + Rep(F) = {attribute,LINE,compile,Options}. If F is an attribute -export([Fun_1/A_1, ..., Fun_k/A_k]), then Rep(F) = {attribute,LINE,export,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}. - If F is an attribute -import(Mod,[Fun_1/A_1, ..., Fun_k/A_k]), then - Rep(F) = {attribute,LINE,import,{Mod,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}}. If F is an attribute -export_type([Type_1/A_1, ..., Type_k/A_k]), then Rep(F) = {attribute,LINE,export_type,[{Type_1,A_1}, ..., {Type_k,A_k}]}. + If F is an attribute -import(Mod,[Fun_1/A_1, ..., Fun_k/A_k]), then + Rep(F) = {attribute,LINE,import,{Mod,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}}. + If F is an attribute -module(Mod), then + Rep(F) = {attribute,LINE,module,Mod}. If F is an attribute -optional_callbacks([Fun_1/A_1, ..., Fun_k/A_k]), then Rep(F) = {attribute,LINE,optional_callbacks,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}. - If F is an attribute -compile(Options), then - Rep(F) = {attribute,LINE,compile,Options}. If F is an attribute -file(File,Line), then Rep(F) = {attribute,LINE,file,{File,Line}}. - If F is a record declaration - -record(Name,{V_1, ..., V_k}), - where each V_i is a record field, then Rep(F) = - {attribute,LINE,record,{Name,[Rep(V_1), ..., Rep(V_k)]}}. - For Rep(V), see below. - If F is a type declaration - -Type Name(V_1, ..., V_k) :: T, where - Type is either the atom type or the atom opaque, - each V_i is a variable, and T is a type, then Rep(F) = - {attribute,LINE,Type,{Name,Rep(T),[Rep(V_1), ..., Rep(V_k)]}}. + If F is a function declaration + Name Fc_1 ; ... ; Name Fc_k, + where each Fc_i is a function clause with a + pattern sequence of the same length Arity, then + Rep(F) = {function,LINE,Name,Arity,[Rep(Fc_1), ...,Rep(Fc_k)]}. If F is a function specification -Spec Name Ft_1; ...; Ft_k, @@ -112,15 +107,20 @@ Arity, then Rep(F) = {attribute,Line,spec,{{Mod,Name,Arity},[Rep(Ft_1), ..., Rep(Ft_k)]}}. + If F is a record declaration + -record(Name,{V_1, ..., V_k}), + where each V_i is a record field, then Rep(F) = + {attribute,LINE,record,{Name,[Rep(V_1), ..., Rep(V_k)]}}. + For Rep(V), see below. + If F is a type declaration + -Type Name(V_1, ..., V_k) :: T, where + Type is either the atom type or the atom opaque, + each V_i is a variable, and T is a type, then Rep(F) = + {attribute,LINE,Type,{Name,Rep(T),[Rep(V_1), ..., Rep(V_k)]}}. + If F is a wild attribute -A(T), then Rep(F) = {attribute,LINE,A,T}.

- If F is a function declaration - Name Fc_1 ; ... ; Name Fc_k, - where each Fc_i is a function clause with a - pattern sequence of the same length Arity, then - Rep(F) = {function,LINE,Name,Arity,[Rep(Fc_1), ...,Rep(Fc_k)]}. -
@@ -160,15 +160,15 @@

There are five kinds of atomic literals, which are represented in the same way in patterns, expressions and guards:

- If L is an integer or character literal, then - Rep(L) = {integer,LINE,L}. + If L is an atom literal, then + Rep(L) = {atom,LINE,L}. If L is a float literal, then Rep(L) = {float,LINE,L}. + If L is an integer or character literal, then + Rep(L) = {integer,LINE,L}. If L is a string literal consisting of the characters C_1, ..., C_k, then Rep(L) = {string,LINE,[C_1, ..., C_k]}. - If L is an atom literal, then - Rep(L) = {atom,LINE,L}.

Note that negative integer and float literals do not occur as such; they are parsed as an application of the unary negation operator.

@@ -182,45 +182,53 @@

Individual patterns are represented as follows:

If P is an atomic literal L, then Rep(P) = Rep(L). + If P is a binary pattern + <<P_1:Size_1/TSL_1, ..., P_k:Size_k/TSL_k>>, where each + Size_i is an expression that can be evaluated to an integer + and each TSL_i is a type specificer list, then + Rep(P) = {bin,LINE,[{bin_element,LINE,Rep(P_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(P_k),Rep(Size_k),Rep(TSL_k)}]}. + For Rep(TSL), see below. + An omitted Size_i is represented by default. + An omitted TSL_i is represented by default. If P is a compound pattern P_1 = P_2, then Rep(P) = {match,LINE,Rep(P_1),Rep(P_2)}. - If P is a variable pattern V, then - Rep(P) = {var,LINE,A}, - where A is an atom with a printname consisting of the same characters as - V. - If P is a universal pattern _, then - Rep(P) = {var,LINE,'_'}. - If P is a tuple pattern {P_1, ..., P_k}, then - Rep(P) = {tuple,LINE,[Rep(P_1), ..., Rep(P_k)]}. - If P is a nil pattern [], then - Rep(P) = {nil,LINE}. If P is a cons pattern [P_h | P_t], then Rep(P) = {cons,LINE,Rep(P_h),Rep(P_t)}. - If E is a binary pattern <<P_1:Size_1/TSL_1, ..., P_k:Size_k/TSL_k>>, then - Rep(E) = {bin,LINE,[{bin_element,LINE,Rep(P_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(P_k),Rep(Size_k),Rep(TSL_k)}]}. - For Rep(TSL), see below. - An omitted Size is represented by default. An omitted TSL - (type specifier list) is represented by default. - If P is P_1 Op P_2, where Op is a binary operator (this - is either an occurrence of ++ applied to a literal string or character - list, or an occurrence of an expression that can be evaluated to a number - at compile time), - then Rep(P) = {op,LINE,Op,Rep(P_1),Rep(P_2)}. - If P is Op P_0, where Op is a unary operator (this is an - occurrence of an expression that can be evaluated to a number at compile - time), then Rep(P) = {op,LINE,Op,Rep(P_0)}. - If P is a record pattern #Name{Field_1=P_1, ..., Field_k=P_k}, - then Rep(P) = - {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(P_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(P_k)}]}. - If P is #Name.Field, then - Rep(P) = {record_index,LINE,Name,Rep(Field)}. If P is a map pattern #{A_1, ..., A_k}, where each A_i is an association P_i_1 := P_i_2, then Rep(P) = {map,LINE,[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see below. - If P is ( P_0 ), then + If P is a nil pattern [], then + Rep(P) = {nil,LINE}. + If P is an operator pattern P_1 Op P_2, + where Op is a binary operator (this is either an occurrence + of ++ applied to a literal string or character + list, or an occurrence of an expression that can be evaluated to a number + at compile time), + then Rep(P) = {op,LINE,Op,Rep(P_1),Rep(P_2)}. + If P is an operator pattern Op P_0, + where Op is a unary operator (this is an occurrence of + an expression that can be evaluated to a number at compile + time), then Rep(P) = {op,LINE,Op,Rep(P_0)}. + If P is a parenthesized pattern ( P_0 ), then Rep(P) = Rep(P_0), - that is, patterns cannot be distinguished from their bodies. + that is, parenthesized patterns cannot be distinguished from their + bodies. + If P is a record field index pattern #Name.Field, + where Field is an atom, then + Rep(P) = {record_index,LINE,Name,Rep(Field)}. + If P is a record pattern + #Name{Field_1=P_1, ..., Field_k=P_k}, + where each Field_i is an atom or _, then Rep(P) = + {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(P_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(P_k)}]}. + If P is a tuple pattern {P_1, ..., P_k}, then + Rep(P) = {tuple,LINE,[Rep(P_1), ..., Rep(P_k)]}. + If P is a universal pattern _, then + Rep(P) = {var,LINE,'_'}. + If P is a variable pattern V, then + Rep(P) = {var,LINE,A}, + where A is an atom with a printname consisting of the same characters as + V.

Note that every pattern has the same source form as some expression, and is represented the same way as the corresponding expression.

@@ -233,36 +241,58 @@

An expression E is one of the following alternatives:

If E is an atomic literal L, then Rep(E) = Rep(L). - If E is P = E_0, then - Rep(E) = {match,LINE,Rep(P),Rep(E_0)}. - If E is a variable V, then Rep(E) = {var,LINE,A}, - where A is an atom with a printname consisting of the same - characters as V. - If E is a tuple skeleton {E_1, ..., E_k}, then - Rep(E) = {tuple,LINE,[Rep(E_1), ..., Rep(E_k)]}. - If E is [], then - Rep(E) = {nil,LINE}. + If E is a binary comprehension + <<E_0 || Q_1, ..., Q_k>>, + where each Q_i is a qualifier, then + Rep(E) = {bc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. + For Rep(Q), see below. + If E is a binary constructor <<E_1:Size_1/TSL_1, ..., E_k:Size_k/TSL_k>>, + where each Size_i is an expression and each + TSL_i is a type specificer list, then Rep(E) = + {bin,LINE,[{bin_element,LINE,Rep(E_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(E_k),Rep(Size_k),Rep(TSL_k)}]}. + For Rep(TSL), see below. + An omitted Size_i is represented by default. + An omitted TSL_i is represented by default. + If E is a block expression begin B end, + where B is a body, then + Rep(E) = {block,LINE,Rep(B)}. + If E is a case expression case E_0 of Cc_1 ; ... ; Cc_k end, + where E_0 is an expression and each Cc_i is a + case clause then Rep(E) = + {'case',LINE,Rep(E_0),[Rep(Cc_1), ..., Rep(Cc_k)]}. + If E is a catch expression catch E_0, then + Rep(E) = {'catch',LINE,Rep(E_0)}. If E is a cons skeleton [E_h | E_t], then Rep(E) = {cons,LINE,Rep(E_h),Rep(E_t)}. - If E is a binary constructor <<V_1:Size_1/TSL_1, ..., V_k:Size_k/TSL_k>>, then Rep(E) = - {bin,LINE,[{bin_element,LINE,Rep(V_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(V_k),Rep(Size_k),Rep(TSL_k)}]}. - For Rep(TSL), see below. - An omitted Size is represented by default. An omitted TSL - (type specifier list) is represented by default. - If E is E_1 Op E_2, where Op is a binary operator, - then Rep(E) = {op,LINE,Op,Rep(E_1),Rep(E_2)}. - If E is Op E_0, where Op is a unary operator, then - Rep(E) = {op,LINE,Op,Rep(E_0)}. - If E is #Name{Field_1=E_1, ..., Field_k=E_k}, + If E is a fun expression fun Name/Arity, then + Rep(E) = {'fun',LINE,{function,Name,Arity}}. + If E is a fun expression + fun Module:Name/Arity, then Rep(E) = + {'fun',LINE,{function,Rep(Module),Rep(Name),Rep(Arity)}}. + (Before the R15 release: Rep(E) = + {'fun',LINE,{function,Module,Name,Arity}}.) + If E is a fun expression fun Fc_1 ; ... ; Fc_k end, + where each Fc_i is a function clause then Rep(E) = + {'fun',LINE,{clauses,[Rep(Fc_1), ..., Rep(Fc_k)]}}. + If E is a fun expression + fun Name Fc_1 ; ... ; Name Fc_k end, + where Name is a variable and each + Fc_i is a function clause then Rep(E) = + {named_fun,LINE,Name,[Rep(Fc_1), ..., Rep(Fc_k)]}. + + If E is a function call E_0(E_1, ..., E_k), then + Rep(E) = {call,LINE,Rep(E_0),[Rep(E_1), ..., Rep(E_k)]}. + If E is a function call E_m:E_0(E_1, ..., E_k), then Rep(E) = - {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(E_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(E_k)}]}. - If E is E_0#Name{Field_1=E_1, ..., Field_k=E_k}, then - Rep(E) = - {record,LINE,Rep(E_0),Name,[{record_field,LINE,Rep(Field_1),Rep(E_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(E_k)}]}. - If E is #Name.Field, then - Rep(E) = {record_index,LINE,Name,Rep(Field)}. - If E is E_0#Name.Field, then - Rep(E) = {record_field,LINE,Rep(E_0),Name,Rep(Field)}. + {call,LINE,{remote,LINE,Rep(E_m),Rep(E_0)},[Rep(E_1), ..., Rep(E_k)]}. + + If E is an if expression if Ic_1 ; ... ; Ic_k end, + where each Ic_i is an if clause then Rep(E) = + {'if',LINE,[Rep(Ic_1), ..., Rep(Ic_k)]}. + If E is a list comprehension [E_0 || Q_1, ..., Q_k], + where each Q_i is a qualifier, then Rep(E) = + {lc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. For Rep(Q), see + below. If E is a map creation #{A_1, ..., A_k}, where each A_i is an association E_i_1 => E_i_2 or E_i_1 := E_i_2, then Rep(E) = @@ -273,95 +303,92 @@ or E_i_1 := E_i_2, then Rep(E) = {map,LINE,Rep(E_0),[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see below. - If E is catch E_0, then - Rep(E) = {'catch',LINE,Rep(E_0)}. - If E is E_0(E_1, ..., E_k), then - Rep(E) = {call,LINE,Rep(E_0),[Rep(E_1), ..., Rep(E_k)]}. - If E is E_m:E_0(E_1, ..., E_k), then Rep(E) = - {call,LINE,{remote,LINE,Rep(E_m),Rep(E_0)},[Rep(E_1), ..., Rep(E_k)]}. - - If E is a list comprehension [E_0 || Q_1, ..., Q_k], - where each Q_i is a qualifier, then Rep(E) = - {lc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. For Rep(Q), see - below. - If E is a binary comprehension - <<E_0 || Q_1, ..., Q_k>>, - where each Q_i is a qualifier, then - Rep(E) = {bc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. - For Rep(Q), see below. - If E is begin B end, where B is a body, then - Rep(E) = {block,LINE,Rep(B)}. - If E is if Ic_1 ; ... ; Ic_k end, - where each Ic_i is an if clause then Rep(E) = - {'if',LINE,[Rep(Ic_1), ..., Rep(Ic_k)]}. - If E is case E_0 of Cc_1 ; ... ; Cc_k end, - where E_0 is an expression and each Cc_i is a - case clause then Rep(E) = - {'case',LINE,Rep(E_0),[Rep(Cc_1), ..., Rep(Cc_k)]}. - If E is try B catch Tc_1 ; ... ; Tc_k end, + If E is a match operator expression P = E_0, + where P is a pattern, then + Rep(E) = {match,LINE,Rep(P),Rep(E_0)}. + If E is nil, [], then + Rep(E) = {nil,LINE}. + If E is an operator expression E_1 Op E_2, + where Op is a binary operator other than the match + operator =, then + Rep(E) = {op,LINE,Op,Rep(E_1),Rep(E_2)}. + If E is an operator expression Op E_0, + where Op is a unary operator, then + Rep(E) = {op,LINE,Op,Rep(E_0)}. + If E is a parenthesized expression ( E_0 ), then + Rep(E) = Rep(E_0), that is, parenthesized + expressions cannot be distinguished from their bodies. + If E is a receive expression receive Cc_1 ; ... ; Cc_k end, + where each Cc_i is a case clause then Rep(E) = + {'receive',LINE,[Rep(Cc_1), ..., Rep(Cc_k)]}. + If E is a receive expression + receive Cc_1 ; ... ; Cc_k after E_0 -> B_t end, + where each Cc_i is a case clause, + E_0 is an expression and B_t is a body, then Rep(E) = + {'receive',LINE,[Rep(Cc_1), ..., Rep(Cc_k)],Rep(E_0),Rep(B_t)}. + If E is a record creation + #Name{Field_1=E_1, ..., Field_k=E_k}, + where each Field_i is an atom or _, then Rep(E) = + {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(E_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(E_k)}]}. + If E is a record field access E_0#Name.Field, + where Field is an atom, then + Rep(E) = {record_field,LINE,Rep(E_0),Name,Rep(Field)}. + If E is a record field index #Name.Field, + where Field is an atom, then + Rep(E) = {record_index,LINE,Name,Rep(Field)}. + If E is a record update + E_0#Name{Field_1=E_1, ..., Field_k=E_k}, + where each Field_i is an atom, then Rep(E) = + {record,LINE,Rep(E_0),Name,[{record_field,LINE,Rep(Field_1),Rep(E_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(E_k)}]}. + If E is a tuple skeleton {E_1, ..., E_k}, then + Rep(E) = {tuple,LINE,[Rep(E_1), ..., Rep(E_k)]}. + If E is a try expression try B catch Tc_1 ; ... ; Tc_k end, where B is a body and each Tc_i is a catch clause then Rep(E) = {'try',LINE,Rep(B),[],[Rep(Tc_1), ..., Rep(Tc_k)],[]}. - If E is try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n end, + If E is a try expression + try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n end, where B is a body, each Cc_i is a case clause and each Tc_j is a catch clause then Rep(E) = {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[Rep(Tc_1), ..., Rep(Tc_n)],[]}. - If E is try B after A end, + If E is a try expression try B after A end, where B and A are bodies then Rep(E) = {'try',LINE,Rep(B),[],[],Rep(A)}. - If E is try B of Cc_1 ; ... ; Cc_k after A end, + If E is a try expression + try B of Cc_1 ; ... ; Cc_k after A end, where B and A are a bodies and each Cc_i is a case clause then Rep(E) = {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[],Rep(A)}. - If E is try B catch Tc_1 ; ... ; Tc_k after A end, + If E is a try expression + try B catch Tc_1 ; ... ; Tc_k after A end, where B and A are bodies and each Tc_i is a catch clause then Rep(E) = {'try',LINE,Rep(B),[],[Rep(Tc_1), ..., Rep(Tc_k)],Rep(A)}. - If E is try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n after A end, + If E is a try expression + try B of Cc_1 ; ... ; Cc_k catch Tc_1 ; ... ; Tc_n after A end, where B and A are a bodies, each Cc_i is a case clause, and each Tc_j is a catch clause then Rep(E) = {'try',LINE,Rep(B),[Rep(Cc_1), ..., Rep(Cc_k)],[Rep(Tc_1), ..., Rep(Tc_n)],Rep(A)}. - If E is receive Cc_1 ; ... ; Cc_k end, - where each Cc_i is a case clause then Rep(E) = - {'receive',LINE,[Rep(Cc_1), ..., Rep(Cc_k)]}. - If E is receive Cc_1 ; ... ; Cc_k after E_0 -> B_t end, - where each Cc_i is a case clause, - E_0 is an expression and B_t is a body, then Rep(E) = - {'receive',LINE,[Rep(Cc_1), ..., Rep(Cc_k)],Rep(E_0),Rep(B_t)}. - If E is fun Name / Arity, then - Rep(E) = {'fun',LINE,{function,Name,Arity}}. - If E is fun Module:Name/Arity, then Rep(E) = - {'fun',LINE,{function,Rep(Module),Rep(Name),Rep(Arity)}}. - (Before the R15 release: Rep(E) = - {'fun',LINE,{function,Module,Name,Arity}}.) - If E is fun Fc_1 ; ... ; Fc_k end, - where each Fc_i is a function clause then Rep(E) = - {'fun',LINE,{clauses,[Rep(Fc_1), ..., Rep(Fc_k)]}}. - If E is fun Name Fc_1 ; ... ; Name Fc_k end, - where Name is a variable and each - Fc_i is a function clause then Rep(E) = - {named_fun,LINE,Name,[Rep(Fc_1), ..., Rep(Fc_k)]}. - - If E is ( E_0 ), then - Rep(E) = Rep(E_0), that is, parenthesized - expressions cannot be distinguished from their bodies. + If E is a variable V, then Rep(E) = {var,LINE,A}, + where A is an atom with a printname consisting of the same + characters as V.
Qualifiers

A qualifier Q is one of the following alternatives:

+ If Q is a filter E, where E is an expression, then + Rep(Q) = Rep(E). If Q is a generator P <- E, where P is a pattern and E is an expression, then Rep(Q) = {generate,LINE,Rep(P),Rep(E)}. If Q is a generator P <= E, where P is a pattern and E is an expression, then Rep(Q) = {b_generate,LINE,Rep(P),Rep(E)}. - If Q is a filter E, where E is an expression, then - Rep(Q) = Rep(E).
@@ -399,16 +426,6 @@ and catch clauses.

A clause C is one of the following alternatives:

- If C is a function clause ( Ps ) -> B, - where Ps is a pattern sequence and B is a body, then - Rep(C) = {clause,LINE,Rep(Ps),[],Rep(B)}. - If C is a function clause ( Ps ) when Gs -> B, - where Ps is a pattern sequence, - Gs is a guard sequence and B is a body, then - Rep(C) = {clause,LINE,Rep(Ps),Rep(Gs),Rep(B)}. - If C is an if clause Gs -> B, - where Gs is a guard sequence and B is a body, then - Rep(C) = {clause,LINE,[],Rep(Gs),Rep(B)}. If C is a case clause P -> B, where P is a pattern and B is a body, then Rep(C) = {clause,LINE,[Rep(P)],[],Rep(B)}. @@ -432,6 +449,16 @@ P is a pattern, Gs is a guard sequence, and B is a body, then Rep(C) = {clause,LINE,[Rep({X,P,_})],Rep(Gs),Rep(B)}. + If C is a function clause ( Ps ) -> B, + where Ps is a pattern sequence and B is a body, then + Rep(C) = {clause,LINE,Rep(Ps),[],Rep(B)}. + If C is a function clause ( Ps ) when Gs -> B, + where Ps is a pattern sequence, + Gs is a guard sequence and B is a body, then + Rep(C) = {clause,LINE,Rep(Ps),Rep(Gs),Rep(B)}. + If C is an if clause Gs -> B, + where Gs is a guard sequence and B is a body, then + Rep(C) = {clause,LINE,[],Rep(Gs),Rep(B)}.
@@ -446,33 +473,23 @@

A guard test Gt is one of the following alternatives:

If Gt is an atomic literal L, then Rep(Gt) = Rep(L). - If Gt is a variable pattern V, then - Rep(Gt) = {var,LINE,A}, where A is an atom with - a printname consisting of the same characters as V. - If Gt is a tuple skeleton {Gt_1, ..., Gt_k}, then - Rep(Gt) = {tuple,LINE,[Rep(Gt_1), ..., Rep(Gt_k)]}. - If Gt is [], then Rep(Gt) = {nil,LINE}. - If Gt is a cons skeleton [Gt_h | Gt_t], then - Rep(Gt) = {cons,LINE,Rep(Gt_h),Rep(Gt_t)}. If Gt is a binary constructor - <<Gt_1:Size_1/TSL_1, ..., Gt_k:Size_k/TSL_k>>, then + <<Gt_1:Size_1/TSL_1, ..., Gt_k:Size_k/TSL_k>>, + where each Size_i is a guard test and each + TSL_i is a type specificer list, then Rep(Gt) = {bin,LINE,[{bin_element,LINE,Rep(Gt_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(Gt_k),Rep(Size_k),Rep(TSL_k)}]}. For Rep(TSL), see above. - An omitted Size is represented by default. - An omitted TSL (type specifier list) is represented - by default. - If Gt is Gt_1 Op Gt_2, where Op - is a binary operator, then Rep(Gt) = - {op,LINE,Op,Rep(Gt_1),Rep(Gt_2)}. - If Gt is Op Gt_0, where Op is a unary operator, then - Rep(Gt) = {op,LINE,Op,Rep(Gt_0)}. - If Gt is #Name{Field_1=Gt_1, ..., Field_k=Gt_k}, then - Rep(E) = - {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(Gt_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(Gt_k)}]}. - If Gt is #Name.Field, then - Rep(Gt) = {record_index,LINE,Name,Rep(Field)}. - If Gt is Gt_0#Name.Field, then - Rep(Gt) = {record_field,LINE,Rep(Gt_0),Name,Rep(Field)}. + An omitted Size_i is represented by default. + An omitted TSL_i is represented by default.
+ If Gt is a cons skeleton [Gt_h | Gt_t], then + Rep(Gt) = {cons,LINE,Rep(Gt_h),Rep(Gt_t)}. + If Gt is a function call A(Gt_1, ..., Gt_k), + where A is an atom, then Rep(Gt) = + {call,LINE,Rep(A),[Rep(Gt_1), ..., Rep(Gt_k)]}. + If Gt is a function call A_m:A(Gt_1, ..., Gt_k), + where A_m is the atom erlang and A is + an atom or an operator, then Rep(Gt) = + {call,LINE,{remote,LINE,Rep(A_m),Rep(A)},[Rep(Gt_1), ..., Rep(Gt_k)]}. If Gt is a map creation #{A_1, ..., A_k}, where each A_i is an association Gt_i_1 => Gt_i_2 or Gt_i_1 := Gt_i_2, then Rep(Gt) = @@ -483,14 +500,33 @@ or Gt_i_1 := Gt_i_2, then Rep(Gt) = {map,LINE,Rep(Gt_0),[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see above. - If Gt is A(Gt_1, ..., Gt_k), where A is an atom, then - Rep(Gt) = {call,LINE,Rep(A),[Rep(Gt_1), ..., Rep(Gt_k)]}. - If Gt is A_m:A(Gt_1, ..., Gt_k), where A_m is - the atom erlang and A is an atom or an operator, then - Rep(Gt) = {call,LINE,{remote,LINE,Rep(A_m),Rep(A)},[Rep(Gt_1), ..., Rep(Gt_k)]}. - If Gt is ( Gt_0 ), then + If Gt is nil, [], + then Rep(Gt) = {nil,LINE}. + If Gt is an operator guard test Gt_1 Op Gt_2, + where Op is a binary operator other than the match + operator =, then + Rep(Gt) = {op,LINE,Op,Rep(Gt_1),Rep(Gt_2)}. + If Gt is an operator guard test Op Gt_0, + where Op is a unary operator, then + Rep(Gt) = {op,LINE,Op,Rep(Gt_0)}. + If Gt is a parenthesized guard test ( Gt_0 ), then Rep(Gt) = Rep(Gt_0), that is, parenthesized guard tests cannot be distinguished from their bodies. + If Gt is a record creation + #Name{Field_1=Gt_1, ..., Field_k=Gt_k}, + where each Field_i is an atom or _, then Rep(Gt) = + {record,LINE,Name,[{record_field,LINE,Rep(Field_1),Rep(Gt_1)}, ..., {record_field,LINE,Rep(Field_k),Rep(Gt_k)}]}. + If Gt is a record field access Gt_0#Name.Field, + where Field is an atom, then + Rep(Gt) = {record_field,LINE,Rep(Gt_0),Name,Rep(Field)}. + If Gt is a record field index #Name.Field, + where Field is an atom, then + Rep(Gt) = {record_index,LINE,Name,Rep(Field)}. + If Gt is a tuple skeleton {Gt_1, ..., Gt_k}, then + Rep(Gt) = {tuple,LINE,[Rep(Gt_1), ..., Rep(Gt_k)]}. + If Gt is a variable pattern V, then + Rep(Gt) = {var,LINE,A}, where A is an atom with + a printname consisting of the same characters as V.

Note that every guard test has the same source form as some expression, and is represented the same way as the corresponding expression.

@@ -504,15 +540,6 @@ {ann_type,LINE,[Rep(A),Rep(T_0)]}.
If T is an atom or integer literal L, then Rep(T) = Rep(L). - If T is an operator type T_1 Op T_2, - where Op is a binary operator (this is an occurrence of - an expression that can be evaluated to an integer at compile - time), then - Rep(T) = {op,LINE,Op,Rep(T_1),Rep(T_2)}. - If T is an operator type Op T_0, where Op is a - unary operator (this is an occurrence of - an expression that can be evaluated to an integer at compile time), - then Rep(T) = {op,LINE,Op,Rep(T_0)}. If T is a bitstring type <<_:M,_:_*N>>, where M and N are singleton integer types, then Rep(T) = {type,LINE,binary,[Rep(M),Rep(N)]}. @@ -535,6 +562,18 @@ A_i is an association type, then Rep(T) = {type,LINE,map,[Rep(A_1), ..., Rep(A_k)]}. For Rep(A), see below. + If T is an operator type T_1 Op T_2, + where Op is a binary operator (this is an occurrence of + an expression that can be evaluated to an integer at compile + time), then + Rep(T) = {op,LINE,Op,Rep(T_1),Rep(T_2)}. + If T is an operator type Op T_0, where Op is a + unary operator (this is an occurrence of + an expression that can be evaluated to an integer at compile time), + then Rep(T) = {op,LINE,Op,Rep(T_0)}. + If T is ( T_0 ), then Rep(T) = Rep(T_0), + that is, parenthesized types cannot be distinguished from their + bodies. If T is a predefined (or built-in) type N(T_1, ..., T_k), then Rep(T) = {type,LINE,N,[Rep(T_1), ..., Rep(T_k)]}. @@ -558,9 +597,6 @@ If T is a user-defined type N(T_1, ..., T_k), then Rep(T) = {user_type,LINE,N,[Rep(T_1), ..., Rep(T_k)]}. - If T is ( T_0 ), then Rep(T) = Rep(T_0), - that is, parenthesized types cannot be distinguished from their - bodies.
-- cgit v1.2.3 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') 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 From 53dcd92be965d35ef53a27efda0597b2961921ba Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 20 Jan 2016 19:42:31 +0100 Subject: erts: Update docs for erlang:purge_module/1 --- erts/doc/src/erlang.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 8ddbd95de5..72d08a03fe 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4870,6 +4870,12 @@ os_prompt% code(3)) and is not to be used elsewhere.

+ +

As from ERTS 8.0 (OTP 19), any lingering processes + that still execute the old code will be killed by this function. + In earlier versions, such incorrect use could cause much + more fatal failures, like emulator crash.

+

Failure: badarg if there is no old code for Module.

-- cgit v1.2.3 From 3f33428db9aea0d767295322c4e882a5c6bbf7db Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 19 Jan 2016 17:05:55 +0100 Subject: Introduce time management in native APIs --- erts/doc/src/erl_driver.xml | 112 ++++++++++++++++++++++++++++++++++++++++++++ erts/doc/src/erl_nif.xml | 112 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index e717fc0c4e..e338e95938 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -347,6 +347,16 @@ the driver does not handle sizes that overflow an int all will work as before.

+ Time Measurement +

Support for time measurement in drivers: + + ErlDrvTime + ErlDrvTimeUnit + erl_drv_monotonic_time() + erl_drv_time_offset() + erl_drv_convert_time_unit() +

+
@@ -860,6 +870,24 @@ typedef struct ErlIOVec { erl_drv_tsd_get().

+ ErlDrvTime + +

A signed 64-bit integer type for representation of time.

+
+ ErlDrvTimeUnit + +

An enumeration of time units supported by the driver API:

+ + ERL_DRV_SEC +

Seconds

+ ERL_DRV_MSEC +

Milliseconds

+ ERL_DRV_USEC +

Microseconds

+ ERL_DRV_NSEC +

Nanoseconds

+
+
@@ -1023,6 +1051,10 @@ typedef struct ErlIOVec { Read a system timestamp +

This function is deprecated! Do not use it! + Use the documented + time measurement functionality + instead.

This function reads a timestamp into the memory pointed to by the parameter now. See the description of ErlDrvNowData for specification of its fields.

@@ -2997,6 +3029,86 @@ ERL_DRV_MAP int sz
+ + ErlDrvTimeerl_drv_monotonic_time(ErlDrvTimeUnit time_unit) + Get Erlang Monotonic Time + + +

Arguments:

+ + time_unit + Time unit of returned value. + +

+ Returns + Erlang + monotonic time. Note that it is not uncommon with + negative values. +

+

Returns ERL_DRV_TIME_ERROR if called with an invalid + time unit argument, or if called from a thread that is not a + scheduler thread.

+

See also:

+ + ErlDrvTime + ErlDrvTimeUnit + +
+
+ + + ErlDrvTimeerl_drv_time_offset(ErlDrvTimeUnit time_unit) + Get current Time Offset + + +

Arguments:

+ + time_unit + Time unit of returned value. + +

Returns the current time offset between + Erlang monotonic time + and + Erlang system time + converted into the time_unit passed as argument.

+

Returns ERL_DRV_TIME_ERROR if called with an invalid + time unit argument, or if called from a thread that is not a + scheduler thread.

+

See also:

+ + ErlDrvTime + ErlDrvTimeUnit + +
+
+ + + ErlDrvTimeerl_drv_convert_time_unit(ErlDrvTime val, ErlDrvTimeUnit from, ErlDrvTimeUnit to) + Convert time unit of a time value + + +

Arguments:

+ + val + Value to convert time unit for. + from + Time unit of val. + to + Time unit of returned value. + +

Converts the val value of time unit from to + the corresponding value of time unit to. The result is + rounded using the floor function.

+

Returns ERL_DRV_TIME_ERROR if called with an invalid + time unit argument.

+

See also:

+ + ErlDrvTime + ErlDrvTimeUnit + +
+
+
SEE ALSO diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 2d8706169f..420c9fea38 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -317,6 +317,17 @@ ok libraries might however fail if deprecated features are used.

+ Time Measurement +

Support for time measurement in NIF libraries: + + ErlNifTime + ErlNifTimeUnit + enif_monotonic_time() + enif_time_offset() + enif_convert_time_unit() +

+
+ Long-running NIFs

Native functions @@ -560,6 +571,25 @@ typedef enum {

A native signed 64-bit integer type.

ErlNifUInt64

A native unsigned 64-bit integer type.

+ + ErlNifTime + +

A signed 64-bit integer type for representation of time.

+
+ ErlNifTimeUnit + +

An enumeration of time units supported by the NIF API:

+ + ERL_NIF_SEC +

Seconds

+ ERL_NIF_MSEC +

Milliseconds

+ ERL_NIF_USEC +

Microseconds

+ ERL_NIF_NSEC +

Nanoseconds

+
+
@@ -1486,6 +1516,88 @@ enif_map_iterator_destroy(env, &iter);

Same as erl_drv_tsd_set.

+ + + + ErlNifTimeenif_monotonic_time(ErlNifTimeUnit time_unit) + Get Erlang Monotonic Time + + +

Arguments:

+ + time_unit + Time unit of returned value. + +

+ Returns + Erlang + monotonic time. Note that it is not uncommon with + negative values. +

+

Returns ERL_NIF_TIME_ERROR if called with an invalid + time unit argument, or if called from a thread that is not a + scheduler thread.

+

See also:

+ + ErlNifTime + ErlNifTimeUnit + +
+
+ + + ErlNifTimeenif_time_offset(ErlNifTimeUnit time_unit) + Get current Time Offset + + +

Arguments:

+ + time_unit + Time unit of returned value. + +

Returns the current time offset between + Erlang monotonic time + and + Erlang system time + converted into the time_unit passed as argument.

+

Returns ERL_NIF_TIME_ERROR if called with an invalid + time unit argument, or if called from a thread that is not a + scheduler thread.

+

See also:

+ + ErlNifTime + ErlNifTimeUnit + +
+
+ + + ErlNifTimeenif_convert_time_unit(ErlNifTime val, ErlNifTimeUnit from, ErlNifTimeUnit to) + Convert time unit of a time value + + +

Arguments:

+ + val + Value to convert time unit for. + from + Time unit of val. + to + Time unit of returned value. + +

Converts the val value of time unit from to + the corresponding value of time unit to. The result is + rounded using the floor function.

+

Returns ERL_NIF_TIME_ERROR if called with an invalid + time unit argument.

+

See also:

+ + ErlNifTime + ErlNifTimeUnit + +
+
+
SEE ALSO -- cgit v1.2.3 From eea5f896780e07f7ca76685061d01e7be5a7abaa Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 11 Sep 2014 18:26:26 +0200 Subject: erts, kernel: Add os:perf_counter function The perf_counter is a very very cheap and high resolution timer that can be used to timestamp system events. It does not have monoticity guarantees, but should on most OS's expose a monotonous time. A special instruction has been created for this counter to further speed up fetching it. OTP-12908 --- erts/doc/src/erlang.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index d0d35ea25f..6915b35fcb 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -131,6 +131,17 @@ + perf_counter +

Symbolic representation of the performance counter + time unit used by the Erlang runtime system.

+ +

The perf_counter time unit behaves much in the same way + as the native time unit. That is it might differ inbetween + run-time restarts. You get values of this type by calling + os:perf_counter() +

+
+

The time_unit/0 type may be extended. Use -- cgit v1.2.3 From 664ed2a6fd2b324bb6b56db3d3eca853cfda8f61 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 12 Sep 2014 16:38:00 +0200 Subject: erts: Add microstate accounting Microstate accounting is a way to track which state the different threads within ERTS are in. The main usage area is to pin point performance bottlenecks by checking which states the threads are in and then from there figuring out why and where to optimize. Since checking whether microstate accounting is on or off is relatively expensive if done in a short loop only a few of the states are enabled by default and more states can be enabled through configure. I've done some benchmarking and the overhead with it turned off is not noticible and with it on it is a fraction of a percent. If you enable the extra states, depending on the benchmark, the ovehead when turned off is about 1% and when turned on somewhere inbetween 5-15%. OTP-12345 --- erts/doc/src/erlang.xml | 177 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 164 insertions(+), 13 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 6915b35fcb..ddca492040 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5870,6 +5870,146 @@ true + Information about microstate accounting. + + +

+ Microstate accounting can be used to measure how much time the Erlang + runtime system spends doing various tasks. It is designed to be as + lightweight as possible, but there will be some overhead when this + is enabled. Microstate accounting is meant to be a profiling tool + to help figure out performance bottlenecks. + To start/stop/reset microstate_accounting you use + the system_flag + + microstate_accounting. +

+

+ erlang:statistics(microstate_accounting) returns a list of maps + representing some of the OS threads within ERTS. Each map contains + type and id fields that can be used to identify what + thread it is, and also a counters field that contains data about how + much time has been spent in the various states.

+
+> erlang:statistics(microstate_accounting).
+[#{counters => #{aux => 1899182914,
+                 check_io => 2605863602,
+                 emulator => 45731880463,
+                 gc => 1512206910,
+                 other => 5421338456,
+                 port => 221631,
+                 sleep => 5150294100},
+   id => 1,
+   type => scheduler}|...]
+        
+

The time unit is the same as returned by + + os:perf_counter/0. + So to convert it to milliseconds you could do something like this:

+
+lists:map(
+  fun(#{ counters := Cnt } = M) ->
+          MsCnt = maps:map(fun(_K, PerfCount) ->
+                                   erlang:convert_time_unit(PerfCount, perf_counter, 1000)
+                           end, Cnt),
+         M#{ counters := MsCnt }
+  end, erlang:statistics(microstate_accounting)).
+        
+

+ It is important to note that these values are not guaranteed to be + the exact time spent in each state. This is because of various + optimisation done in order to keep the overhead as small as possible. +

+ +

Currently the following MSAcc_Thread_Type are available:

+ + scheduler + The main execution threads that do most of the work. + asyncAsync threads are used by various + linked-in drivers (mainly the file drivers) do offload non-cpu + intensive work. + auxTakes care of any work that is not + specifically assigned to a scheduler. + +

Currently the following MSAcc_Thread_States are available. + All states are exclusive, meaning that a thread cannot be in two states + at once. So if you add the numbers of all counters in a thread + you will get the total run-time for that thread.

+ + aux + Time spent handling auxiliary jobs. + check_io + Time spent checking for new I/O events. + emulator + Time spent executing erlang processes. + gc + Time spent doing garbage collection. When extra states are + enabled this is the time spent doing non-fullsweep garbage + collections. + other + Time spent doing unaccounted things. + port + Time spent executing ports. + sleep + Time spent sleeping. + +

It is possible to add more fine grained MSAcc_Thread_States + through configure. + (e.g. ./configure --with-microstate-accounting=extra). + Enabling these states will cause a performance degradation when + microstate accounting is turned off and increase the overhead when + it is turned on.

+ + alloc + Time spent managing memory. Without extra states this time is + spread out over all other states. + bif + Time spent in bifs. Without extra states this time is part of + the emulator state. + busy_wait + Time spent busy waiting. This is also the state where a + scheduler no longer reports that it is active when using + + erlang:statistics(scheduler_wall_time). + So if you add all other states but this and sleep and then divide that + by all time in the thread you should get something very similar to the + scheduler_wall_time fraction. Without extra states this time is part + of the other state. + ets + Time spent executing ETS bifs. Without extra states this time is + part of the emulator state. + gc_full + Time spent doing fullsweep garbage collection. Without extra + states this time is part of the gc state. + nif + Time spent in nifs. Without extra states this time is part of + the emulator state. + send + Time spent sending messages (processes only). Without extra + states this time is part of the emulator state. + timers + Time spent managing timers. Without extra states this time is + part of the other state. + +

There is a utility module called + msacc in + runtime_tools that can be used to more easily analyse these + statistics.

+ +

+ Returns undefined if the system flag + + microstate_accounting + is turned off. +

+

The list of thread information is unsorted and may appear in + different order between calls.

+

The threads and states are subject to change without any + prior notice.

+ + + + Information about reductions. @@ -5887,7 +6027,7 @@ true - + Information about the run-queues.

@@ -5903,7 +6043,7 @@ true - + Information about the run-queue lengths.

@@ -5923,7 +6063,7 @@ true - + Information about runtime.

Returns information about runtime, in milliseconds.

@@ -5938,7 +6078,7 @@ true
- + Information about each schedulers work time. @@ -6009,7 +6149,7 @@ ok - + Information about active processes and ports.

@@ -6027,7 +6167,7 @@ ok - + Information about the run-queue lengths.

@@ -6046,7 +6186,7 @@ ok - + Information about wall clock.

Returns information about wall clock. wall_clock can @@ -6280,6 +6420,17 @@ ok + Set system flag microstate_accounting +

+ Turns on/off microstate accounting measurements. By passing reset it is possible to reset + all counters to 0.

+

For more information see, + erlang:statistics(microstate_accounting). +

+
+
+ + Sets system flag min_heap_size.

Sets the default minimum heap size for processes. The size @@ -6294,7 +6445,7 @@ ok - + Sets system flag min_bin_vheap_size.

Sets the default minimum binary virtual heap size for @@ -6311,7 +6462,7 @@ ok - + Sets system flag multi_scheduling.

@@ -6349,7 +6500,7 @@ ok - + Sets system flag scheduler_bind_type. @@ -6467,7 +6618,7 @@ ok - + Sets system flag scheduler_wall_time.

Turns on or off scheduler wall time measurements.

@@ -6477,7 +6628,7 @@ ok
- + Sets system flag schedulers_online.

@@ -6502,7 +6653,7 @@ ok - + Sets system flag trace_control_word.

Sets the value of the node trace control word to -- cgit v1.2.3 From 18f0707c218ebdeb6024ecffd7704d3582e0b91c Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 2 Feb 2016 16:20:19 +0100 Subject: Use nano second time unit in tracing --- erts/doc/src/erl_driver.xml | 5 +++-- erts/doc/src/erlang.xml | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index e338e95938..34dc8af238 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -1052,8 +1052,9 @@ typedef struct ErlIOVec {

This function is deprecated! Do not use it! - Use the documented - time measurement functionality + Use erl_drv_monotonic_time() + (perhaps in combination with + erl_drv_time_offset()) instead.

This function reads a timestamp into the memory pointed to by the parameter now. See the description of ErlDrvNowData for diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 79d3f66ea8..c9eb838230 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -7744,7 +7744,8 @@ ok

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().

+ format and value as produced by + erlang:monotonic_time(nano_seconds).

runnable_procs @@ -7772,7 +7773,7 @@ ok Erlang monotonic time and a monotonically increasing integer. The time-stamp (Ts) has the same format and value - as produced by {erlang:monotonic_time(), + as produced by {erlang:monotonic_time(nano_seconds), erlang:unique_integer([monotonic])}.

timestamp @@ -8161,7 +8162,7 @@ timestamp() -> 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 + erlang:monotonic_time(nano_seconds). This flag overrides the cpu_timestamp flag.

strict_monotonic_timestamp @@ -8171,7 +8172,7 @@ timestamp() -> 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:monotonic_time(nano_seconds), erlang:unique_integer([monotonic])}. This flag overrides the cpu_timestamp flag.

-- cgit v1.2.3 From 7a319cd96f7f4869300b32442ebe892ae557f41c Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 8 Feb 2016 15:47:49 +0100 Subject: erts: Fix error cases in enif_get_list_length false if improper list false if length > UINT_MAX --- erts/doc/src/erl_nif.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 420c9fea38..be0e406b9c 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -753,7 +753,7 @@ typedef enum { intenif_get_list_length(ErlNifEnv* env, ERL_NIF_TERM term, unsigned* len) Get the length of list term

Set *len to the length of list term and return true, - or return false if term is not a list.

+ or return false if term is not a proper list.

intenif_get_long(ErlNifEnv* env, ERL_NIF_TERM term, long int* ip) Read an long integer term -- cgit v1.2.3 From 40695d080b0dc0665b01803768ffc74ed2eca207 Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Sun, 18 Oct 2015 16:20:37 -0400 Subject: epmd: support IPv6 node registration Allow IPv6 nodes to register with and query epmd. On systems with IPv6 support: * epmd listens on both the IPv4 and IPv6 ANY or loopback sockets * the epmd cli client connects to epmd over the IPv6 loopback * distributed nodes started with "-proto_dist inet6_tcp" will register with epmd over IPv6 To work on IPv6 capable systems that have IPv6 support disabled, epmd ignores errors opening the socket if the protocol is not supported. Similarly, the epmd client will fall back to IPv4 if the IPv6 socket is not available. Update the minimum supported version of Windows to Windows Vista to support IPv6. --- erts/doc/src/epmd.xml | 2 +- erts/doc/src/erl.xml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 28fcc8f7af..7f61804bea 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -37,7 +37,7 @@

Erlang Port Mapper Daemon

- +

Starts the port mapper daemon

diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index e8621fecc3..ed3e7e34c4 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -387,6 +387,28 @@

Replaces the path specified in the boot script. See script(4).

+ + +

Specify a protocol for Erlang distribution.

+ + inet_tcp + +

TCP over IPv4 (the default)

+
+ inet_tls + +

distribution over TLS/SSL

+
+ inet6_tcp + +

TCP over IPv6

+
+
+

For example, to start up IPv6 distributed nodes:

+
+% erl -name test@ipv6node.example.com -proto_dist inet6_tcp
+
+

Starts Erlang with a remote shell connected to .

-- cgit v1.2.3 From db241c69cef8774b9b7afa7e0f0f8dbdcf528a07 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 17 Feb 2016 21:17:38 +0100 Subject: erts: Make literal_alloc documented and configurable Except it cannot be disabled and cannot be multi-threaded. The bit-vector 'erts_literal_vspace_map' on 32-bit is currently only protected by the literal allocator mutex. We could allow multiple instances on 64-bit (I think), but what would be the point? --- erts/doc/src/erts_alloc.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 15b78ffa10..75de74523e 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -52,6 +52,8 @@ Allocator used for ETS data. driver_alloc Allocator used for driver data. + literal_alloc + Allocator used for constant terms in Erlang code. sl_alloc Allocator used for memory blocks that are expected to be short-lived. @@ -77,7 +79,7 @@ instead of creating new segments. This in order to reduce the number of system calls made.
-

sys_alloc is always enabled and +

sys_alloc and literal_alloc are always enabled and cannot be disabled. mseg_alloc is always enabled if it is available and an allocator that uses it is enabled. All other allocators can be enabled or disabled. @@ -246,6 +248,7 @@ the currently present allocators:

B: binary_alloc + I: literal_alloc D: std_alloc E: ets_alloc F: fix_alloc -- cgit v1.2.3 From 8e2a21f1df1140867d0b074ec7a86610d1e1b51e Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 22 Feb 2016 18:18:15 +0100 Subject: erts: Add emulator flag +MIscs for literal super carrier size --- erts/doc/src/erts_alloc.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 75de74523e..0965f9b49c 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -566,6 +566,16 @@ set to false, sys_alloc carriers will never be created by allocators using the alloc_util framework. +

The following flag is special for literal_alloc:

+ + ]]> + + literal_alloc super carrier size (in MB). The amount of + virtual address space reserved for literal terms in + Erlang code on 64-bit architectures. The default is 1024 (1GB) + and is usually sufficient. The flag is ignored on 32-bit + architectures. +

Instrumentation flags:

+Mim true|false -- cgit v1.2.3 From 1b094d72ffc56069c72f17c7edd673dbbfe47e39 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 23 Feb 2016 21:05:03 +0100 Subject: erts: Make erlang:halt() accept bignums as Status Just mask away the high bits to get a more tolerant erlang:halt that behaves the same on 32 and 64 bit architectures. --- erts/doc/src/erlang.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index c37ed3bea5..7926157fa5 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1794,7 +1794,8 @@ os_prompt%

On many platforms, the OS supports only status - codes 0-255.

+ codes 0-255. A too large status code will be truncated by clearing + the high bits.

For integer Status, the Erlang runtime system closes all ports and allows async threads to finish their operations before exiting. To exit without such flushing, use -- cgit v1.2.3 From e1b95c4a48e08fb4bc42626db8614a3cd46d2a5e Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 3 Mar 2016 10:38:18 +0100 Subject: erts: Use 'bit string' in The Abstract Format document --- erts/doc/src/absform.xml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index ccdecf44ec..13756ddfdc 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -182,7 +182,7 @@

Individual patterns are represented as follows:

If P is an atomic literal L, then Rep(P) = Rep(L). - If P is a binary pattern + If P is a bit string pattern <<P_1:Size_1/TSL_1, ..., P_k:Size_k/TSL_k>>, where each Size_i is an expression that can be evaluated to an integer and each TSL_i is a type specificer list, then @@ -241,12 +241,13 @@

An expression E is one of the following alternatives:

If E is an atomic literal L, then Rep(E) = Rep(L). - If E is a binary comprehension + If E is a bit string comprehension <<E_0 || Q_1, ..., Q_k>>, where each Q_i is a qualifier, then Rep(E) = {bc,LINE,Rep(E_0),[Rep(Q_1), ..., Rep(Q_k)]}. For Rep(Q), see below. - If E is a binary constructor <<E_1:Size_1/TSL_1, ..., E_k:Size_k/TSL_k>>, + If E is a bit string constructor + <<E_1:Size_1/TSL_1, ..., E_k:Size_k/TSL_k>>, where each Size_i is an expression and each TSL_i is a type specificer list, then Rep(E) = {bin,LINE,[{bin_element,LINE,Rep(E_1),Rep(Size_1),Rep(TSL_1)}, ..., {bin_element,LINE,Rep(E_k),Rep(Size_k),Rep(TSL_k)}]}. @@ -386,16 +387,17 @@ If Q is a generator P <- E, where P is a pattern and E is an expression, then Rep(Q) = {generate,LINE,Rep(P),Rep(E)}. - If Q is a generator P <= E, where P is + If Q is a bit string generator + P <= E, where P is a pattern and E is an expression, then Rep(Q) = {b_generate,LINE,Rep(P),Rep(E)}.
- Binary Element Type Specifiers -

A type specifier list TSL for a binary element is a sequence of type - specifiers TS_1 - ... - TS_k, and + Bit String Element Type Specifiers +

A type specifier list TSL for a bit string element is a sequence + of type specifiers TS_1 - ... - TS_k, and Rep(TSL) = [Rep(TS_1), ..., Rep(TS_k)].

If TS is a type specifier A, where A is an atom, @@ -473,7 +475,7 @@

A guard test Gt is one of the following alternatives:

If Gt is an atomic literal L, then Rep(Gt) = Rep(L). - If Gt is a binary constructor + If Gt is a bit string constructor <<Gt_1:Size_1/TSL_1, ..., Gt_k:Size_k/TSL_k>>, where each Size_i is a guard test and each TSL_i is a type specificer list, then @@ -540,7 +542,7 @@ {ann_type,LINE,[Rep(A),Rep(T_0)]}. If T is an atom or integer literal L, then Rep(T) = Rep(L). - If T is a bitstring type <<_:M,_:_*N>>, + If T is a bit string type <<_:M,_:_*N>>, where M and N are singleton integer types, then Rep(T) = {type,LINE,binary,[Rep(M),Rep(N)]}. If T is the empty list type [], then Rep(T) = -- cgit v1.2.3 From 207a569d4caf80b10a54eec2220ac672a3377f00 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 22 Jan 2016 17:48:49 +0100 Subject: Improved scheduler suspend functionality - The calling process is now suspended while synchronizing scheduler suspends via erlang:system_flag(schedulers_online, _) and erlang:system_flag(multi_scheduling, _), instead of blocking the scheduler thread in the BIF call waiting for the operation to synchronize. Besides releasing the scheduler for other work (or immediate suspend) it also makes it possible to abort the operation by killing the process. - erlang:system_flag(schedulers_online, _) now only wait for normal schedulers to complete before it returns. This since it may take a very long time before all dirty schedulers suspends. - erlang:system_flag(multi_scheduling, block_normal|unblock_normal) which only operate on normal schedulers has been introduced. This since there are use cases where suspend of dirty schedulers are not of interest (hipe loader). - erlang:system_flag(multi_scheduling, block) still blocks all dirty schedulers as well as all normal schedulers except one since it is hard to redefine what multi scheduling block means. - The three operations: - changing amount of schedulers online - blocking/unblocking normal multi scheduling - blocking/unblocking full multi scheduling can now be done in parallel. This is important since otherwise a full multi scheduling block would potentially delay the other operations for a very long time. --- erts/doc/src/erlang.xml | 99 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 28 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 1f8e89768c..350a8506f5 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6469,32 +6469,44 @@ ok

If multi-scheduling is enabled, more than one scheduler thread is used by the emulator. Multi-scheduling can be - blocked. When multi-scheduling is blocked, only - one scheduler thread schedules Erlang processes.

+ blocked in two different ways. Either all schedulers but + one is blocked, or all normal schedulers but + one is blocked. When only normal schedulers are blocked + dirty schedulers are free to continue to schedule + processes.

If BlockState =:= block, multi-scheduling is - blocked. If BlockState =:= unblock and no one + blocked. That is, one and only one scheduler thread will + execute. If BlockState =:= unblock and no one else blocks multi-scheduling, and this process has blocked only once, multi-scheduling is unblocked.

-

One process can block multi-scheduling multiple times. - If a process has blocked multiple times, it must - unblock exactly as many times as it has blocked before it - has released its multi-scheduling block. If a process that - has blocked multi-scheduling exits, it releases its - blocking of multi-scheduling.

+

If BlockState =:= block_normal, normal + multi-scheduling is blocked. That is, only one normal scheduler + thread will execute, but multiple dirty schedulers may execute. + If BlockState =:= unblock_normal and no one + else blocks normal multi-scheduling, and this process has + blocked only once, normal multi-scheduling is unblocked.

+

One process can block multi-scheduling as well as normal + multi-scheduling multiple times. If a process has blocked + multiple times, it must unblock exactly as many times as it + has blocked before it has released its multi-scheduling + block. If a process that has blocked multi-scheduling or normal + multi scheduling exits, it automatically releases its blocking + of multi-scheduling and normal multi-scheduling.

The return values are disabled, blocked, - or enabled. The returned value describes the - state just after the call to + blocked_normal, or enabled. The returned value + describes the state just after the call to erlang:system_flag(multi_scheduling, BlockState) has been made. For information about the return values, see erlang:system_info(multi_scheduling).

-

Blocking of multi-scheduling is normally not needed. - If you feel that you need to block multi-scheduling, - consider it a few more times again. Blocking multi-scheduling - is only to be used as a last resort, as it is most likely - a very inefficient way to solve the problem.

+

Blocking of multi-scheduling and normal multi-scheduling + is normally not needed. If you feel that you need to use these + features, consider it a few more times again. Blocking + multi-scheduling is only to be used as a last resort, as it is + most likely a very inefficient way to solve the problem.

See also erlang:system_info(multi_scheduling), + erlang:system_info(normal_multi_scheduling_blockers), erlang:system_info(multi_scheduling_blockers), and erlang:system_info(schedulers).

@@ -7329,6 +7341,16 @@ ok where MinHeapSize is the current system-wide minimum heap size for spawned processes.

+ message_queue_data + +

Returns the default value of the message_queue_data + process flag which is either off_heap, on_heap, or mixed. + This default is set by the erl command line argument + +xmqd. For more information on the + message_queue_data process flag, see documentation of + process_flag(message_queue_data, + MQD).

+
min_bin_vheap_size

Returns {min_bin_vheap_size, @@ -7348,7 +7370,8 @@ ok multi_scheduling -

Returns disabled, blocked, or enabled:

+

Returns disabled, blocked, blocked_normal, + or enabled:

disabled @@ -7359,14 +7382,22 @@ ok blocked

The emulator has more than one scheduler thread, - but all scheduler threads except one are blocked, - that is, only one scheduler thread schedules + but all scheduler threads except one are blocked. + That is, only one scheduler thread schedules Erlang processes and executes Erlang code.

+ blocked_normal + +

The emulator has more than one scheduler thread, + but all normal scheduler threads except one are + blocked. Note that dirty schedulers are not + blocked, and may schedule Erlang processes and + execute native code.

+
enabled

The emulator has more than one scheduler thread, - and no scheduler threads are blocked, that is, + and no scheduler threads are blocked. That is, all available scheduler threads schedule Erlang processes and execute Erlang code.

@@ -7374,6 +7405,7 @@ ok

See also erlang:system_flag(multi_scheduling, BlockState), erlang:system_info(multi_scheduling_blockers), + erlang:system_info(normal_multi_scheduling_blockers), and erlang:system_info(schedulers).

@@ -7390,6 +7422,8 @@ ok

See also erlang:system_flag(multi_scheduling, BlockState), erlang:system_info(multi_scheduling), + erlang:system_info(normal_multi_scheduling_blockers), + and erlang:system_info(schedulers).

@@ -7399,15 +7433,23 @@ ok used by the runtime system. It is on the form "<major ver>.<minor ver>".

- message_queue_data + normal_multi_scheduling_blockers -

Returns the default value of the message_queue_data - process flag which is either off_heap, on_heap, or mixed. - This default is set by the erl command line argument - +xmqd. For more information on the - message_queue_data process flag, see documentation of - process_flag(message_queue_data, - MQD).

+ +

Returns a list of Pids when + normal multi-scheduling is blocked (i.e. all normal schedulers + but one is blocked), otherwise the empty list is returned. + The Pids in the list represent all the + processes currently blocking normal multi-scheduling. + A Pid occurs only once in the list, even if + the corresponding process has blocked multiple times.

+

See also + erlang:system_flag(multi_scheduling, BlockState), + erlang:system_info(multi_scheduling), + erlang:system_info(multi_scheduling_blockers), + + and + erlang:system_info(schedulers).

otp_release @@ -7650,6 +7692,7 @@ ok erlang:system_info(scheduler_id), erlang:system_flag(multi_scheduling, BlockState), erlang:system_info(multi_scheduling), + erlang:system_info(normal_multi_scheduling_blockers) and erlang:system_info(multi_scheduling_blockers).

-- cgit v1.2.3 From 0f8afe80c6582f7affd17f36dc9cb48cc7946713 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Mon, 14 Mar 2016 10:46:23 +0100 Subject: Prepare release --- erts/doc/src/notes.xml | 186 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index a726cc7b97..acd816a81c 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,192 @@

This document describes the changes made to the ERTS application.

+
Erts 7.3 + +
Fixed Bugs and Malfunctions + + +

+ The '-path' flag to 'erl' has been documented. This flag + replaces the path specified in the boot script. It has + always existed, but was earlier only documented in SASL + (script).

+

+ Own Id: OTP-13060

+
+ +

+ The call_time tracing functionality internally + used a time based on OS system time in order to measure + call time which could cause erroneous results if OS + system time was changed during tracing.

+

+ This functionality now use Erlang monotonic time in order + to measure time. Besides fixing the erroneous results due + to OS system time being used, the results are often also + better since Erlang monotonic time often has better + accuracy and precision.

+

+ Own Id: OTP-13216

+
+ +

+ Fix behaviour of -delay_write command line switch of + epmd, which is used for debugging - in some cases epmd + was sleeping twice the requested amount of time.

+

+ Own Id: OTP-13220

+
+ +

+ Fix race between timeout and exit signal that could cause + a process to ignore the exit signal and continue + execution. Bug exist since OTP 18.0.

+

+ Own Id: OTP-13245

+
+ +

+ Fix bug in erlang:halt/1,2 for large exit status + values, causing either badarg (on 32-bit) or exit + with a crash dump and/or core dump (on 64-bit). Make + erlang:halt/1,2 tolerate any non negative integer + as exit status and truncate high order bits if the OS + does not support it.

+

+ Own Id: OTP-13251 Aux Id: ERL-49

+
+ +

+ gen_tcp:accept/2 + was not time + warp safe. This since it used the same time as + returned by erlang:now/0 + when calculating timeout. This has now been fixed.

+

+ Own Id: OTP-13254 Aux Id: OTP-11997, OTP-13222

+
+ +

+ Fix faulty error handling when writing to a compressed + file.

+

+ Own Id: OTP-13270

+
+ +

+ Fix sendfile usage for large files on FreeBSD

+

+ Own Id: OTP-13271

+
+ +

+ Fix bug that could cause + process_info(P,current_location) to crash emulator + for hipe compiled modules.

+

+ Own Id: OTP-13282 Aux Id: ERL-79

+
+ +

+ Out of memory errors have been changed to cause an exit + instead of abort.

+

+ Own Id: OTP-13292

+
+ +

+ When calling garbage_collect/[1,2] or + check_process_code/[2,3] from a process with a + higher priority than the priority of the process operated + on, the run queues could end up in an inconsistent state. + This bug has now been fixed.

+

+ Own Id: OTP-13298 Aux Id: OTP-11388

+
+ +

+ A workaround for an issue with older gcc versions (less + than 5) and inline assembly on 32-bit x86 caused an + emulator crash when it had been compiled with a newer gcc + version. An improved configure test, run when + building OTP, now detects whether the workaround should + be used or not.

+

+ Own Id: OTP-13326 Aux Id: ERL-80

+
+
+
+ + +
Improvements and New Features + + +

Introduced new statistics functionality in order to + more efficiently retrieve information about run able and + active processes and ports. For more information see:

+ statistics(total_run_queue_lengths) + statistics(run_queue_lengths) + statistics(total_active_tasks) + statistics(active_tasks) + +

+ Own Id: OTP-13201

+
+ +

+ Time warp safety improvements.

+

+ Introduced the options monotonic_timestamp, and + strict_monotonic_timestamp to the trace, + sequential trace, and system profile functionality. This + since the already existing timestamp option is not + time warp safe.

+

+ Introduced the option safe_fixed_monotonic_time to + ets:info/2 and dets:info/2. This since the + already existing safe_fixed option is not time + warp safe.

+

+ Own Id: OTP-13222 Aux Id: OTP-11997

+
+ +

+ Fix a register race where down nodes goes undetected in + epmd

+

+ Own Id: OTP-13301

+
+ +

+ Improved the gcc inline assembly implementing double word + atomic compare and exchange on x86/x86_64 so that it also + can be used when compiling with clang.

+

+ Own Id: OTP-13336

+
+ +

+ An optimization preventing a long wait for a scheduler + thread looking up information about a process executing + on another scheduler thread had unintentionally been lost + in erts-5.10 (OTP R16A). This optimization has now been + reintroduced.

+

+ Own Id: OTP-13365 Aux Id: OTP-9892

+
+
+
+ +
+
Erts 7.2.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 6664eed554974336909d3ffe03f20349cc4c38fd Mon Sep 17 00:00:00 2001 From: Henrik Nord Date: Tue, 15 Mar 2016 15:19:56 +0100 Subject: update copyright-year --- erts/doc/Makefile | 2 +- erts/doc/src/Makefile | 2 +- erts/doc/src/alt_dist.xml | 2 +- erts/doc/src/book.xml | 2 +- erts/doc/src/communication.xml | 2 +- erts/doc/src/crash_dump.xml | 2 +- erts/doc/src/driver.xml | 2 +- erts/doc/src/epmd.xml | 2 +- erts/doc/src/erl.xml | 2 +- erts/doc/src/erl_driver.xml | 2 +- erts/doc/src/erl_nif.xml | 2 +- erts/doc/src/erl_prim_loader.xml | 2 +- erts/doc/src/erlang.xml | 2 +- erts/doc/src/erlc.xml | 2 +- erts/doc/src/erlsrv.xml | 2 +- erts/doc/src/erts_alloc.xml | 2 +- erts/doc/src/inet_cfg.xml | 2 +- erts/doc/src/init.xml | 2 +- erts/doc/src/match_spec.xml | 2 +- erts/doc/src/notes.xml | 2 +- erts/doc/src/notes_history.xml | 2 +- erts/doc/src/part.xml | 2 +- erts/doc/src/part_notes.xml | 2 +- erts/doc/src/part_notes_history.xml | 2 +- erts/doc/src/ref_man.xml | 2 +- erts/doc/src/run_erl.xml | 2 +- erts/doc/src/start.xml | 2 +- erts/doc/src/start_erl.xml | 2 +- erts/doc/src/tty.xml | 2 +- erts/doc/src/werl.xml | 2 +- erts/doc/src/zlib.xml | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/Makefile b/erts/doc/Makefile index d415e544f3..f26a43592e 100644 --- a/erts/doc/Makefile +++ b/erts/doc/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1996-2009. All Rights Reserved. +# Copyright Ericsson AB 1996-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index 83f4c58560..e02e89238e 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2012. All Rights Reserved. +# Copyright Ericsson AB 1997-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/erts/doc/src/alt_dist.xml b/erts/doc/src/alt_dist.xml index 2263302707..e283acc1b4 100644 --- a/erts/doc/src/alt_dist.xml +++ b/erts/doc/src/alt_dist.xml @@ -4,7 +4,7 @@
- 20002013 + 20002016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/book.xml b/erts/doc/src/book.xml index 12eda03ee5..a0780c91d9 100644 --- a/erts/doc/src/book.xml +++ b/erts/doc/src/book.xml @@ -4,7 +4,7 @@
- 19972013 + 19972016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/communication.xml b/erts/doc/src/communication.xml index 3deea3e4af..1eb05310e9 100644 --- a/erts/doc/src/communication.xml +++ b/erts/doc/src/communication.xml @@ -4,7 +4,7 @@
- 20122013 + 20122016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/crash_dump.xml b/erts/doc/src/crash_dump.xml index 61c9159823..0b827ae583 100644 --- a/erts/doc/src/crash_dump.xml +++ b/erts/doc/src/crash_dump.xml @@ -4,7 +4,7 @@
- 19992013 + 19992016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml index a68e87d3b3..4bef5e1388 100644 --- a/erts/doc/src/driver.xml +++ b/erts/doc/src/driver.xml @@ -4,7 +4,7 @@
- 20012013 + 20012016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 7f61804bea..d9f580d081 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 096af096dc..e13470c83c 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -4,7 +4,7 @@
- 19962015 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 241d4131d5..175b7f6bfb 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -4,7 +4,7 @@
- 20012015 + 20012016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index be0e406b9c..5481a81bf0 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -4,7 +4,7 @@
- 20012015 + 20012016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index 8f66e07ae1..d3ece37cc5 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 350a8506f5..ef577c82bf 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4,7 +4,7 @@
- 19962015 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml index 9fc5864413..a64927fec2 100644 --- a/erts/doc/src/erlc.xml +++ b/erts/doc/src/erlc.xml @@ -4,7 +4,7 @@
- 19972013 + 19972016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml index ccb8b2dd76..fb00444aa4 100644 --- a/erts/doc/src/erlsrv.xml +++ b/erts/doc/src/erlsrv.xml @@ -4,7 +4,7 @@
- 19982013 + 19982016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 0965f9b49c..05be35e0af 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -4,7 +4,7 @@
- 20022015 + 20022016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/inet_cfg.xml b/erts/doc/src/inet_cfg.xml index 5caf232a62..027fe600d7 100644 --- a/erts/doc/src/inet_cfg.xml +++ b/erts/doc/src/inet_cfg.xml @@ -4,7 +4,7 @@
- 20042013 + 20042016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index 2a33096d04..84a5aea335 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index 08dad8cc10..975f01cf2c 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -4,7 +4,7 @@
- 19992013 + 19992016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index acd816a81c..9e0cf2354f 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -4,7 +4,7 @@
- 20042015 + 20042016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/notes_history.xml b/erts/doc/src/notes_history.xml index 0886ae4039..0bc2ab1383 100644 --- a/erts/doc/src/notes_history.xml +++ b/erts/doc/src/notes_history.xml @@ -4,7 +4,7 @@
- 20062013 + 20062016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml index 2f5eca93db..b2abfc62ca 100644 --- a/erts/doc/src/part.xml +++ b/erts/doc/src/part.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/part_notes.xml b/erts/doc/src/part_notes.xml index 83bb479715..e579b7635d 100644 --- a/erts/doc/src/part_notes.xml +++ b/erts/doc/src/part_notes.xml @@ -4,7 +4,7 @@
- 20042013 + 20042016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/part_notes_history.xml b/erts/doc/src/part_notes_history.xml index 055d1681d5..277683a2b5 100644 --- a/erts/doc/src/part_notes_history.xml +++ b/erts/doc/src/part_notes_history.xml @@ -4,7 +4,7 @@
- 20062013 + 20062016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml index ac589f8cb5..aa245ec08a 100644 --- a/erts/doc/src/ref_man.xml +++ b/erts/doc/src/ref_man.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml index faec3c68c1..6b0fef7c0a 100644 --- a/erts/doc/src/run_erl.xml +++ b/erts/doc/src/run_erl.xml @@ -4,7 +4,7 @@
- 19992013 + 19992016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/start.xml b/erts/doc/src/start.xml index 386fbe6e88..adacf5b98d 100644 --- a/erts/doc/src/start.xml +++ b/erts/doc/src/start.xml @@ -4,7 +4,7 @@
- 19992013 + 19992016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/start_erl.xml b/erts/doc/src/start_erl.xml index 62610b43b0..243aeaa717 100644 --- a/erts/doc/src/start_erl.xml +++ b/erts/doc/src/start_erl.xml @@ -4,7 +4,7 @@
- 19982013 + 19982016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/tty.xml b/erts/doc/src/tty.xml index cd46d1203c..b2866c82cf 100644 --- a/erts/doc/src/tty.xml +++ b/erts/doc/src/tty.xml @@ -4,7 +4,7 @@
- 19962013 + 19962016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/werl.xml b/erts/doc/src/werl.xml index 9e7ad584eb..1a3cb6f502 100644 --- a/erts/doc/src/werl.xml +++ b/erts/doc/src/werl.xml @@ -4,7 +4,7 @@
- 19982013 + 19982016 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index 0a641346d9..861661043f 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -4,7 +4,7 @@
- 20052013 + 20052016 Ericsson AB. All Rights Reserved. -- cgit v1.2.3 From 4a736966eba5398a22697db6ca67e1e3dd3cd0f2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 10 Dec 2015 10:58:33 +0100 Subject: erts: Add enif_cpu/now_time and enif_make_unique_integer --- erts/doc/src/erl_nif.xml | 201 ++++++++++++++++++++++++++++++----------------- 1 file changed, 127 insertions(+), 74 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index be0e406b9c..e62f5792a5 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -591,6 +591,21 @@ typedef enum { + ErlNifUniqueInteger + +

An enumeration of the properties that can be requested from + + enif_unique_integer.

+ + ERL_NIF_UNIQUE_POSITIVE +

A positive integer

+ ERL_NIF_UNIQUE_MONOTONIC +

A + strictly + monotonically increasing integer corresponding to creation time

+
+
+
@@ -689,7 +704,49 @@ typedef enum { a number of repeated NIF-calls without the need to create threads. See also the warning text at the beginning of this document.

+ + + + + ErlNifTimeenif_convert_time_unit(ErlNifTime val, ErlNifTimeUnit from, ErlNifTimeUnit to) + Convert time unit of a time value + + +

Arguments:

+ + val + Value to convert time unit for. + from + Time unit of val. + to + Time unit of returned value. + +

Converts the val value of time unit from to + the corresponding value of time unit to. The result is + rounded using the floor function.

+

Returns ERL_NIF_TIME_ERROR if called with an invalid + time unit argument.

+

See also:

+ + ErlNifTime + ErlNifTimeUnit + +
+ + + ERL_NIF_TERMenif_cpu_time(ErlNifEnv *) + + +

Returns the CPU time in the same format as erlang:timestamp(). + The CPU time is the time the current logical cpu has spent executing since + some arbitrary point in the past. + If the OS does not support fetching of this value enif_cpu_time + invokes enif_make_badarg. +

+
+
+ intenif_equal_tids(ErlNifTid tid1, ErlNifTid tid2)

Same as erl_drv_equal_tids. @@ -1195,6 +1252,24 @@ typedef enum { Create an unsigned integer term

Create an integer term from an unsigned 64-bit integer.

+ + ERL_NIF_TERMenif_make_unique_integer(ErlNifEnv *env, ErlNifUniqueInteger properties) + + +

Returns a unique integer with the same properties as given by erlang:unique_integer/1.

+

env is the environment to create the integer in.

+

+ ERL_NIF_UNIQUE_POSITIVE and ERL_NIF_UNIQUE_MONOTONIC can + be passed as the second argument to change the properties of the + integer returned. It is possible to combine them by or:ing the + two values together. +

+

See also:

+ + ErlNifUniqueInteger + +
+
ERL_NIF_TERMenif_make_ulong(ErlNifEnv* env, unsigned long i) Create an integer term from an unsigned long int

Create an integer term from an unsigned long int.

@@ -1265,6 +1340,34 @@ enif_map_iterator_destroy(env, &iter); or false if the iterator is positioned at the head (before the first entry).

+ + + ErlNifTimeenif_monotonic_time(ErlNifTimeUnit time_unit) + Get Erlang Monotonic Time + + +

Arguments:

+ + time_unit + Time unit of returned value. + +

+ Returns + Erlang + monotonic time. Note that it is not uncommon with + negative values. +

+

Returns ERL_NIF_TIME_ERROR if called with an invalid + time unit argument, or if called from a thread that is not a + scheduler thread.

+

See also:

+ + ErlNifTime + ErlNifTimeUnit + +
+
+ ErlNifMutex *enif_mutex_create(char *name)

Same as erl_drv_mutex_create. @@ -1290,6 +1393,11 @@ enif_map_iterator_destroy(env, &iter);

Same as erl_drv_mutex_unlock.

+ ERL_NIF_TERMenif_now_time(ErlNifEnv *env) + +

Retuns an erlang:now() timestamp. + The enif_now_time function is deprecated.

+
ErlNifResourceType *enif_open_resource_type(ErlNifEnv* env, const char* module_str, const char* name, ErlNifResourceDtor* dtor, ErlNifResourceFlags flags, ErlNifResourceFlags* tried) @@ -1496,54 +1604,6 @@ enif_map_iterator_destroy(env, &iter);

Same as erl_drv_thread_self.

- intenif_tsd_key_create(char *name, ErlNifTSDKey *key) - -

Same as erl_drv_tsd_key_create. -

-
- voidenif_tsd_key_destroy(ErlNifTSDKey key) - -

Same as erl_drv_tsd_key_destroy. -

-
- void *enif_tsd_get(ErlNifTSDKey key) - -

Same as erl_drv_tsd_get. -

-
- voidenif_tsd_set(ErlNifTSDKey key, void *data) - -

Same as erl_drv_tsd_set. -

-
- - - - ErlNifTimeenif_monotonic_time(ErlNifTimeUnit time_unit) - Get Erlang Monotonic Time - - -

Arguments:

- - time_unit - Time unit of returned value. - -

- Returns - Erlang - monotonic time. Note that it is not uncommon with - negative values. -

-

Returns ERL_NIF_TIME_ERROR if called with an invalid - time unit argument, or if called from a thread that is not a - scheduler thread.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - -
-
ErlNifTimeenif_time_offset(ErlNifTimeUnit time_unit) @@ -1571,33 +1631,26 @@ enif_map_iterator_destroy(env, &iter); - - ErlNifTimeenif_convert_time_unit(ErlNifTime val, ErlNifTimeUnit from, ErlNifTimeUnit to) - Convert time unit of a time value - - -

Arguments:

- - val - Value to convert time unit for. - from - Time unit of val. - to - Time unit of returned value. - -

Converts the val value of time unit from to - the corresponding value of time unit to. The result is - rounded using the floor function.

-

Returns ERL_NIF_TIME_ERROR if called with an invalid - time unit argument.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - -
+ intenif_tsd_key_create(char *name, ErlNifTSDKey *key) + +

Same as erl_drv_tsd_key_create. +

+
+ voidenif_tsd_key_destroy(ErlNifTSDKey key) + +

Same as erl_drv_tsd_key_destroy. +

+
+ void *enif_tsd_get(ErlNifTSDKey key) + +

Same as erl_drv_tsd_get. +

+
+ voidenif_tsd_set(ErlNifTSDKey key, void *data) + +

Same as erl_drv_tsd_set. +

-
SEE ALSO -- cgit v1.2.3 From 348f3f2ee2d2707e30658c3600e05309ad0e72bf Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 10 Dec 2015 10:59:34 +0100 Subject: erts: Add enif_is_process/port_alive --- erts/doc/src/erl_nif.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index e62f5792a5..6befdc124b 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -532,6 +532,14 @@ typedef struct { environment. ErlNifPid is an opaque type.

+ ErlNifPort + +

ErlNifPort is a port identifier. In contrast to + port id terms (instances of ERL_NIF_TERM), ErlNifPort's are self + contained and not bound to any + environment. ErlNifPort + is an opaque type.

+
ErlNifResourceType @@ -801,6 +809,12 @@ typedef enum { pid variable *pid from it and return true. Otherwise return false. No check if the process is alive is done.

+ intenif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port_id) + Read an local port term +

If term is the port of a node local port, initialize the + port variable *port_id from it and return true. Otherwise return false. + No check if the port is alive is done.

+
intenif_get_list_cell(ErlNifEnv* env, ERL_NIF_TERM list, ERL_NIF_TERM* head, ERL_NIF_TERM* tail) Get head and tail from a list

Set *head and *tail from @@ -969,6 +983,17 @@ typedef enum { Determine if a term is a port

Return true if term is a port.

+ intenif_is_port_alive(ErlNifEnv* env, ErlNifPort *port_id) + Determine if a local port is alive or not. +

Return true if port_id is currently alive.

+

This function can only be used in a from a NIF-calling thread.

+
+ intenif_is_process_alive(ErlNifEnv* env, ErlNifPid *pid) + Determine if a local process is alive or not. +

Return true if pid is currently alive.

+

This function is only thread-safe when the emulator with SMP support is used. + It can only be used in a non-SMP emulator from a NIF-calling thread.

+
intenif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is a reference

Return true if term is a reference.

-- cgit v1.2.3 From 1bd56e2b5141a3afdca4e854e9b667807bf4e2f3 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 17 Dec 2015 14:14:54 +0100 Subject: erts: Add enif_term_to_binary and enif_binary_to_term --- erts/doc/src/erl_nif.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 6befdc124b..47d84bb813 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -655,6 +655,18 @@ typedef enum { have been allocated with enif_alloc_env.

+ intenif_binary_to_term(ErlNifEnv *env, ErlNifBinary *bin, ERL_NIF_TERM *term) + Convert a term from the external format + +

Returns a term that is the result of decoding bin + according to the Erlang external term format.

+

See also:

+ + erlang:binary_to_term/1 + enif_term_to_binary + +
+
intenif_compare(ERL_NIF_TERM lhs, ERL_NIF_TERM rhs) Compare two terms

Return an integer less than, equal to, or greater than @@ -1599,6 +1611,18 @@ enif_map_iterator_destroy(env, &iter);

Same as driver_system_info.

+ intenif_term_to_binary(ErlNifEnv *env, ERL_NIF_TERM term, ErlNifBinary *bin) + Convert a term to the external format + +

Returns a binary data object that is the result of encoding term + according to the Erlang external term format.

+

See also:

+ + erlang:term_to_binary/1 + enif_binary_to_term + +
+
intenif_thread_create(char *name,ErlNifTid *tid,void * (*func)(void *),void *args,ErlNifThreadOpts *opts)

Same as erl_drv_thread_create. -- cgit v1.2.3 From 209c5cf22b5cdc70eb48e6afdcddfa7132471aab Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 1 Feb 2016 11:01:40 +0100 Subject: erts: Add enif_port_command --- erts/doc/src/erl_nif.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 47d84bb813..81b6eed24a 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1464,6 +1464,38 @@ enif_map_iterator_destroy(env, &iter); and upgrade.

+ intenif_port_command(ErlNifEnv* env, const ErlNifPort* to_port, ErlNifEnv *msg_env, ERL_NIF_TERM msg) + Send a port_command to to_port + +

This function works the same as erlang:port_command/2 + except that it is always completely asynchronous. This call may return false + if it detects that the port is already dead, otherwise it will return true. +

+ + env + The environment of the calling process. May not be NULL. + *to_port + The port id of the receiving port. The port id should refer to a + port on the local node. + msg_env + The environment of the message term. Can be a process + independent environment allocated with + enif_alloc_env or NULL. + msg + The message term to send. The same limitations apply as on the + payload to erlang:port_command/2. + +

Using a msg_env of NULL is an optimization which groups together + calls to enif_alloc_env, enif_make_copy, enif_port_command + and enif_free_env into one call. This optimization is only usefull + when a majority of the terms are to be copied from env to the msg_env.

+

The call may return false if it detects that the command failed for some reason. Otherwise true is returned.

+

See also:

+ + enif_get_local_port + +
+
void *enif_priv_data(ErlNifEnv* env) Get the private data of a NIF library

Return the pointer to the private data that was set by load, -- cgit v1.2.3 From a2a86dadc648dda68b5221a7c1d83b9238be1e25 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 12 Feb 2016 18:52:20 +0100 Subject: erts: Improve enif_binary_to_term * Accept a raw data buffer instead of ErlNifBinary * Accept option ERL_NIF_BIN2TERM_SAFE * Return number of read bytes --- erts/doc/src/erl_nif.xml | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 81b6eed24a..7a8325c200 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -524,6 +524,18 @@ typedef struct {

Note that ErlNifBinary is a semi-opaque type and you are only allowed to read fields size and data.

+ + ErlNifBinaryToTerm + +

An enumeration of the options that can be given to + enif_binary_to_term. + For default behavior, use the value 0.

+ + ERL_NIF_BIN2TERM_SAFE +

Use this option when receiving data from untrusted sources.

+
+
+ ErlNifPid

ErlNifPid is a process identifier (pid). In contrast to @@ -655,16 +667,23 @@ typedef enum { have been allocated with enif_alloc_env.

- intenif_binary_to_term(ErlNifEnv *env, ErlNifBinary *bin, ERL_NIF_TERM *term) - Convert a term from the external format + size_tenif_binary_to_term(ErlNifEnv *env, const unsigned char* data, size_t size, ERL_NIF_TERM *term, ErlNifBinaryToTerm opts) + Create a term from the external format -

Returns a term that is the result of decoding bin - according to the Erlang external term format.

-

See also:

- - erlang:binary_to_term/1 - enif_term_to_binary - +

Create a term that is the result of decoding the binary data + at data, which must be encoded according to the Erlang external term format. + No more than size bytes are read from data. Argument opts + correspond to the second argument to + erlang:binary_to_term/2, and must be either 0 or + ERL_NIF_BIN2TERM_SAFE.

+

On success, store the resulting term at *term and return + the actual number of bytes read. Return zero if decoding fails or if opts + is invalid.

+

See also: + ErlNifBinaryToTerm, + erlang:binary_to_term/2 and + enif_term_to_binary. +

intenif_compare(ERL_NIF_TERM lhs, ERL_NIF_TERM rhs) -- cgit v1.2.3 From 42a7116dc64892ef4bf7a1483aa9df82d9a34439 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 12 Feb 2016 18:59:44 +0100 Subject: erts: Polish erl_nif docs --- erts/doc/src/erl_nif.xml | 69 ++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 37 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 7a8325c200..1e95634d1b 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -614,13 +614,13 @@ typedef enum { ErlNifUniqueInteger

An enumeration of the properties that can be requested from - - enif_unique_integer.

+ enif_unique_integer. + For default properties, use the value 0.

ERL_NIF_UNIQUE_POSITIVE -

A positive integer

+

Return only positive integers

ERL_NIF_UNIQUE_MONOTONIC -

A +

Return only strictly monotonically increasing integer corresponding to creation time

@@ -765,11 +765,10 @@ typedef enum { rounded using the floor function.

Returns ERL_NIF_TIME_ERROR if called with an invalid time unit argument.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - +

See also: + ErlNifTime and + ErlNifTimeUnit. +

@@ -842,7 +841,7 @@ typedef enum {
intenif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port_id) Read an local port term -

If term is the port of a node local port, initialize the +

If term identifies a node local port, initialize the port variable *port_id from it and return true. Otherwise return false. No check if the port is alive is done.

@@ -1074,7 +1073,7 @@ typedef enum { enif_is_exception, but not to any other NIF API function.

See also: enif_has_pending_exception - and enif_raise_exception + and enif_raise_exception.

In earlier versions (older than erts-7.0, OTP 18) the return value from enif_make_badarg had to be returned from the NIF. This @@ -1320,10 +1319,9 @@ typedef enum { integer returned. It is possible to combine them by or:ing the two values together.

-

See also:

- - ErlNifUniqueInteger - +

See also: + ErlNifUniqueInteger. +

ERL_NIF_TERMenif_make_ulong(ErlNifEnv* env, unsigned long i) @@ -1408,7 +1406,7 @@ enif_map_iterator_destroy(env, &iter); Time unit of returned value.

- Returns + Returns the current Erlang monotonic time. Note that it is not uncommon with negative values. @@ -1416,11 +1414,10 @@ enif_map_iterator_destroy(env, &iter);

Returns ERL_NIF_TIME_ERROR if called with an invalid time unit argument, or if called from a thread that is not a scheduler thread.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - +

See also: + ErlNifTime and + ErlNifTimeUnit. +

@@ -1509,10 +1506,7 @@ enif_map_iterator_destroy(env, &iter); and enif_free_env into one call. This optimization is only usefull when a majority of the terms are to be copied from env to the msg_env.

The call may return false if it detects that the command failed for some reason. Otherwise true is returned.

-

See also:

- - enif_get_local_port - +

See also: enif_get_local_port.

void *enif_priv_data(ErlNifEnv* env) @@ -1649,6 +1643,8 @@ enif_map_iterator_destroy(env, &iter); of cleared for reuse with enif_clear_env.

This function is only thread-safe when the emulator with SMP support is used. It can only be used in a non-SMP emulator from a NIF-calling thread.

+

Passing msg_env as NULL is only supported since + erts-8.0 (OTP 19).

unsignedenif_sizeof_resource(void* obj) @@ -1665,13 +1661,13 @@ enif_map_iterator_destroy(env, &iter); intenif_term_to_binary(ErlNifEnv *env, ERL_NIF_TERM term, ErlNifBinary *bin) Convert a term to the external format -

Returns a binary data object that is the result of encoding term - according to the Erlang external term format.

-

See also:

- - erlang:term_to_binary/1 - enif_binary_to_term - +

Allocates a new binary with enif_alloc_binary + and stores the result of encoding term according to the Erlang external term format.

+

Returns true on success or false if allocation failed.

+

See also: + erlang:term_to_binary/1 and + enif_binary_to_term. +

intenif_thread_create(char *name,ErlNifTid *tid,void * (*func)(void *),void *args,ErlNifThreadOpts *opts) @@ -1723,11 +1719,10 @@ enif_map_iterator_destroy(env, &iter);

Returns ERL_NIF_TIME_ERROR if called with an invalid time unit argument, or if called from a thread that is not a scheduler thread.

-

See also:

- - ErlNifTime - ErlNifTimeUnit - +

See also: + ErlNifTime and + ErlNifTimeUnit. +

-- cgit v1.2.3 From 7765727317721d5de5949a5f39e0211f3b920da7 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 1 Apr 2016 20:19:12 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index acd816a81c..7ccddf4ff0 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,71 @@

This document describes the changes made to the ERTS application.

+
Erts 7.3.1 + +
Fixed Bugs and Malfunctions + + +

+ process_info(Pid, last_calls) did not work for + Pid /= self().

+

+ Own Id: OTP-13418

+
+ +

+ Make sure to create a crash dump when running out of + memory. This was accidentally removed in the erts-7.3 + release.

+

+ Own Id: OTP-13419

+
+ +

+ Schedulers could be woken by a premature timeout on + Linux. This premature wakeup was however harmless.

+

+ Own Id: OTP-13420

+
+ +

+ A process communicating with a port via one of the + erlang:port_* BIFs could potentially end up in an + inconsistent state if the port terminated during the + communication. When this occurred the process could later + block in a receive even though it had messages + matching in its message queue.

+

+ This bug was introduced in erts version 5.10 (OTP R16A).

+

+ Own Id: OTP-13424 Aux Id: OTP-10336

+
+ +

+ The reference count of a process structure could under + rare circumstances be erroneously managed. When this + happened invalid memory accesses occurred.

+

+ Own Id: OTP-13446

+
+ +

+ Fix race between process_flag(trap_exit,true) and + a received exit signal.

+

+ A process could terminate due to exit signal even though + process_flag(trap_exit,true) had returned. A very + specific timing between call to process_flag/2 and + exit signal from another scheduler was required for this + to happen.

+

+ Own Id: OTP-13452

+
+
+
+ +
+
Erts 7.3
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 57551877d85ad7659201235e27498be42809fefb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 18 Feb 2016 13:52:54 +0100 Subject: erts: Add enif_send with NULL as msg env This is an optimization for reducing the number of heap fragments allocated when sending a message where the majority of the message payload is on the sending process' heap. --- erts/doc/src/erl_nif.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 1e95634d1b..1bfd98f664 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1632,7 +1632,7 @@ enif_map_iterator_destroy(env, &iter); msg_env The environment of the message term. Must be a process independent environment allocated with - enif_alloc_env. + enif_alloc_env or NULL. msg The message term to send. @@ -1641,6 +1641,8 @@ enif_map_iterator_destroy(env, &iter); msg) will be invalidated by a successful call to enif_send. The environment should either be freed with enif_free_env of cleared for reuse with enif_clear_env.

+

If msg_env is set to NULL the msg term is copied and + the original term and its environemt is still valid after the call.

This function is only thread-safe when the emulator with SMP support is used. It can only be used in a non-SMP emulator from a NIF-calling thread.

Passing msg_env as NULL is only supported since -- cgit v1.2.3 From 37092dab15448ef6a078800e3ff0cc41880ea765 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 10 Dec 2015 11:10:46 +0100 Subject: erts: Implement tracer modules Add the possibility to use modules as trace data receivers. The functions in the module have to be nifs as otherwise complex trace probes will be very hard to handle (complex means trace probes for ports for example). This commit changes the way that the ptab->tracer field works from always being an immediate, to now be NIL if no tracer is present or else be the tuple {TracerModule, TracerState} where TracerModule is an atom that is later used to lookup the appropriate tracer callbacks to call and TracerState is just passed to the tracer callback. The default process and port tracers have been rewritten to use the new API. This commit also changes the order which trace messages are delivered to the potential tracer process. Any enif_send done in a tracer module may be delayed indefinitely because of lock order issues. If a message is delayed any other trace message send from that process is also delayed so that order is preserved for each traced entity. This means that for some trace events (i.e. send/receive) the events may come in an unintuitive order (receive before send) to the trace receiver. Timestamps are taken when the trace message is generated so trace messages from differented processes may arrive with the timestamp out of order. Both the erlang:trace and seq_trace:set_system_tracer accept the new tracer module tracers and also the backwards compatible arguments. OTP-10267 --- erts/doc/src/Makefile | 15 +- erts/doc/src/erl_nif.xml | 3 +- erts/doc/src/erl_tracer.xml | 324 ++++++++++++++++++++++++++++++++++++++++++++ erts/doc/src/erlang.xml | 46 ++++--- erts/doc/src/match_spec.xml | 11 +- erts/doc/src/ref_man.xml | 1 + erts/doc/src/specs.xml | 1 + 7 files changed, 365 insertions(+), 36 deletions(-) create mode 100644 erts/doc/src/erl_tracer.xml (limited to 'erts/doc') diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index e02e89238e..b96cbbce40 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -50,12 +50,14 @@ XML_REF1_FILES = epmd.xml \ XML_REF3_EFILES = \ erl_prim_loader.xml \ erlang.xml \ + erl_tracer.xml \ init.xml \ zlib.xml XML_REF3_FILES = \ driver_entry.xml \ erl_nif.xml \ + erl_tracer.xml \ erl_driver.xml \ erl_prim_loader.xml \ erlang.xml \ @@ -154,18 +156,9 @@ clean: rm -f $(SPECDIR)/* rm -f errs core *~ -$(SPECDIR)/specs_driver_entry.xml: +$(SPECDIR)/specs_%.xml: escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ - -o$(dir $@) -module driver_entry -$(SPECDIR)/specs_erl_nif.xml: - escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ - -o$(dir $@) -module erl_nif -$(SPECDIR)/specs_erl_driver.xml: - escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ - -o$(dir $@) -module erl_driver -$(SPECDIR)/specs_erts_alloc.xml: - escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ - -o$(dir $@) -module erts_alloc + -o$(dir $@) -module $(patsubst $(SPECDIR)/specs_%.xml,%,$@) # ---------------------------------------------------- # Release Target diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 5f56d8b595..7546f7ef81 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -566,8 +566,7 @@ typedef struct { typedef void ErlNifResourceDtor(ErlNifEnv* env, void* obj); -

The function prototype of a resource destructor function. - A destructor function is not allowed to call any term-making functions.

+

The function prototype of a resource destructor function.

ErlNifCharEncoding diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml new file mode 100644 index 0000000000..1e8e78b25f --- /dev/null +++ b/erts/doc/src/erl_tracer.xml @@ -0,0 +1,324 @@ + + + + +
+ + 20162016 + Ericsson AB. All Rights Reserved. + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + erl_tracer + + + + +
+ erl_tracer + Erlang Tracer Behaviour + +

A behaviour module for implementing the back end of the erlang + tracing system. The functions in this module will be called whenever + a trace probe is triggered. Both the enabled and trace + functions are called in the context of the entity that triggered the + trace probe. + This means that the overhead by having the tracing enabled will be + greatly effected by how much time is spent in these functions. So do as + little work as possible in these functions.

+ +

All functions in this behaviour have to be implemented as NIF's. + This is a limitation that may the lifted in the future. + There is an example tracer module nif + implementation at the end of this page.

+
+ +

Do not send messages or issue port commands to the Tracee + in any of the callbacks. Doing so is not allowed and can cause all + sorts of strange behaviour, including but not limited to infinite + recursions.

+
+
+ + + + + +

The different trace tags that the tracer will be called with. + Each trace tag is described in greater detail in + Module:trace/6 +

+
+
+ + + +

The process or port that the trace belongs to. +

+
+
+ + + +

The options for the tracee. + + timestamp + If not set to undefined, the tracer has been requested to + include a timestamp. + match_spec_result + If not set to true, the tracer has been requested to + include the output of a match specification that was run. + scheduler_id + Set to a number of the scheduler id is to be included by the tracer. + Otherwise it is set to undefined. + +

+
+
+ + + +

+ The state which is given when calling + erlang:trace(PidPortSpec,true,[{tracer,Module,TracerState}]). + The tracer state is an immutable value that is passed to erl_tracer callbacks and should + contain all the data that is needed to generate the trace event. +

+
+
+
+ +
+ CALLBACK FUNCTIONS +

The following functions + should be exported from a erl_tracer callback module.

+
+ + + + Module:enabled(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag() | trace_status + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a trace point is triggered. It + allows the tracer to decide whether a trace should be generated or not. + This check is made as early as possible in order to limit the amount of + overhead associated with tracing. If trace is returned the + necessary trace data will be created and the trace call-back of the tracer + will be called. If discard is returned, this trace call + will be discarded and no call to trace will be done. If + remove is returned, the VM will attempt to remove this tracer + from the tracee, together with any trace flags set on the tracee. +

+

trace_status is a special type of TraceTag which is used + to check if the tracer should still be active. It is called in multiple + scenarios, but most significantly it is used when tracing is started + using this tracer.

+

This function may be called multiple times per trace point, so it + is important that it is both fast and side effect free.

+
+
+ + + Module:trace(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a trace point is triggered and + the Module:enabled/3 + callback returned trace. In it any side effects needed by + the tracer should be done. The trace point payload is located in + the FirstTraceTerm and SecondTraceTerm. The content + of the TraceTerms depends on which TraceTag has been triggered. + The FirstTraceTerm and SecondTraceTerm correspond to the + fourth and fifth slot in the trace tuples described in + erlang:trace/3. + If the tuple only has four elements, SecondTraceTerm will be + undefined.

+
+
+ + Module:trace(seq_trace, TracerState, Label, SeqTraceInfo, undefined, Opts) -> Result + Check if a sequence trace event should be generated. + + TracerState = term() + Label = term() + SeqTraceInfo = term() + Opts = trace_opts() + Result = ok + + +

The TraceTag seq_trace is handled a little bit + differently. There is not Tracee for seq_trace, instead the + Label associated with the seq_trace event is given. + For more info on what Label and SeqTraceInfo can be + see the seq_trace manual.

+
+
+
+
+ + Erl Tracer Module example +

In the example below a tracer module with a nif backend sends a message + for each send trace tag containing only the sender and receiver. + Using this tracer module, a much more lightweight message tracer is + used that only records who sent messages to who.

+

Here is an example session using it on Linux.

+
+$ gcc -I erts-8.0/include/ -fPIC -shared -o erl_msg_tracer.so erl_msg_tracer.c
+$ erl
+Erlang/OTP 19 [DEVELOPMENT] [erts-8.0] [source-ed2b56b] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
+
+Eshell V8.0  (abort with ^G)
+1> c(erl_msg_tracer), erl_msg_tracer:load().
+ok
+2> Tracer = spawn(fun F() -> receive M -> io:format("~p~n",[M]), F() end end).
+<0.37.0>
+3> erlang:trace(new, true, [send,{tracer, erl_msg_tracer, Tracer}]).
+0
+{<0.39.0>,<0.27.0>}
+4> {ok, D} = file:open("/tmp/tmp.data",[write]).
+{trace,#Port<0.486>,<0.40.0>}
+{trace,<0.40.0>,<0.21.0>}
+{trace,#Port<0.487>,<0.4.0>}
+{trace,#Port<0.488>,<0.4.0>}
+{trace,#Port<0.489>,<0.4.0>}
+{trace,#Port<0.490>,<0.4.0>}
+{ok,<0.40.0>}
+{trace,<0.41.0>,<0.27.0>}
+5>
+    
+

erl_msg_tracer.erl

+
+-module(erl_msg_tracer).
+
+-export([enabled/3, trace/6, load/0]).
+
+load() ->
+    erlang:load_nif("erl_msg_tracer", []).
+
+enabled(_, _, _) ->
+    error.
+
+trace(_, _, _,_, _, _) ->
+    error.
+    
+

erl_msg_tracer.c

+
+#include "erl_nif.h"
+
+/* NIF interface declarations */
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info);
+static void unload(ErlNifEnv* env, void* priv_data);
+
+/* The NIFs: */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+
+static ErlNifFunc nif_funcs[] = {
+    {"enabled", 3, enabled},
+    {"trace", 6, trace}
+};
+
+ERL_NIF_INIT(erl_msg_tracer, nif_funcs, load, NULL, upgrade, unload)
+
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
+{
+    *priv_data = NULL;
+    return 0;
+}
+
+static void unload(ErlNifEnv* env, void* priv_data)
+{
+
+}
+
+static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data,
+		   ERL_NIF_TERM load_info)
+{
+    if (*old_priv_data != NULL || *priv_data != NULL) {
+	return -1; /* Don't know how to do that */
+    }
+    if (load(env, priv_data, load_info)) {
+	return -1;
+    }
+    return 0;
+}
+
+/*
+ * argv[0]: Trace Tag
+ * argv[1]: TracerState
+ * argv[2]: Tracee
+ */
+static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+    ErlNifPid to_pid;
+    if (enif_get_local_pid(env, argv[1], &to_pid))
+        if (!enif_is_process_alive(env, &to_pid))
+            /* tracer is dead so we should remove this trace point */
+            return enif_make_atom(env, "remove");
+
+    /* Only generate trace for when tracer != tracee */
+    if (enif_is_identical(argv[1], argv[2]))
+        return enif_make_atom(env, "discard");
+
+    /* Only trigger trace messages on 'send' */
+    if (enif_is_identical(enif_make_atom(env, "send"), argv[0]))
+        return enif_make_atom(env, "trace");
+
+    /* Have to answer trace_status */
+    if (enif_is_identical(enif_make_atom(env, "trace_status"), argv[0]))
+        return enif_make_atom(env, "trace");
+
+    return enif_make_atom(env, "discard");
+}
+
+/*
+ * argv[0]: Trace Tag, should only be 'send'
+ * argv[1]: TracerState, process to send {argv[2], argv[4]} to
+ * argv[2]: Tracee
+ * argv[3]: Message, ignored
+ * argv[4]: Recipient
+ * argv[5]: Options, ignored
+ */
+static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+    ErlNifPid to_pid;
+
+    if (enif_get_local_pid(env, argv[1], &to_pid)) {
+        ERL_NIF_TERM msg = enif_make_tuple3(env, enif_make_atom(env, "trace"), argv[2], argv[4]);
+        enif_send(env, &to_pid, NULL, msg);
+    }
+
+    return enif_make_atom(env, "ok");
+}
+    
+
+
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index ef577c82bf..86bdb1dfe6 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8371,7 +8371,7 @@ timestamp() -> all -

Sets all trace flags except {tracer, Tracer} and +

Sets all trace flags except tracer and cpu_timestamp, which are in their nature different than the others.

@@ -8529,12 +8529,20 @@ timestamp() ->

Specifies where to send the trace messages. Tracer must be the process identifier of a local process - or the port identifier - of a local port. If this flag is not given, trace - messages are sent to the process that called - erlang:trace/3.

+ or the port identifier of a local port.

+
+ {tracer, TracerModule, TracerState} + +

Specifies that a tracer module should be called + instead of sending a trace message. The tracer module + can then ignore or change the trace message. For more details + on how to write a tracer module see + erl_tracer +

+

If no tracer is given, the calling process + will be receiving all of the trace messages

The effect of combining set_on_first_link with set_on_link is the same as having set_on_first_link alone. Likewise for @@ -8706,9 +8714,9 @@ timestamp() -> garbage collection.

-

If the tracing process dies, the flags are silently - removed.

-

Only one process can trace a particular process. Therefore, +

If the tracing process/port dies or the tracer module returns + remove, the flags are silently removed.

+

Each process can only be traced by one tracer. Therefore, attempts to trace an already traced process fail.

Returns: A number indicating the number of processes that matched PidSpec. @@ -8716,7 +8724,7 @@ timestamp() -> identifier, the return value is 1. If PidSpec is all or existing, the return value is - the number of processes running, excluding tracer processes. + the number of processes running. If PidSpec is new, the return value is 0.

Failure: badarg if the specified arguments are @@ -8750,7 +8758,7 @@ timestamp() -> has not been traced by someone, but if this is the case, no trace messages have been delivered when the trace_delivered message arrives.

-

Notice that that Tracee must refer +

Notice that Tracee must refer to a process currently, or previously existing on the same node as the caller of erlang:trace_delivered(Tracee) resides on. @@ -8801,7 +8809,8 @@ timestamp() -> tracer -

Returns the identifier for process or port tracing this +

Returns the identifier for process, port or a tuple containing + the tracer module and tracer state tracing this process. If this process is not being traced, the return value is [].

@@ -8830,8 +8839,8 @@ timestamp() -> meta -

Returns the meta-trace tracer process or port for this - function, if it has one. If the function is not +

Returns the meta-trace tracer process, port or trace module + for this function, if it has one. If the function is not meta-traced, the returned value is false. If the function is meta-traced but has once detected that the tracer process is invalid, the returned value is [].

@@ -8999,13 +9008,12 @@ timestamp() -> the process, a return_to message is also sent when this function returns to its caller.

- meta | {meta, Pid} + meta | {meta, Pid} | {meta, TracerModule, TracerState} +

Turns on or off meta-tracing for all types of function - calls. Trace messages are sent to the tracer process - or port Pid whenever any of the specified - functions are called, regardless of how they are called. - If no Pid is specified, + calls. Trace messages are sent to the tracer whenever any of + the specified functions are called. If no tracer is specified, self() is used as a default tracer process.

Meta-tracing traces all processes and does not care about the process trace flags set by trace/3, @@ -9013,7 +9021,7 @@ timestamp() -> [call, timestamp].

The match specification function {return_trace} works with meta-trace and sends its trace message to the - same tracer process.

+ same tracer.

call_count diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index 975f01cf2c..b49e1483aa 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -287,7 +287,7 @@ can not be one of the atoms , or (unless, of course, they are registered names). can not be nor - . + . Returns and may only be used in the part when tracing.

@@ -298,7 +298,7 @@ be either a process identifier or a registered name and is given as the first argument to the match_spec function. can not be nor - . Returns + . Returns and may only be used in the part when tracing.

@@ -308,11 +308,14 @@ disable list is applied first, but effectively all changes are applied atomically. The trace flags are the same as for not including - but including . If a + but including . If a tracer is specified in both lists, the tracer in the enable list takes precedence. If no tracer is specified the same tracer as the process executing the match spec is - used. With three parameters to this function the first is + used. When using a tracer module + the module has to be loaded before the match specification is executed. + If it is not loaded the match will fail. + With three parameters to this function the first is either a process identifier or the registered name of a process to set trace flags on, the second is the disable list, and the third is the enable list. Returns diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml index aa245ec08a..e45402a397 100644 --- a/erts/doc/src/ref_man.xml +++ b/erts/doc/src/ref_man.xml @@ -56,5 +56,6 @@ + diff --git a/erts/doc/src/specs.xml b/erts/doc/src/specs.xml index 41a3984659..ed6be650e5 100644 --- a/erts/doc/src/specs.xml +++ b/erts/doc/src/specs.xml @@ -2,6 +2,7 @@ + -- cgit v1.2.3 From 6cb6b59cd4cd5bd4383053e12ae8ab192711c827 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 8 Feb 2016 18:31:43 +0100 Subject: erts: Extend process and port tracing This commit completes the tracing for processes so that all messages sent by a process (via nifs or otherwise) will be traced. The commit also adds tracing of all types of events from ports. When enabling tracing using erlang:trace, the 'all' flag now also enables tracing on all ports. OTP-13496 --- erts/doc/src/erlang.xml | 329 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 251 insertions(+), 78 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 86bdb1dfe6..abc0d56983 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8347,22 +8347,47 @@ timestamp() -> How == false) the trace flags in FlagList for the process or processes represented by - PidSpec.

-

PidSpec is either a process identifier - (pid) for a local process, or one of the following atoms:

+ PidPortSpec.

+

PidPortSpec is either a process identifier + (pid) for a local process, a port identifier, + or one of the following atoms:

+ all + +

All currently existing processes and ports and all that + will be created in the future.

+
+ processes + +

All currently existing processes and all that will be created in the future.

+
+ ports + +

All currently existing ports and all that will be created in the future.

+
existing + +

All currently existing processes and ports.

+
+ existing_processes

All currently existing processes.

+ existing_ports + +

All currently existing ports.

+
new -

All processes that are created in the future.

+

All processes and ports that will be created in the future.

- all + new_processes -

All currently existing processes and all processes that - are created in the future.

+

All processes that will be created in the future.

+
+ new_ports + +

All ports that will be created in the future.

FlagList can contain any number of the @@ -8378,28 +8403,21 @@ timestamp() -> send

Traces sending of messages.

-

Message tags: send and - send_to_non_existing_process.

+

Message tags: send and + send_to_non_existing_process.

'receive'

Traces receiving of messages.

-

Message tags: 'receive'.

-
- procs - -

Traces process-related events.

-

Message tags: spawn, exit, - register, unregister, link, - unlink, getting_linked, and - getting_unlinked.

+

Message tags: 'receive'.

- call +call

Traces certain function calls. Specify which function calls to trace by calling erlang:trace_pattern/3.

-

Message tags: call and return_from.

+

Message tags: call and + return_from.

silent @@ -8417,8 +8435,9 @@ timestamp() -> specification function {silent,Bool}, giving a high degree of control of which functions with which arguments that trigger the trace.

-

Message tags: call, return_from, and - return_to. Or rather, the absence of.

+

Message tags: call, + return_from, and + return_to. Or rather, the absence of.

return_to @@ -8439,23 +8458,62 @@ timestamp() ->

To get trace messages containing return values from functions, use the {return_trace} match specification action instead.

-

Message tags: return_to.

+

Message tags: return_to.

+
+ procs + +

Traces process-related events.

+

Message tags: spawn, + exit, + register, + unregister, + link, + unlink, + getting_linked, and + getting_unlinked.

+
+ ports + +

Traces port-related events.

+

Message tags: open, + closed, + register, + unregister, + getting_linked, and + getting_unlinked.

running

Traces scheduling of processes.

-

Message tags: in and out.

+

Message tags: in and + out.

exiting

Traces scheduling of exiting processes.

-

Message tags: in_exiting, out_exiting, and - out_exited.

+

Message tags: in_exiting, + out_exiting, and + out_exited.

+
+ running_procs + +

Traces scheduling of processes just like running. + However this option also includes schedule events when the + process executes within the context of a port without + being scheduled out itself.

+

Message tags: in and + out.

+
+ running_ports + +

Traces scheduling of ports.

+

Message tags: in and + out.

garbage_collection

Traces garbage collections of processes.

-

Message tags: gc_start and gc_end.

+

Message tags: gc_start and gc_end.

timestamp @@ -8470,8 +8528,8 @@ timestamp() -> 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 + Only allowed with PidPortSpec==all. If the + host machine OS does not support high-resolution CPU time measurements, trace/3 exits with badarg. Notice that most OS do not synchronize this value across cores, so be prepared @@ -8483,8 +8541,8 @@ timestamp() -> 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(nano_seconds). This flag overrides - the cpu_timestamp flag.

+ erlang:monotonic_time(nano_seconds). + This flag overrides the cpu_timestamp flag.

strict_monotonic_timestamp @@ -8493,9 +8551,9 @@ timestamp() -> 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(nano_seconds), - erlang:unique_integer([monotonic])}. This flag overrides - the cpu_timestamp flag.

+ {erlang:monotonic_time(nano_seconds), + erlang:unique_integer([monotonic])}. + This flag overrides the cpu_timestamp flag.

arity @@ -8563,21 +8621,36 @@ timestamp() -> the other one will become active.

- {trace, Pid, 'receive', Msg} - -

When Pid receives message Msg.

-
- {trace, Pid, send, Msg, To} + + + {trace, PidPort, send, Msg, To} + -

When Pid sends message Msg to +

When PidPort sends message Msg to process To.

- {trace, Pid, send_to_non_existing_process, Msg, To} + + + {trace, PidPort, send_to_non_existing_process, Msg, To} + -

When Pid sends message Msg to +

When PidPort sends message Msg to the non-existing process To.

- {trace, Pid, call, {M, F, Args}} + + + {trace, PidPort, 'receive', Msg} + + +

When PidPort receives message Msg. + If Msg is set to timeout, then a receive + statement may have timedout, or the process received + a message with the payload timeout.

+
+ + + {trace, Pid, call, {M, F, Args}} +

When Pid calls a traced function. The return values of calls are never supplied, only the call and its @@ -8586,7 +8659,10 @@ timestamp() -> change the contents of this message, so that Arity is specified instead of Args.

- {trace, Pid, return_to, {M, F, Arity}} + + + {trace, Pid, return_to, {M, F, Arity}} +

When Pid returns to the specified function. This trace message is sent if both @@ -8598,73 +8674,162 @@ timestamp() -> (that is, the functions match specification matched, and {message, false} was not an action).

- {trace, Pid, return_from, {M, F, Arity}, ReturnValue} + + + {trace, Pid, return_from, {M, F, Arity}, ReturnValue} +

When Pid returns from the specified function. This trace message is sent if flag call is set, and the function has a match specification with a return_trace or exception_trace action.

- {trace, Pid, exception_from, {M, F, Arity}, {Class, Value}} + + + {trace, Pid, exception_from, {M, F, Arity}, {Class, Value}} +

When Pid exits from the specified function because of an exception. This trace message is sent if flag call is set, and the function has a match specification with an exception_trace action.

- {trace, Pid, spawn, Pid2, {M, F, Args}} + + + {trace, Pid, spawn, Pid2, {M, F, Args}} +

When Pid spawns a new process Pid2 with the specified function call as entry point.

Args is supposed to be the argument list, but can be any term if the spawn is erroneous.

- {trace, Pid, exit, Reason} + + + {trace, Pid, exit, Reason} +

When Pid exits with reason Reason.

- {trace, Pid, link, Pid2} + + + {trace, PidPort, register, RegName} + + +

When PidPort gets the name RegName registered.

+
+ + + {trace, PidPort, unregister, RegName} + + +

When PidPort gets the name RegName unregistered. + This is done automatically when a registered + process or port exits.

+
+ + + {trace, Pid, link, Pid2} +

When Pid links to a process Pid2.

- {trace, Pid, unlink, Pid2} + + + {trace, Pid, unlink, Pid2} +

When Pid removes the link from a process Pid2.

- {trace, Pid, getting_linked, Pid2} + + + {trace, PidPort, getting_linked, Pid2} + -

When Pid gets linked to a process Pid2.

+

When PidPort gets linked to a process Pid2.

- {trace, Pid, getting_unlinked, Pid2} + + + {trace, PidPort, getting_unlinked, Pid2} + -

When Pid gets unlinked from a process Pid2.

+

When PidPort gets unlinked from a process Pid2.

- {trace, Pid, register, RegName} + + + {trace, Pid, exit, Reason} + -

When Pid gets the name RegName registered.

+

When Pid exits with reason Reason.

- {trace, Pid, unregister, RegName} + + + {trace, Port, open, Pid, Driver} + -

When Pid gets the name RegName unregistered. - This is done automatically when a registered - process exits.

+

When Pid opens a new port Port with + the running the Driver.

+

Driver is the name of the driver as an atom.

- {trace, Pid, in, {M, F, Arity} | 0} + + + {trace, Port, closed, Reason} + + +

When Port closed with Reason.

+
+ + + + {trace, Pid, in | in_exiting, {M, F, Arity} | 0} +

When Pid is scheduled to run. The process runs in function {M, F, Arity}. On some rare occasions, the current function cannot be determined, then the last element is 0.

- {trace, Pid, out, {M, F, Arity} | 0} + + + + + {trace, Pid, out | out_exiting | out_exited, {M, F, Arity} | 0} +

When Pid is scheduled out. The process was running in function {M, F, Arity}. On some rare occasions, the current function cannot be determined, then the last element is 0.

- {trace, Pid, gc_start, Info} + + + {trace, Port, in, Command | 0} + + +

When Port is scheduled to run. Command is the + first thing the port will execute, it may however run several + commands before being scheduled out. On some rare + occasions, the current function cannot be determined, + then the last element is 0.

+

The possible commands are: call | close | command | connect | control | flush | info | link | open | unlink

+
+ + + {trace, Port, out, Command | 0} + + +

When Port is scheduled out. The last command run + was Command. On some rare occasions, + the current function cannot be determined, then the last + element is 0. Command can contain the same + commands as in +

+
+ + + {trace, Pid, gc_start, Info} +

Sent when garbage collection is about to be started. @@ -8706,7 +8871,10 @@ timestamp() ->

All sizes are in words.

- {trace, Pid, gc_end, Info} + + + {trace, Pid, gc_end, Info} +

Sent when garbage collection is finished. Info contains the same kind of list as in message gc_start, @@ -8719,13 +8887,13 @@ timestamp() ->

Each process can only be traced by one tracer. Therefore, attempts to trace an already traced process fail.

Returns: A number indicating the number of processes that - matched PidSpec. - If PidSpec is a process + matched PidPortSpec. + If PidPortSpec is a process identifier, the return value is 1. - If PidSpec + If PidPortSpec is all or existing, the return value is the number of processes running. - If PidSpec is new, the return value is + If PidPortSpec is new, the return value is 0.

Failure: badarg if the specified arguments are not supported. For example, cpu_timestamp is not @@ -8787,12 +8955,15 @@ timestamp() -> -

Returns trace information about a process or function.

-

To get information about a process, - PidOrFunc is to - be a process identifier (pid) or the atom new. - The atom new means that the default trace state for - processes to be created is returned.

+

Returns trace information about a port, process or function.

+

To get information about a port or process, + PidPortOrFunc is to + be a process identifier (pid), port identifier or one of + the atoms new, new_processes, new_ports. + The atom new or new_processes means that the default trace + state for processes to be created is returned. The atom new_ports + means that the default trace state for ports to be created is returned. +

The following Items are valid:

flags @@ -8802,8 +8973,10 @@ timestamp() -> traces are enabled, and one or more of the followings atoms if traces are enabled: send, 'receive', set_on_spawn, call, - return_to, procs, set_on_first_spawn, - set_on_link, running, + return_to, procs, ports, set_on_first_spawn, + set_on_link, running, running_procs, + running_ports, silent, exiting + monotonic_timestamp, strict_monotonic_timestamp, garbage_collection, timestamp, and arity. The order is arbitrary.

@@ -8815,7 +8988,7 @@ timestamp() -> value is [].

-

To get information about a function, PidOrFunc is to +

To get information about a function, PidPortOrFunc is to be the three-element tuple {Module, Function, Arity} or the atom on_load. No wild cards are allowed. Returns undefined if the function does not exist, or @@ -8883,7 +9056,7 @@ timestamp() -> Value is the requested information as described earlier. If a pid for a dead process was given, or the name of a non-existing function, Value is undefined.

-

If PidOrFunc is on_load, the information +

If PidPortOrFunc is on_load, the information returned refers to the default value for code that will be loaded.

-- cgit v1.2.3 From ecd20cf55ffcc45632825863ea8f0c7442553a0d Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 23 Feb 2016 17:08:42 +0100 Subject: erts: Add tracing examples in match spec docs --- erts/doc/src/match_spec.xml | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index b49e1483aa..3944f24f84 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -528,7 +528,7 @@
- Examples + ETS Examples

Match an argument list of three where the first and third arguments are equal:

The function can be useful for testing complicated ets matches.

+
+ Tracing Examples +

Only generate trace message if trace control word is set to 1:

+ +

Only generate trace message if there is a seq trace token:

+ +

Remove 'silent' trace flag when first argument is 'verbose' + and add it when it is 'silent':

+ +

Add return_trace message if function is of arity 3:

+ +

Only generate trace message if function is of arity 3 and first argument is 'trace':

+ +
-- cgit v1.2.3 From 3738103d0b1195e570a7525c4370cd490a5368aa Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 29 Feb 2016 15:09:26 +0100 Subject: erts: Add 'spawned' trace event to 'procs' trace flag OTP-13497 This trace event is triggered when a process is created from the process that is created. --- erts/doc/src/erlang.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index abc0d56983..d6fe585c8d 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8464,6 +8464,7 @@ timestamp() ->

Traces process-related events.

Message tags: spawn, + spawned, exit, register, unregister, @@ -8704,6 +8705,16 @@ timestamp() ->

Args is supposed to be the argument list, but can be any term if the spawn is erroneous.

+ + + {trace, Pid, spawned, Pid2, {M, F, Args}} + + +

When Pid is spawned by process Pid2 with + the specified function call as entry point.

+

Args is supposed to be the argument list, + but can be any term if the spawn is erroneous.

+
{trace, Pid, exit, Reason} -- cgit v1.2.3 From 8e2ec999394c77741241ef1a12728b11195961c8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 21 Mar 2016 17:53:26 +0100 Subject: erts: Document erlang:match_spec_test/3 OTP-13501 --- erts/doc/src/erlang.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index d6fe585c8d..fde04504c8 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2612,6 +2612,48 @@ os_prompt% + + + Test that a match specification works + +

+ This function is a utility to test a match_spec used in calls to + ets:select/2 and + erlang:trace_pattern/3. + The function both tests MatchSpec for "syntactic" correctness and + runs the match_spec against the object. If the match_spec contains + errors, the tuple {error, Errors} is returned where Errors is a list + of natural language descriptions of what was wrong with the match_spec. +

+

+ If the Type is table the object to match + against should be a tuple. The function then returns + {ok,Result,[],Warnings} where Result is what would have been the + result in a real ets:select/2 call or false if the match_spec does + not match the object tuple. +

+ +

+ If Type is trace the object to match + against should be a list. The function returns + {ok, Result, Flags, Warnings} where Result is true if a trace + message should be emitted, false if a trace message should not + be emitted or the message term to be appended to the trace message. + Flags is a list containing all the trace flags that will be enabled, + at the moment this is only return_trace. +

+ +

+ This is a useful debugging and test tool, especially when writing complicated + match specifications. +

+

+ See also + ets:test_ms/2. +

+
+
+ Returns the largest of two terms. -- cgit v1.2.3 From c3e7acb4fe304d117f7361292d36f5d73df3e1c7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 5 Apr 2016 11:26:52 +0200 Subject: erts: Make trace_delivered go via sys msg dispatcher again This is needed as otherwise messages from system_profile will not be guaranteed to arrive before trace delivered. --- erts/doc/src/erlang.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index fde04504c8..423ccdf98f 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8958,7 +8958,11 @@ timestamp() -> Notification when trace has been delivered. -

The delivery of trace messages is dislocated on the time-line +

The delivery of trace messages (generated by + erlang:trace/3, + seq_trace or + erlang:system_profile/2) + is dislocated on the time-line compared to other events in the system. If you know that Tracee has passed some specific point in its execution, @@ -8984,8 +8988,11 @@ timestamp() -> or previously existing on the same node as the caller of erlang:trace_delivered(Tracee) resides on. The special Tracee atom all - denotes all processes - that currently are traced in the node.

+ denotes all processes that currently are traced in the node.

+

When used together with an + Tracer Module any message sent in the trace callback + is guaranteed to have reached it's recipient before the + trace_delivered message is sent.

Example: Process A is Tracee, port B is tracer, and process C is the port owner of B. C wants to close B when -- cgit v1.2.3 From 85a6623152988c267cea008d20616b61ea9c223c Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 12 Apr 2016 20:41:58 +0200 Subject: erts: Add 'exec_alloc' for hipe code that uses its own super carrier (erts_exec_mmapper) to guarantee low addressed and executable memory (PROT_EXEC). Currently only used on x86_64 that needs low memory for HiPE/AMD64's small code model. By initializing erts_exec_mapper early we secure its low memory area before erts_literal_mmapper might steal it. --- erts/doc/src/erts_alloc.xml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 0965f9b49c..c54082f8c8 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -63,6 +63,9 @@ fix_alloc A fast allocator used for some frequently used fixed size data types. + exec_alloc + Allocator used by hipe for native executable code + on specific architectures (x86_64). std_alloc Allocator used for most memory blocks not allocated via any of the other allocators described above. @@ -80,7 +83,8 @@ the number of system calls made.

sys_alloc and literal_alloc are always enabled and - cannot be disabled. mseg_alloc is always enabled if it is + cannot be disabled. exec_alloc is only available if it is needed + and cannot be disabled. mseg_alloc is always enabled if it is available and an allocator that uses it is enabled. All other allocators can be enabled or disabled. By default all allocators are enabled. @@ -248,16 +252,17 @@ the currently present allocators:

B: binary_alloc - I: literal_alloc D: std_alloc E: ets_alloc F: fix_alloc H: eheap_alloc + I: literal_alloc L: ll_alloc M: mseg_alloc R: driver_alloc S: sl_alloc T: temp_alloc + X: exec_alloc Y: sys_alloc

The following flags are available for configuration of @@ -576,6 +581,15 @@ and is usually sufficient. The flag is ignored on 32-bit architectures. +

The following flag is special for exec_alloc:

+ + ]]> + + exec_alloc super carrier size (in MB). The amount of + virtual address space reserved for native executable code + used by hipe on specific architectures (x86_64). The default is 512 MB. + +

Instrumentation flags:

+Mim true|false -- cgit v1.2.3 From 4319cd608063e3612c74b534180b19ab29173667 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 15 Apr 2016 14:16:14 +0200 Subject: erts: Produce statistics for literal and hipe super carriers called 'literal_mmap' and 'exec_mmap'. Also moved existing erts_mmap info from 'mseg_alloc' to its own system_info({allocator, erts_mmap}) with "allocators" default_mmap, literal_mmap and exec_mmap. --- erts/doc/src/erlang.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 423ccdf98f..ee34f28b90 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6839,11 +6839,7 @@ ok As from ERTS 5.6.1, the return value is a list of {instance, InstanceNo, InstanceInfo} tuples, where InstanceInfo contains information about - a specific instance of the allocator. As from - ERTS 5.10.4, the returned list when calling - erlang:system_info({allocator, mseg_alloc}) also - includes an {erts_mmap, _} tuple as one element - in the list. If Alloc is not a + a specific instance of the allocator. If Alloc is not a recognized allocator, undefined is returned. If Alloc is disabled, false is returned.

@@ -6855,7 +6851,13 @@ ok briefly documented.

The recognized allocators are listed in erts_alloc(3). - After reading the erts_alloc(3) documentation, + Information about super carriers can be obtained from + ERTS 8.0 with {allocator, erts_mmap} or from + ERTS 5.10.4, the returned list when calling with + {allocator, mseg_alloc} also includes an + {erts_mmap, _} tuple as one element in the list.

+ +

After reading the erts_alloc(3) documentation, the returned information more or less speaks for itself, but it can be worth explaining some things. Call counts are presented by two -- cgit v1.2.3 From 6aae129123c4ce8988cc67b3545db9d1ec51324b Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 22 Apr 2016 18:45:30 +0200 Subject: erts: Rename erl flag +xmqd to +hmqd Flags that control the heap should all fall under the +h flag --- erts/doc/src/erl.xml | 24 +++++++++--------------- erts/doc/src/erlang.xml | 10 ++++++---- 2 files changed, 15 insertions(+), 19 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index e13470c83c..c499fc8081 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -632,6 +632,15 @@

Sets the initial process dictionary size of processes to the size .

+ +hmqd off_heap|on_heap|mixed +

+ Sets the default value for the process flag + message_queue_data. If +hmqd is not + passed, mixed will be the default. For more information, + see the documentation of + process_flag(message_queue_data, + MQD). +

Enables or disables the kernel poll functionality if @@ -1361,21 +1370,6 @@ error_logger(3) for further information.

- - -

Default process flag settings.

- - +xmqd off_heap|on_heap|mixed -

- Sets the default value for the process flag - message_queue_data. If +xmqd is not - passed, mixed will be the default. For more information, - see the documentation of - process_flag(message_queue_data, - MQD). -

-
-

Miscellaneous flags.

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 423ccdf98f..b2baf5133c 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4371,7 +4371,7 @@ os_prompt%

The default message_queue_data process flag is determined - by the +xmqd + by the +hmqd erl command line argument.

@@ -4878,7 +4878,9 @@ os_prompt% {total_heap_size, Size}

Size is the total size, in words, of all heap - fragments of the process. This includes the process stack.

+ fragments of the process. This includes the process stack and + any unreceived messages that are considered to be part of the + heap.

{trace, InternalTraceFlags} @@ -5709,7 +5711,7 @@ true flag. MQD should be either off_heap, on_heap, or mixed. The default message_queue_data process flag is determined by the - +xmqd erl + +hmqd erl command line argument. For more information, see the documentation of process_flag(message_queue_data, @@ -7388,7 +7390,7 @@ ok

Returns the default value of the message_queue_data process flag which is either off_heap, on_heap, or mixed. This default is set by the erl command line argument - +xmqd. For more information on the + +hmqd. For more information on the message_queue_data process flag, see documentation of process_flag(message_queue_data, MQD).

-- cgit v1.2.3 From 115476cea0db80bb8d53b1a2f08c3b64d62df4ff Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 19 Apr 2016 11:23:39 +0200 Subject: erts: Fix broken doc link to erl_tracer --- erts/doc/src/erlang.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 423ccdf98f..1daa582584 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -8637,8 +8637,8 @@ timestamp() ->

Specifies that a tracer module should be called instead of sending a trace message. The tracer module can then ignore or change the trace message. For more details - on how to write a tracer module see - erl_tracer + on how to write a tracer module see + erl_tracer

@@ -8989,7 +8989,7 @@ timestamp() -> erlang:trace_delivered(Tracee) resides on. The special Tracee atom all denotes all processes that currently are traced in the node.

-

When used together with an +

When used together with an Tracer Module any message sent in the trace callback is guaranteed to have reached it's recipient before the trace_delivered message is sent.

-- cgit v1.2.3 From 4196b0db4cadbddb41f460320fca76efcf9268e1 Mon Sep 17 00:00:00 2001 From: Constantin Rack Date: Sat, 10 Oct 2015 00:06:28 +0200 Subject: Fix typo in description of EPMD_DUMP_REQ response According to the source code, there is a space before the newline for unused nodes and no space before the newline for active ones. In current documentation, it is exactly opposite. This commit fixes the documentation to match with source code. --- erts/doc/src/erl_dist_protocol.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml index e1a58856f3..c35098cf27 100644 --- a/erts/doc/src/erl_dist_protocol.xml +++ b/erts/doc/src/erl_dist_protocol.xml @@ -364,14 +364,14 @@ If Result > 0, the packet only consists of [119, Result]. NodeInfo is, as expressed in Erlang:

- io:format("active name ~ts at port ~p, fd = ~p ~n", + io:format("active name ~ts at port ~p, fd = ~p~n", [NodeName, Port, Fd]).

or

- io:format("old/unused name ~ts at port ~p, fd = ~p~n", + io:format("old/unused name ~ts at port ~p, fd = ~p ~n", [NodeName, Port, Fd]). -- cgit v1.2.3 From 1cb11595f5d4860b38c8bf6d56073ba0032a51a9 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 13 Apr 2016 14:43:43 +0200 Subject: erts: Add exact association types to the abstract format doc --- erts/doc/src/absform.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 13756ddfdc..6d6ba224a0 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -636,6 +636,9 @@ If A is an association type K => V, where K and V are types, then Rep(A) = {type,LINE,map_field_assoc,[Rep(K),Rep(V)]}. + If A is an association type K := V, where + K and V are types, then Rep(A) = + {type,LINE,map_field_exact,[Rep(K),Rep(V)]}.
-- cgit v1.2.3 From b916d55464f26be9e309753d37608b2c99af5944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 20 Apr 2016 19:09:15 +0200 Subject: erts: Fix erl_tracer documentation typos --- erts/doc/src/erl_tracer.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml index 1e8e78b25f..ee828919de 100644 --- a/erts/doc/src/erl_tracer.xml +++ b/erts/doc/src/erl_tracer.xml @@ -114,11 +114,11 @@ TraceTag = trace_tag() | trace_status TracerState = term() - Tracee = tracee() + Tracee = tracee() Result = trace | discard | remove -

This callback will be called whenever a trace point is triggered. It +

This callback will be called whenever a tracepoint is triggered. It allows the tracer to decide whether a trace should be generated or not. This check is made as early as possible in order to limit the amount of overhead associated with tracing. If trace is returned the @@ -132,7 +132,7 @@ to check if the tracer should still be active. It is called in multiple scenarios, but most significantly it is used when tracing is started using this tracer.

-

This function may be called multiple times per trace point, so it +

This function may be called multiple times per tracepoint, so it is important that it is both fast and side effect free.

@@ -143,17 +143,17 @@ TraceTag = trace_tag() TracerState = term() - Tracee = tracee() + Tracee = tracee() FirstTraceTerm = term() SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok -

This callback will be called when a trace point is triggered and +

This callback will be called when a tracepoint is triggered and the Module:enabled/3 callback returned trace. In it any side effects needed by - the tracer should be done. The trace point payload is located in + the tracer should be done. The tracepoint payload is located in the FirstTraceTerm and SecondTraceTerm. The content of the TraceTerms depends on which TraceTag has been triggered. The FirstTraceTerm and SecondTraceTerm correspond to the @@ -282,7 +282,7 @@ static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) ErlNifPid to_pid; if (enif_get_local_pid(env, argv[1], &to_pid)) if (!enif_is_process_alive(env, &to_pid)) - /* tracer is dead so we should remove this trace point */ + /* tracer is dead so we should remove this tracepoint */ return enif_make_atom(env, "remove"); /* Only generate trace for when tracer != tracee */ -- cgit v1.2.3 From 4e90ab912839db19f046d5eb362fa8ce92bcf67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 20 Apr 2016 19:06:58 +0200 Subject: erts: Update erl_tracer documentation --- erts/doc/src/erl_tracer.xml | 344 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml index ee828919de..2075b962d8 100644 --- a/erts/doc/src/erl_tracer.xml +++ b/erts/doc/src/erl_tracer.xml @@ -54,6 +54,14 @@ + + + + + + + + @@ -105,6 +113,29 @@ CALLBACK FUNCTIONS

The following functions should be exported from a erl_tracer callback module.

+ + Module:enabled/3 + Mandatory + Module:trace/6 + Mandatory + Module:enabled_procs/3 + Optional + Module:trace_procs/6 + Optional + Module:enabled_ports/3 + Optional + Module:trace_ports/6 + Optional + Module:enabled_running_ports/3 + Optional + Module:trace_running_ports/6 + Optional + Module:enabled_running_procs/3 + Optional + Module:trace_running_procs/6 + Optional + +
@@ -181,6 +212,319 @@ see the seq_trace manual.

+ + + + Module:enabled_procs(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_procs() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + procs + is triggered.

+

If enabled_procs/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_procs/3 + callback returned trace.

+

If trace_procs/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_ports(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_ports() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + ports + is triggered.

+

If enabled_ports/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_ports/3 + callback returned trace.

+

If trace_ports/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_running_procs(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_running_procs() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + running_procs | running + is triggered.

+

If enabled_running_procs/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_running_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_running_procs() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_running_procs/3 + callback returned trace.

+

If trace_running_procs/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_running_ports(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_running_ports() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + running_ports + is triggered.

+

If enabled_running_ports/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_running_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_running_ports() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_running_ports/3 + callback returned trace.

+

If trace_running_ports/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_call(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_call() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + call | return_to + is triggered.

+

If enabled_call/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_call(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_call() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_call/3 + callback returned trace.

+

If trace_call/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_send(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_send() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + send + is triggered.

+

If enabled_send/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_send(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_send() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_send/3 + callback returned trace.

+

If trace_send/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_receive(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_receive() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + 'receive' + is triggered.

+

If enabled_receive/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_receive(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_receive() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_receive/3 + callback returned trace.

+

If trace_receive/6 is not defined trace/6 will be called instead.

+
+
+ + + + Module:enabled_garbage_collection(TraceTag, TracerState, Tracee) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_gc() + TracerState = term() + Tracee = tracee() + Result = trace | discard | remove + + +

This callback will be called whenever a tracepoint with trace flag + garbage_collection + is triggered.

+

If enabled_garbage_collection/3 is not defined enabled/3 will be called instead.

+
+
+ + + + Module:trace_garbage_collection(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Check if a trace event should be generated. + + TraceTag = trace_tag_gc() + TracerState = term() + Tracee = tracee() + FirstTraceTerm = term() + SecondTraceTerm = term() | undefined + Opts = trace_opts() + Result = ok + + +

This callback will be called when a tracepoint is triggered and + the Module:enabled_garbage_collection/3 + callback returned trace.

+

If trace_garbage_collection/6 is not defined trace/6 will be called instead.

+
+
+
-- cgit v1.2.3 From e75fdd38b04896fa6a1ac7b2fdea18ef485c70b3 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 22 Jan 2016 20:10:11 +0100 Subject: erts: Clarify docs for trace_pattern/3 --- erts/doc/src/erlang.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 423ccdf98f..c7b5ea8867 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -9199,7 +9199,8 @@ timestamp() -> true -

Enables tracing for the matching functions.

+

Enables tracing for the matching functions. + Any match specification is removed.

MatchSpecList -- cgit v1.2.3 From 7b801aa3641f0a59448604c857cfb0e67eed9e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 2 May 2016 18:29:26 +0200 Subject: erts: Update garbage collection trace documentation --- erts/doc/src/erlang.xml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 423ccdf98f..3ccb76f7b3 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4702,7 +4702,7 @@ os_prompt% detailed information about garbage collection for this process. The content of GCInfo can be changed without prior notice. - See gc_start in + See gc_minor_start in erlang:trace/3 for details about what each item means.

@@ -7966,7 +7966,7 @@ ok stack_size, mbuf_size, old_heap_size, and old_heap_block_size. These tuples are explained in the description of trace message - gc_start (see + gc_minor_start (see erlang:trace/3). New tuples can be added, and the order of the tuples in the Info list can be changed at any time without @@ -8556,7 +8556,7 @@ timestamp() -> garbage_collection

Traces garbage collections of processes.

-

Message tags: gc_start and gc_end.

+

Message tags: gc_minor_start and gc_minor_end.

timestamp @@ -8880,12 +8880,12 @@ timestamp() ->

- - {trace, Pid, gc_start, Info} + + {trace, Pid, gc_minor_start, Info} - -

Sent when garbage collection is about to be started. + +

Sent when a young garbage collection is about to be started. Info is a list of two-element tuples, where the first element is a key, and the second is the value. Do not depend on any order of the tuples. @@ -8925,15 +8925,32 @@ timestamp() ->

All sizes are in words.

- - {trace, Pid, gc_end, Info} + + {trace, Pid, gc_minor_end, Info} -

Sent when garbage collection is finished. Info - contains the same kind of list as in message gc_start, +

Sent when young garbage collection is finished. Info + contains the same kind of list as in message gc_minor_start, but the sizes reflect the new sizes after garbage collection.

+ + + {trace, Pid, gc_major_start, Info} + + +

Sent when fullsweep garbage collection is about to be started. Info + contains the same kind of list as in message gc_minor_start.

+
+ + + {trace, Pid, gc_major_end, Info} + + +

Sent when fullsweep garbage collection is finished. Info + contains the same kind of list as in message gc_minor_start + but the sizes reflect the new sizes after a fullsweep garbage collection.

+

If the tracing process/port dies or the tracer module returns remove, the flags are silently removed.

-- cgit v1.2.3 From 36e9d73aa08930ddf3e3587addfb9a647a41b3e7 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 6 Apr 2016 15:05:10 +0200 Subject: erts: Add docs for trace_pattern with 'send' and 'receive' --- erts/doc/src/erlang.xml | 140 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 6 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index c7b5ea8867..f88d05cdc3 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -9124,27 +9124,155 @@ timestamp() -> - Sets trace patterns for global call tracing. + Sets trace patterns for call, send or 'receive' tracing.

The same as - erlang:trace_pattern(MFA, MatchSpec, []), + erlang:trace_pattern(Event, MatchSpec, []), retained for backward compatibility.

- + + Sets trace pattern for message sending. + +

Sets trace pattern for message sending. + Must be combined with + erlang:trace/3 + to set the send trace flag for one or more processes. + By default all messages, sent from send traced processes, + are traced. Use erlang:trace_pattern/3 to limit + traced send events based on the message content, the sender + and/or the receiver.

+

Argument MatchSpec can take the + following forms:

+ + MatchSpecList + +

A list of match specifications. The matching is done + on the list [Receiver, Msg]. Receiver + is the process or port identity of the receiver and + Msg is the message term. The pid of the sending + process can be accessed with the guard function + self/0. An empty list is the same as true. + See the users guide section + Match Specifications in Erlang + for more information.

+
+ true + +

Enables tracing for all sent messages (from send + traced processes). Any match specification is + removed. This is the default.

+
+ false + +

Disables tracing for all sent messages. + Any match specification is removed.

+
+
+

Argument FlagList must be [] + for send tracing.

+

The return value is always 1.

+

Example; only trace messages to a specific process Pid:

+
+> erlang:trace_pattern(send, [{[Pid, '_'],[],[]}], []).
+1
+

Only trace messages matching {reply, _}:

+
+> erlang:trace_pattern(send, [{['_', {reply,'_'}],[],[]}], []).
+1
+

Only trace messages sent to the sender itself:

+
+> erlang:trace_pattern(send, [{['$1', '_'],[{'=:=','$1',{self}}],[]}], []).
+1
+

Only trace messages sent to other nodes:

+
+> erlang:trace_pattern(send, [{['$1', '_'],[{'=/=',{node,'$1'},{node}}],[]}], []).
+1
+

A match specification for send trace can use + all guard and body functions except caller.

+
+
+ + + + Sets trace pattern for tracing of message receiving. + +

+

Sets trace pattern for message receiving. + Must be combined with + erlang:trace/3 + to set the 'receive' trace flag for one or more processes. + By default all messages, received by 'receive' traced processes, + are traced. Use erlang:trace_pattern/3 to limit + traced receive events based on the message content, the sender + and/or the receiver.

+

Argument MatchSpec can take the + following forms:

+ + MatchSpecList + +

A list of match specifications. The matching is done + on the list [Node, Sender, Msg]. Node + is the node name of the sender. Sender is the + process or port identity of the sender, or the atom + undefined if the sender is not known (which may + be the case for remote senders). Msg is the + message term. The pid of the receiving process can be + accessed with the guard function self/0. An empty + list is the same as true. See the users guide section + Match Specifications in Erlang + for more information.

+
+ true + +

Enables tracing for all received messages (to 'receive' + traced processes). Any match specification is + removed. This is the default.

+
+ false + +

Disables tracing for all sent messages. + Any match specification is removed.

+
+
+

Argument FlagList must be [] + for receive tracing.

+

The return value is always 1.

+

Example; only trace messages from a specific process Pid:

+
+> erlang:trace_pattern('receive', [{['_',Pid, '_'],[],[]}], []).
+1
+

Only trace messages matching {reply, _}:

+
+> erlang:trace_pattern('receive', [{['_','_', {reply,'_'}],[],[]}], []).
+1
+

Only trace messages from other nodes:

+
+> erlang:trace_pattern('receive', [{['$1', '_', '_'],[{'=/=','$1',{node}}],[]}], []).
+1
+

A match specification for 'receive' trace can + use all guard and body functions except caller, + is_seq_trace, get_seq_token, set_seq_token, enable_trace, + disable_trace, trace, silent and process_dump.

+
+
+ + + Sets trace patterns for tracing of function calls. -

Enables or disables call tracing for - one or more functions. Must be combined with +

Enables or disables call tracing for one or more functions. + Must be combined with erlang:trace/3 - to set the call trace flag for one or more processes.

+ to set the call trace flag + for one or more processes.

Conceptually, call tracing works as follows. Inside the Erlang Virtual Machine, a set of processes and a set of functions are to be traced. If a traced process -- cgit v1.2.3 From d0ffd5c2a84d15d94dcbc8bac98d527bfc1d4a3c Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 2 May 2016 12:29:25 +0200 Subject: erts: Fix missing type in doc for trace_pattern --- erts/doc/src/erlang.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index f88d05cdc3..f42923a009 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -9137,6 +9137,7 @@ timestamp() -> Sets trace pattern for message sending. +

Sets trace pattern for message sending. Must be combined with @@ -9200,6 +9201,7 @@ timestamp() -> Sets trace pattern for tracing of message receiving. +

Sets trace pattern for message receiving. -- cgit v1.2.3 From 54172674e71caf7da7a0b069c9bd92543e4f705d Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 4 May 2016 14:45:05 +0200 Subject: erts: Add send and 'receive' to trace_info/2 to obtain match specs --- erts/doc/src/erlang.xml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index f42923a009..5af4f0bd66 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -9015,16 +9015,16 @@ timestamp() -> -

Returns trace information about a port, process or function.

-

To get information about a port or process, - PidPortOrFunc is to +

Returns trace information about a port, process, function or event.

+

To get information about a port or process, + PidPortFuncEvent is to be a process identifier (pid), port identifier or one of the atoms new, new_processes, new_ports. The atom new or new_processes means that the default trace state for processes to be created is returned. The atom new_ports means that the default trace state for ports to be created is returned.

-

The following Items are valid:

+

The following Items are valid for ports and processes:

flags @@ -9048,12 +9048,15 @@ timestamp() -> value is [].

-

To get information about a function, PidPortOrFunc is to +

To get information about a function, PidPortFuncEvent is to be the three-element tuple {Module, Function, Arity} or the atom on_load. No wild cards are allowed. Returns undefined if the function does not exist, or - false if the function is not traced.

-

The following Items are valid::

+ false if the function is not traced. If PidPortFuncEvent + is on_load, the information returned refers to + the default value for code that will be loaded.

+ +

The following Items are valid for functions:

traced @@ -9112,13 +9115,21 @@ timestamp() -> is active for this function.

+

To get information about an event, PidPortFuncEvent is to + be one of the atoms send or 'receive'.

+

The only valid Item for events is:

+ + match_spec + +

Returns the match specification for this event, if it + has one, or true if no match specification has been + set.

+
+

The return value is {Item, Value}, where Value is the requested information as described earlier. If a pid for a dead process was given, or the name of a non-existing function, Value is undefined.

-

If PidPortOrFunc is on_load, the information - returned refers to the default value for code that will be - loaded.

@@ -9237,7 +9248,7 @@ timestamp() ->
false -

Disables tracing for all sent messages. +

Disables tracing for all received messages. Any match specification is removed.

-- cgit v1.2.3 From ab950a81bc3361322ce955703f468f314c05e546 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 31 Mar 2016 15:55:46 +0200 Subject: erts: Remove some attributes from the abstract format doc Some wild attributes are no longer mentioned separately. --- erts/doc/src/absform.xml | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 6d6ba224a0..bfabb7f042 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -68,22 +68,12 @@ If D is a module declaration consisting of the forms F_1, ..., F_k, then Rep(D) = [Rep(F_1), ..., Rep(F_k)]. - If F is an attribute -behavior(Behavior), then - Rep(F) = {attribute,LINE,behavior,Behavior}. - If F is an attribute -behaviour(Behaviour), then - Rep(F) = {attribute,LINE,behaviour,Behaviour}. - If F is an attribute -compile(Options), then - Rep(F) = {attribute,LINE,compile,Options}. If F is an attribute -export([Fun_1/A_1, ..., Fun_k/A_k]), then Rep(F) = {attribute,LINE,export,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}. - If F is an attribute -export_type([Type_1/A_1, ..., Type_k/A_k]), then - Rep(F) = {attribute,LINE,export_type,[{Type_1,A_1}, ..., {Type_k,A_k}]}. If F is an attribute -import(Mod,[Fun_1/A_1, ..., Fun_k/A_k]), then Rep(F) = {attribute,LINE,import,{Mod,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}}. If F is an attribute -module(Mod), then Rep(F) = {attribute,LINE,module,Mod}. - If F is an attribute -optional_callbacks([Fun_1/A_1, ..., Fun_k/A_k]), then - Rep(F) = {attribute,LINE,optional_callbacks,[{Fun_1,A_1}, ..., {Fun_k,A_k}]}. If F is an attribute -file(File,Line), then Rep(F) = {attribute,LINE,file,{File,Line}}. If F is a function declaration -- cgit v1.2.3 From e146a3eec5a2d384260aa8829777c89eaab09cbd Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 21 Apr 2016 18:36:45 +0200 Subject: erts: Implement max_heap_size process flag The max_heap_size process flag can be used to limit the growth of a process heap by killing it before it becomes too large to handle. It is possible to set the maximum using the `erl +hmax` option, `system_flag(max_heap_size, ...)`, `spawn_opt(Fun, [{max_heap_size, ...}])` and `process_flag(max_heap_size, ...)`. It is possible to configure the behaviour of the process when the maximum heap size is reached. The process may be sent an untrappable exit signal with reason kill and/or send an error_logger message with details on the process state. A new trace event called gc_max_heap_size is also triggered for the garbage_collection trace flag when the heap grows larger than the configured size. If kill and error_logger are disabled, it is still possible to see that the maximum has been reached by doing garbage collection tracing on the process. The heap size is defined as the sum of the heap memory that the process is currently using. This includes all generational heaps, the stack, any messages that are considered to be part of the heap and any extra memory the garbage collector may need during collection. In the current implementation this means that when a process is set using on_heap message queue data mode, the messages that are in the internal message queue are counted towards this value. For off_heap, only matched messages count towards the size of the heap. For mixed, it depends on race conditions within the VM whether a message is part of the heap or not. Below is an example run of the new behaviour: Eshell V8.0 (abort with ^G) 1> f(P),P = spawn_opt(fun() -> receive ok -> ok end end, [{max_heap_size, 512}]). <0.60.0> 2> erlang:trace(P, true, [garbage_collection, procs]). 1 3> [P ! lists:duplicate(M,M) || M <- lists:seq(1,15)],ok. ok 4> =ERROR REPORT==== 26-Apr-2016::16:25:10 === Process: <0.60.0> Context: maximum heap size reached Max heap size: 512 Total heap size: 723 Kill: true Error Logger: true GC Info: [{old_heap_block_size,0}, {heap_block_size,609}, {mbuf_size,145}, {recent_size,0}, {stack_size,9}, {old_heap_size,0}, {heap_size,211}, {bin_vheap_size,0}, {bin_vheap_block_size,46422}, {bin_old_vheap_size,0}, {bin_old_vheap_block_size,46422}] flush(). Shell got {trace,<0.60.0>,gc_start, [{old_heap_block_size,0}, {heap_block_size,233}, {mbuf_size,145}, {recent_size,0}, {stack_size,9}, {old_heap_size,0}, {heap_size,211}, {bin_vheap_size,0}, {bin_vheap_block_size,46422}, {bin_old_vheap_size,0}, {bin_old_vheap_block_size,46422}]} Shell got {trace,<0.60.0>,gc_max_heap_size, [{old_heap_block_size,0}, {heap_block_size,609}, {mbuf_size,145}, {recent_size,0}, {stack_size,9}, {old_heap_size,0}, {heap_size,211}, {bin_vheap_size,0}, {bin_vheap_block_size,46422}, {bin_old_vheap_size,0}, {bin_old_vheap_block_size,46422}]} Shell got {trace,<0.60.0>,exit,killed} --- erts/doc/src/erl.xml | 28 +++++ erts/doc/src/erlang.xml | 294 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 258 insertions(+), 64 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index c499fc8081..1bbde7f1e0 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -627,6 +627,34 @@

Sets the default binary virtual heap size of processes to the size .

+ + + +

Sets the default maximum heap size of processes to the size + . If +hmax is not given, the default is 0 + which means that no maximum heap size is used. + For more information, see the documentation of + + process_flag(max_heap_size, MaxHeapSize).

+
+ + + +

Sets whether to send an error logger message for processes that reach + the maximum heap size or not. If +hmaxel is not given, the default is true. + For more information, see the documentation of + + process_flag(max_heap_size, MaxHeapSize).

+
+ + + +

Sets whether to kill processes that reach the maximum heap size or not. If + +hmaxk is not given, the default is true. For more information, + see the documentation of + + process_flag(max_heap_size, MaxHeapSize).

+

Sets the initial process dictionary size of processes to the size diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index bf30cc7928..3930e5e11d 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4322,6 +4322,7 @@ os_prompt% + Sets process flag min_heap_size for the calling process. @@ -4340,9 +4341,95 @@ os_prompt%

Returns the old value of the flag.

- + + + Sets process flag max_heap_size for the calling process. + +

+ This flag sets the maximum heap size for the calling process. + If MaxHeapSize is an integer, the system default + values for kill and error_logger are used. + + size + +

+ The maximum size in words of the process. If set to zero, the + heap size limit is disabled. Badarg will be thrown if the value is + smaller than + min_heap_size. + The size check is only done when a garbage collection is triggered. +

+

+ size is the entire heap of the process when garbage collection + is triggered, this includes all generational heaps, the process stack, + any + messages that are considered to be part of the heap and any + extra memory that the garbage collector needs during collection. +

+

+ size is the same as can be retrieved using + + erlang:process_info(Pid, total_heap_size), + or by adding heap_block_size, old_heap_block_size + and mbuf_size from + erlang:process_info(Pid, garbage_collection_info). +

+
+ kill + +

+ When set to true the runtime system will send an + untrappable exit signal with reason kill to the process + if the maximum heap size is reached. The garbage collection + that triggered the kill will not be completed, instead the + process will exit as soon as is possible. When set to false + no exit signal will be sent to the process, instead it will + continue executing. +

+

+ If kill is not defined in the map + the system default will be used. The default system default + is true. It can be changed by either the erl + +hmaxk option, + or + erlang:system_flag(max_heap_size, MaxHeapSize). +

+
+ error_logger + +

+ When set to true the runtime system will send a + message to the current error_logger + containing details about the process when the maximum + heap size is reached. One error_logger report will + be sent each time the limit is reached. +

+

+ If error_logger is not defined in the map the system + default will be used. The default system default is true. + It can be changed by either the erl +hmaxel + option, or + erlang:system_flag(max_heap_size, MaxHeapSize). +

+
+

+ The heap size of a process is quite hard to predict, especially the + amount of memory that is used during the garbage collection. When + contemplating using this option, it is recommended to first run + it in production with kill set to false and inspect + the error_logger reports to see what the normal peak sizes + of the processes in the system is and then tune the value + accordingly. +

+ +

+ + + + + Set process flag message_queue_data for the calling process @@ -4392,7 +4479,7 @@ os_prompt% - + Sets process flag priority for the calling process. @@ -4466,7 +4553,7 @@ os_prompt% - + Sets process flag save_calls for the calling process.

N must be an integer in the interval 0..10000. @@ -4497,7 +4584,7 @@ os_prompt% - + Sets process flag sensitive for the calling process.

Sets or clears flag sensitive for the current process. @@ -4551,6 +4638,7 @@ os_prompt% +

Returns a list containing InfoTuples with @@ -4604,6 +4692,7 @@ os_prompt% +

Returns information about the process identified by @@ -4696,6 +4785,7 @@ os_prompt% The content of GCInfo can be changed without prior notice.

+ {garbage_collection_info, GCInfo}

GCInfo is a list containing miscellaneous @@ -4875,6 +4965,7 @@ os_prompt% total suspend count on Suspendee, only the parts contributed by Pid.

+ {total_heap_size, Size}

Size is the total size, in words, of all heap @@ -5569,6 +5660,7 @@ true Creates a new process with a fun as entry point. + @@ -5586,6 +5678,7 @@ true Creates a new process with a fun as entry point on a given node. + @@ -5602,6 +5695,7 @@ true Creates a new process with a function as entry point. + @@ -5705,6 +5799,16 @@ true fine-tuning an application and to measure the execution time with various VSize values.

+ {max_heap_size, Size} + +

Sets the max_heap_size process flag. The default + max_heap_size is determined by the + +hmax erl + command line argument. For more information, see the + documentation of + process_flag(max_heap_size, + Size).

+
{message_queue_data, MQD}

Sets the state of the message_queue_data process @@ -5725,6 +5829,7 @@ true Creates a new process with a function as entry point on a given node. + @@ -6506,8 +6611,25 @@ ok + + + Sets system flag max_heap_size + +

+ Sets the default maximum heap size settings for processes. + The size is given in words. The new max_heap_size + effects only processes spawned efter the change has been made. + max_heap_size can be set for individual processes using + spawn_opt/N or + process_flag/2.

+

Returns the old value of the flag.

+
+
+ + + Sets system flag multi_scheduling.

@@ -6557,7 +6679,7 @@ ok - + Sets system flag scheduler_bind_type. @@ -6675,7 +6797,7 @@ ok - + Sets system flag scheduler_wall_time.

Turns on or off scheduler wall time measurements.

@@ -6685,7 +6807,7 @@ ok
- + Sets system flag schedulers_online.

@@ -6710,7 +6832,7 @@ ok - + Sets system flag trace_control_word.

Sets the value of the node trace control word to @@ -6724,7 +6846,7 @@ ok - + Finalize the Time Offset

@@ -6990,6 +7112,81 @@ ok + + + + + + + + + + Information about the default process heap settings. + + + fullsweep_after + +

Returns {fullsweep_after, integer() >= 0}, which is + the fullsweep_after garbage collection setting used + by default. For more information, see + garbage_collection described in the following.

+ + garbage_collection + +

Returns a list describing the default garbage collection + settings. A process spawned on the local node by a + spawn or spawn_link uses these + garbage collection settings. The default settings can be + changed by using + system_flag/2. + spawn_opt/4 + can spawn a process that does not use the default + settings.

+
+ max_heap_size + +

Returns {max_heap_size, MaxHeapSize}, + where MaxHeapSize is the current + system-wide max heap size settings for spawned processes. + This setting can be set using the erl command line + flags +hmax, + +hmaxk and + +hmaxel. It can + also be changed at run-time using + + erlang:system_flag(max_heap_size, MaxHeapSize). + For more details about the max_heap_size process flag + see + process_flag(max_heap_size, MaxHeapSize). +

+
+ min_heap_size + +

Returns {min_heap_size, MinHeapSize}, + where MinHeapSize is the current + system-wide minimum heap size for spawned processes.

+
+ message_queue_data + +

Returns the default value of the message_queue_data + process flag which is either off_heap, on_heap, or mixed. + This default is set by the erl command line argument + +hmqd. For more information on the + message_queue_data process flag, see documentation of + process_flag(message_queue_data, + MQD).

+
+ min_bin_vheap_size + +

Returns {min_bin_vheap_size, + MinBinVHeapSize}, where + MinBinVHeapSize is the current system-wide + minimum binary virtual heap size for spawned processes.

+
+ +
+
+ @@ -7010,8 +7207,6 @@ ok - - @@ -7019,10 +7214,6 @@ ok - - - - @@ -7052,6 +7243,7 @@ ok + Information about the system.

Returns various information about the current system @@ -7288,25 +7480,6 @@ ok ERL_MAX_ETS_TABLES before starting the Erlang runtime system.

- fullsweep_after - -

Returns {fullsweep_after, integer() >= 0}, which is - the fullsweep_after garbage collection setting used - by default. For more information, see - garbage_collection described in the following.

-
- garbage_collection - -

Returns a list describing the default garbage collection - settings. A process spawned on the local node by a - spawn or spawn_link uses these - garbage collection settings. The default settings can be - changed by using - system_flag/2. - spawn_opt/4 - can spawn a process that does not use the default - settings.

-
heap_sizes

Returns a list of integers representing valid heap sizes @@ -7381,29 +7554,6 @@ ok

Returns a string containing the Erlang machine name.

- min_heap_size - -

Returns {min_heap_size, MinHeapSize}, - where MinHeapSize is the current - system-wide minimum heap size for spawned processes.

-
- message_queue_data - -

Returns the default value of the message_queue_data - process flag which is either off_heap, on_heap, or mixed. - This default is set by the erl command line argument - +hmqd. For more information on the - message_queue_data process flag, see documentation of - process_flag(message_queue_data, - MQD).

-
- min_bin_vheap_size - -

Returns {min_bin_vheap_size, - MinBinVHeapSize}, where - MinBinVHeapSize is the current system-wide - minimum binary virtual heap size for spawned processes.

-
modified_timing_level

Returns the modified timing-level (an integer) if @@ -8028,12 +8178,13 @@ ok GcPid and Info are the same as for long_gc earlier, except that the tuple tagged with timeout is not present.

-

As of ERTS 5.6, the monitor message is sent - if the sum of the sizes of all memory blocks allocated - for all heap generations is equal to or higher than Size. - Previously the monitor message was sent if the memory block - allocated for the youngest generation was equal to or higher - than Size.

+

The monitor message is sent if the sum of the sizes of + all memory blocks allocated for all heap generations after + a garbage collection is equal to or higher than Size.

+

When a process is killed by + max_heap_size, it is killed before the + garbage collection is complete and thus no large heap message + will be sent.

busy_port @@ -8560,7 +8711,9 @@ timestamp() -> garbage_collection

Traces garbage collections of processes.

-

Message tags: gc_minor_start and gc_minor_end.

+

Message tags: gc_minor_start, + gc_max_heap_size and + gc_minor_end.

timestamp @@ -8928,6 +9081,19 @@ timestamp() ->

All sizes are in words.

+ + + {trace, Pid, gc_max_heap_size, Info} + + +

+ Sent when the max_heap_size + is reached during garbage collection. Info contains the + same kind of list as in message gc_start, + but the sizes reflect the sizes that triggered max_heap_size to + be reached. +

+
{trace, Pid, gc_minor_end, Info} -- cgit v1.2.3 From dc203f539692a1191240209fb95afa020fa342b5 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 3 May 2016 09:55:15 +0200 Subject: erts: Fix pre-bif yield current_function --- erts/doc/src/erlang.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 3930e5e11d..e0723127f2 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4364,7 +4364,7 @@ os_prompt%

size is the entire heap of the process when garbage collection is triggered, this includes all generational heaps, the process stack, - any + any messages that are considered to be part of the heap and any extra memory that the garbage collector needs during collection.

-- cgit v1.2.3 From 725ffcf9a638d8b15295f0a3709f2e786663c987 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 10 May 2016 16:12:59 +0200 Subject: erts: Fix doc typo in erts_alloc --- erts/doc/src/erts_alloc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erts_alloc.xml b/erts/doc/src/erts_alloc.xml index 70775b9f0f..9aef1c0b1f 100644 --- a/erts/doc/src/erts_alloc.xml +++ b/erts/doc/src/erts_alloc.xml @@ -583,7 +583,7 @@

The following flag is special for exec_alloc:

- ]]> + ]]> exec_alloc super carrier size (in MB). The amount of virtual address space reserved for native executable code -- cgit v1.2.3 From 0aa5f873fdfb391a455bc134256b7c464ffa161b Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 15 Apr 2016 11:24:14 +0200 Subject: Remove conditional dirty schedulers API --- erts/doc/src/erl_nif.xml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 7546f7ef81..ef64ac66dc 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -354,10 +354,9 @@ ok passing to it a pointer to the dirty NIF to be executed and indicating with the flags argument whether it expects the operation to be CPU-bound or I/O-bound.

Dirty NIF support is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. To determine whether - the dirty NIF API is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined. Also, if the Erlang runtime was built - without threading support, dirty schedulers are disabled. To check at runtime for the presence + schedulers enabled. This feature is currently disabled by default. The Erlang runtime + without SMP support currently do not support dirty schedulers even when the dirty + scheduler support has been enabled. To check at runtime for the presence of dirty scheduler threads, code can use the enif_system_info() API function.

@@ -998,10 +997,6 @@ typedef enum { from within a dirty NIF returns true. It returns false when the calling NIF is a regular NIF running on a normal scheduler thread, or when the emulator is built without threading support.

-

This function is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. To determine whether - the dirty NIF API is available, native code can check to see if the C preprocessor macro - ERL_NIF_DIRTY_SCHEDULER_SUPPORT is defined.

intenif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term) -- cgit v1.2.3 From 8cbf3bd3b9d552423812df4acc7a40d9a23fdeae Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 2 May 2016 16:02:02 +0200 Subject: Add better support for communication with a process executing dirty NIF - Termination of a process... - Modify trace flags of process... - Process info on process... - Register/unregister of name on process... - Set group leader on process... ... while it is executing a dirty NIF. --- erts/doc/src/erl_nif.xml | 245 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 180 insertions(+), 65 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index ef64ac66dc..fefec3eeb6 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -138,29 +138,6 @@ ok automatically unloaded when the module code that it belongs to is purged by the code server.

-

- As mentioned in the warning text at - the beginning of this document it is of vital importance that a native function - return relatively quickly. It is hard to give an exact maximum amount - of time that a native function is allowed to work, but as a rule of thumb - a well-behaving native function should return to its caller before a - millisecond has passed. This can be achieved using different approaches. - If you have full control over the code to execute in the native - function, the best approach is to divide the work into multiple chunks of - work and call the native function multiple times, either directly from Erlang code - or by having a native function schedule a future NIF call via the - enif_schedule_nif function. Function - enif_consume_timeslice can be - used to help with such work division. In some cases, however, this might not - be possible, e.g. when calling third-party libraries. Then you typically want - to dispatch the work to another thread, return - from the native function, and wait for the result. The thread can send - the result back to the calling thread using message passing. Information - about thread primitives can be found below. If you have built your system - with the currently experimental support for dirty schedulers, - you may want to try out this functionality by dispatching the work to a - dirty NIF, - which does not have the same duration restriction as a normal NIF.

FUNCTIONALITY @@ -328,37 +305,161 @@ ok

- Long-running NIFs -

Native functions - - must normally run quickly, as explained earlier in this document. They - generally should execute for no more than a millisecond. But not all native functions - can execute so quickly; for example, functions that encrypt large blocks of data or - perform lengthy file system operations can often run for tens of seconds or more.

-

If the functionality of a long-running NIF can be split so that its work can be - achieved through a series of shorter NIF calls, the application can either make that series - of NIF calls from the Erlang level, or it can call a NIF that first performs a chunk of the - work, then invokes the enif_schedule_nif - function to schedule another NIF call to perform the next chunk. The final call scheduled - in this manner can then return the overall result. Breaking up a long-running function in - this manner enables the VM to regain control between calls to the NIFs, thereby avoiding - degraded responsiveness, scheduler load balancing problems, and other strange behaviours.

-

A NIF that cannot be split and cannot execute in a millisecond or less is called a "dirty NIF" - because it performs work that the Erlang runtime cannot handle cleanly. - Note that the dirty NIF functionality described here is experimental and that you have to - enable support for dirty schedulers when building OTP in order to try the functionality out. - Applications that make use of such functions must indicate to the runtime that the functions are - dirty so they can be handled specially. To schedule a dirty NIF for execution, the - appropriate flags value can be set for the NIF in its ErlNifFunc - entry, or the application can call enif_schedule_nif, - passing to it a pointer to the dirty NIF to be executed and indicating with the flags - argument whether it expects the operation to be CPU-bound or I/O-bound.

-

Dirty NIF support is available only when the emulator is configured with dirty - schedulers enabled. This feature is currently disabled by default. The Erlang runtime - without SMP support currently do not support dirty schedulers even when the dirty - scheduler support has been enabled. To check at runtime for the presence - of dirty scheduler threads, code can use the - enif_system_info() API function.

+ Long-running NIFs + +

+ As mentioned in the warning text at + the beginning of this document it is of vital importance that a + native function return relatively quickly. It is hard to give an exact + maximum amount of time that a native function is allowed to work, but as a + rule of thumb a well-behaving native function should return to its caller + before a millisecond has passed. This can be achieved using different + approaches. If you have full control over the code to execute in the + native function, the best approach is to divide the work into multiple + chunks of work and call the native function multiple times. In some + cases this might however not always be possible, e.g. when calling + third-party libraries.

+ +

The + enif_consume_timeslice() + function can be used to inform the runtime system about the lenght of the + NIF call. It should typically always be used unless the NIF executes very + quickly.

+ +

If the NIF call is too lenghty one needs to handle this in one of the + following ways in order to avoid degraded responsiveness, scheduler load + balancing problems, and other strange behaviours:

+ + + Yielding NIF + +

+ If the functionality of a long-running NIF can be split so that + its work can be achieved through a series of shorter NIF calls, + the application can either make that series of NIF calls from the + Erlang level, or it can call a NIF that first performs a chunk of + the work, then invokes the + enif_schedule_nif + function to schedule another NIF call to perform the next chunk. + The final call scheduled in this manner can then return the + overall result. Breaking up a long-running function in + this manner enables the VM to regain control between calls to the + NIFs. +

+

+ This approach is always preferred over the other alternatives + described below. This both from a performance perspective and + a system characteristics perspective. +

+
+ + Threaded NIF + +

+ This is accomplished by dispatching the work to another thread + managed by the NIF library, return from the NIF, and wait for the + result. The thread can send the result back to the Erlang + process using enif_send. + Information about thread primitives can be found below. +

+
+ + Dirty NIF + + + +

+ The dirty NIF functionality described here + is experimental. Dirty NIF support is available only when + the emulator is configured with dirty schedulers enabled. This + feature is currently disabled by default. The Erlang runtime + without SMP support do not support dirty schedulers even when + the dirty scheduler support has been enabled. To check at + runtime for the presence of dirty scheduler threads, code can + use the + enif_system_info() + API function. +

+
+ +

+ A NIF that cannot be split and cannot execute in a millisecond or + less is called a "dirty NIF" because it performs work that the + Erlang runtime cannot handle cleanly. Applications that make use + of such functions must indicate to the runtime that the functions + are dirty so they can be handled specially. To schedule a dirty + NIF for execution, the appropriate flags value can be set for the + NIF in its ErlNifFunc + entry, or the application can call + enif_schedule_nif, + passing to it a pointer to the dirty NIF to be executed and + indicating with the flags argument whether it expects the + operation to be CPU-bound or I/O-bound. A dirty NIF executing + on a dirty scheduler does not have the same duration restriction + as a normal NIF. +

+ +

+ While a process is executing a dirty NIF some operations that + communicate with it may take a very long time to complete. + Suspend, or garbage collection of a process executing a dirty + NIF cannot be done until the dirty NIF has returned, so other + processes waiting for such operations to complete might have to + wait for a very long time. Blocking multi scheduling, i.e., + calling + erlang:system_flag(multi_scheduling, + block), might also take a very long time to + complete. This since all ongoing dirty operations on all + dirty schedulers need to complete before the the block + operation can complete. +

+ +

+ A lot of operations communicating with a process executing a + dirty NIF can, however, complete while it is executing the + dirty NIF. For example, retreiving information about it via + process_info(), setting its group leader, + register/unregister its name, etc. +

+ +

+ Termination of a process executing a dirty NIF can only be + completed up to a certain point while it is executing the + dirty NIF. All Erlang resources such as registered names, + ETS tables, etc will be released. All links and monitors + will be triggered. The actual execution of the NIF will + however not be stopped. The NIF can safely contiue + execution, allocate heap memory, etc, but it is of course better + to stop executing as soon as possible. The NIF can check + whether current process is alive or not using + enif_is_current_process_alive. + Communication using + enif_send, + and enif_port_command + will also be dropped when the sending process is not alive. + Deallocation of certain internal resources such as process + heap, and process control block will be delayed until the + dirty NIF has completed. +

+ +

Currently known issues that are planned to be fixed:

+ + +

+ Since purging of a module currently might need to garbage + collect a process in order to determine if it has + references to the module, a process executing a dirty + NIF might delay purging for a very long time. Delaying + a purge operatin implies delaying all code + loding operations which might cause severe problems for + the system as a whole. +

+
+
+ +
+
+
@@ -507,6 +608,10 @@ typedef struct { CPU-bound, its flags field should be set to ERL_NIF_DIRTY_JOB_CPU_BOUND, or for I/O-bound jobs, ERL_NIF_DIRTY_JOB_IO_BOUND.

+

If one of the + ERL_NIF_DIRTY_JOB_*_BOUND flags is set, and the runtime + system has no support for dirty schedulers, the runtime system + will refuse to load the NIF library.

ErlNifBinary @@ -962,6 +1067,13 @@ typedef enum { Determine if a term is a binary

Return true if term is a binary

+ intenif_is_current_process_alive(ErlNifEnv* env) + Determine if currently executing process is alive or not. +

Return true if currently executing process is currently alive; otherwise + false.

+

This function can only be used from a NIF-calling thread, and with an + environment corresponding to currently executing processes.

+
intenif_is_empty_list(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is an empty list

Return true if term is an empty list.

@@ -992,11 +1104,10 @@ typedef enum { intenif_is_on_dirty_scheduler(ErlNifEnv* env) Check to see if executing on a dirty scheduler thread -

Check to see if the current NIF is executing on a dirty scheduler thread. If the - emulator is built with threading support, calling enif_is_on_dirty_scheduler - from within a dirty NIF returns true. It returns false when the calling NIF is a regular - NIF running on a normal scheduler thread, or when the emulator is built without threading - support.

+

Check to see if the current NIF is executing on a dirty scheduler thread. If + executing on a dirty scheduler thread true returned; otherwise false.

+

This function can only be used from a NIF-calling thread, and with an + environment corresponding to currently executing processes.

intenif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term) @@ -1010,7 +1121,8 @@ typedef enum { intenif_is_port_alive(ErlNifEnv* env, ErlNifPort *port_id) Determine if a local port is alive or not.

Return true if port_id is currently alive.

-

This function can only be used in a from a NIF-calling thread.

+

This function is only thread-safe when the emulator with SMP support is used. + It can only be used in a non-SMP emulator from a NIF-calling thread.

intenif_is_process_alive(ErlNifEnv* env, ErlNifPid *pid) Determine if a local process is alive or not. @@ -1478,9 +1590,7 @@ enif_map_iterator_destroy(env, &iter); Send a port_command to to_port

This function works the same as erlang:port_command/2 - except that it is always completely asynchronous. This call may return false - if it detects that the port is already dead, otherwise it will return true. -

+ except that it is always completely asynchronous.

env The environment of the calling process. May not be NULL. @@ -1499,7 +1609,10 @@ enif_map_iterator_destroy(env, &iter); calls to enif_alloc_env, enif_make_copy, enif_port_command and enif_free_env into one call. This optimization is only usefull when a majority of the terms are to be copied from env to the msg_env.

-

The call may return false if it detects that the command failed for some reason. Otherwise true is returned.

+

This function return true if the command was successfully sent; otherwise, + false. The call may return false if it detects that the command failed for some + reason. For example, *to_port does not refer to a local port, if currently + executing process, i.e. the sender, is not alive, or if msg is invalid.

See also: enif_get_local_port.

@@ -1630,7 +1743,9 @@ enif_map_iterator_destroy(env, &iter); msg The message term to send. -

Return true on success, or false if *to_pid does not refer to an alive local process.

+

Return true if the message was successfully sent; otherwise, false. The send + operation will fail if *to_pid does not refer to an alive local process, + or if currently executing process, i.e. the sender, is not alive.

The message environment msg_env with all its terms (including msg) will be invalidated by a successful call to enif_send. The environment should either be freed with enif_free_env -- cgit v1.2.3 From 3471d44a6a5ed5ab038c4cdc76b350119fe745e2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 11 May 2016 11:16:16 +0200 Subject: erts: Only allow remove from trace_status callback Make it so that it is only possible to remove a tracer via returning remove from an erl_tracer. This limition is put in place in order to avoid a lot of lock checking and taking in various places, especially in regards to trace events happening on dirty schedulers. --- erts/doc/src/erl_tracer.xml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml index 2075b962d8..7fd5512b33 100644 --- a/erts/doc/src/erl_tracer.xml +++ b/erts/doc/src/erl_tracer.xml @@ -90,7 +90,7 @@ If not set to true, the tracer has been requested to include the output of a match specification that was run. scheduler_id - Set to a number of the scheduler id is to be included by the tracer. + Set to a number if the scheduler id is to be included by the tracer. Otherwise it is set to undefined.

@@ -155,14 +155,13 @@ overhead associated with tracing. If trace is returned the necessary trace data will be created and the trace call-back of the tracer will be called. If discard is returned, this trace call - will be discarded and no call to trace will be done. If - remove is returned, the VM will attempt to remove this tracer - from the tracee, together with any trace flags set on the tracee. + will be discarded and no call to trace will be done.

trace_status is a special type of TraceTag which is used to check if the tracer should still be active. It is called in multiple scenarios, but most significantly it is used when tracing is started - using this tracer.

+ using this tracer. If remove is returned when the trace_status + is checked, the tracer will be removed from the tracee.

This function may be called multiple times per tracepoint, so it is important that it is both fast and side effect free.

@@ -617,7 +616,7 @@ static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, } /* - * argv[0]: Trace Tag + * argv[0]: TraceTag * argv[1]: TracerState * argv[2]: Tracee */ @@ -626,8 +625,11 @@ static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) ErlNifPid to_pid; if (enif_get_local_pid(env, argv[1], &to_pid)) if (!enif_is_process_alive(env, &to_pid)) - /* tracer is dead so we should remove this tracepoint */ - return enif_make_atom(env, "remove"); + if (enif_is_identical(enif_make_atom(env, "trace_status"), argv[0])) + /* tracer is dead so we should remove this tracepoint */ + return enif_make_atom(env, "remove"); + else + return enif_make_atom(env, "discard"); /* Only generate trace for when tracer != tracee */ if (enif_is_identical(argv[1], argv[2])) @@ -645,7 +647,7 @@ static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) } /* - * argv[0]: Trace Tag, should only be 'send' + * argv[0]: TraceTag, should only be 'send' * argv[1]: TracerState, process to send {argv[2], argv[4]} to * argv[2]: Tracee * argv[3]: Message, ignored -- cgit v1.2.3 From bd64ad8e15d66e48b36dbe3584315dd5cfc8b59a Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Wed, 11 May 2016 17:22:23 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 625 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 625 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 7501ccd9ce..7d39461f10 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,631 @@

This document describes the changes made to the ERTS application.

+
Erts 8.0 + +
Fixed Bugs and Malfunctions + + +

The handling of on_load functions has been + improved. The major improvement is that if a code upgrade + fails because the on_load function fails, the + previous version of the module will now be retained.

+

+ Own Id: OTP-12593

+
+ +

is_builtin(erlang, apply, 3) will now return + true.

+

+ Own Id: OTP-13034

+
+ +

+ Fix enif_get_list_length to return false if list + is improper or have length larger than UINT_MAX + (did return true and an incorrect length value).

+

+ Own Id: OTP-13288 Aux Id: PR913

+
+ +

+ Cleanup hipe signal handling code for x86 and make it + more portable.

+

+ Own Id: OTP-13341 Aux Id: PR951

+
+ +

+ Use fsync instead of fdatasync on Mac OSX.

+

+ Own Id: OTP-13411

+
+ +

+ Make sure to create a crash dump when running out of + memory. This was accidentally removed in the erts-7.3 + release.

+

+ Own Id: OTP-13419

+
+ +

+ A bug has been fixed where if erlang was started +B on a + unix platform it would be killed by a SIGUSR2 signal when + creating a crash dump.

+

+ Own Id: OTP-13425

+
+ +

+ Fix race between process_flag(trap_exit,true) and + a received exit signal.

+

+ A process could terminate due to exit signal even though + process_flag(trap_exit,true) had returned. A very + specific timing between call to process_flag/2 and + exit signal from another scheduler was required for this + to happen.

+

+ Own Id: OTP-13452

+
+ +

Don't search for non-existing Map keys twice

+

For maps:get/2,3 and maps:find/2, + searching for an immediate key, e.g. an atom, in a small + map, the search was performed twice if the key did not + exist.

+

+ Own Id: OTP-13459

+
+ +

+ When a abnormally large distribution message is about to + be sent, the VM has been changed to create a crash dump + instead of a core dump.

+

+ Own Id: OTP-13474

+
+ +

+ Fix erlang:process_info/2 type specification

+

+ Own Id: OTP-13485 Aux Id: ERL-123

+
+ +

+ Fix bug in open_port/2 with option {args, + List}. A vm crash could be caused by an improper + List.

+

+ Own Id: OTP-13489 Aux Id: ERL-127

+
+ +

+ Don't crash on terminating processes with + erlang:system_profile/1,2

+

+ Own Id: OTP-13494 Aux Id: ERL-126

+
+ +

+ Fixed bugs where the reduction counter was not handled + correct.

+

+ Own Id: OTP-13512

+
+ +

+ Fixed typo in description of the EPMD_DUMP_REQ + response.

+

+ Own Id: OTP-13517

+
+ +

+ Fixed a bug where a process flagged as sensitive would + sometimes record its save_calls when it shouldn't.

+

+ Own Id: OTP-13540

+
+ +

+ Update configure scripts to not use hardcoded path for + /bin/pwd and /bin/rm.

+

+ Own Id: OTP-13562

+
+
+
+ + +
Improvements and New Features + + +

+ The tracing support has been extended to allow a tracer module to be the + trace event handler instead of a process or port. The + tracer module + makes it possible for trace tools to filter or manipulate + trace event data without the trace event first haing to + be copied from the traced process or port.

+

+ With the introduction of this feature, + erlang:trace(all|existing, _, _) now also returns + the tracer process as part of the number of processes on + which tracing is enabled. The is incompatible with the + previous releases.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-10267

+
+ +

+ Introduce LTTng tracing of Erlang Runtime System

+

+ For LTTng to be enabled OTP needs to be built with + configure option --with-dynamic-trace=lttng.

+

+ This feature introduces tracepoints for schedulers, + drivers, memory carriers, memory and async thread pool.

+

For a list of all tracepoints, see Runtime Tools User's + Guide .

+

+ Own Id: OTP-10282 Aux Id: kunagi-14 [14]

+
+ +

+ Add microstate accounting

+

+ Microstate accounting is a way to track which state the + different threads within ERTS are in. The main usage area + is to pin point performance bottlenecks by checking which + states the threads are in and then from there figuring + out why and where to optimize.

+

+ Since checking whether microstate accounting is on or off + is relatively expensive only a few of the states are + enabled by default and more states can be enabled through + configure.

+

+ There is a convinence module called msacc that has been + added to runtime_tools that can assist in gathering and + interpreting the data from Microstate accounting.

+

+ For more information see erlang:statistics(microstate_accounting, + _) and the msacc module in + runtime_tools.

+

+ Own Id: OTP-12345

+
+ +

+ The port of Erlang/OTP to the realtime operating system + OSE has been removed.

+

+ Own Id: OTP-12573

+
+ +

+ Sharing preserved copy for messages and exit signals

+

+ Enable sharing preserved copy with configure option + --enable-sharing-preserving. This will preserve + sharing, within the process, when communication with + other processes in the Erlang node. There is a trade-off, + the copy is more costly but this cost can be reclaimed if + there is a lot of sharing in the message. With this + feature enabled literals will not be copied in a send + except during a purge phase of the module where the + literals are located.

+

+ Own Id: OTP-12590 Aux Id: OTP-10251

+
+ +

+ Halfword BEAM has been removed.

+

+ Own Id: OTP-12883

+
+ +

+ Added os:perf_counter/1.

+

+ The perf_counter is a very very cheap and high resolution + timer that can be used to timestamp system events. It + does not have monoticity guarantees, but should on most + OS's expose a monotonous time.

+

+ Own Id: OTP-12908

+
+ +

+ Support for a fragmented young heap generation. That is, + the young heap generation can consist of multiple non + continuous memory areas. The main reason for this change + is to avoid extra copying of messages that could not be + allocated directly on the receivers heap.

+

+ Own Id: OTP-13047

+
+ +

+ Erlang linked-in driver can now force the call to + open_port to block until a call to erl_drv_init_ack is + made inside the driver. This is useful when you want to + do some asynchronous initialization, for example getting + configuration from a pipe, and you want the initial + open_port call to fail if the configuration is incomplete + or wrong. See the erl_driver documentation for more + details on the API.

+

+ Own Id: OTP-13086

+
+ +

+ Erlang linked-in drivers can now set their own pid's as + seen in erlang:port_info/1 by using the + erl_drv_set_pid function. For more details see the + erl_driver documentation.

+

+ Own Id: OTP-13087

+
+ +

+ The functionality behind erlang:open_port/2 when + called with spawn or spawn_executable has been redone so + that the forking of the new program is done in a separate + process called erl_child_setup. This allows for a much + more robust implementation that uses less memory and does + not block the entire emulator if the program to be + started is on an un-accessible NFS. Benchmarks have shown + this approach to be about 3-5 times as fast as the old + approach where the fork/vfork was done by erts. This is a + pure stability and performance fix, however some error + messages may have changed, which is why it is marked as a + backwards incompatible change.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13088

+
+ +

Improved yielding strategy in the implementation of + the following native functions:

+ erlang:binary_to_list/1 + erlang:binary_to_list/3 + erlang:bitstring_to_list/1 + erlang:list_to_binary/1 + erlang:iolist_to_binary/1 + erlang:list_to_bitstring/1 + binary:list_to_bin/1

This + in order to improve performance of these functions.

+

+ Own Id: OTP-13096

+
+ +

+ All garbage collections of processes now bump reductions. + Also the amount of reductions bumped when garbage + collecting has been adjusted. It now better corresponds + to the amount of work performed. This in order to improve + the real time characteristics of the system.

+

+ Own Id: OTP-13097

+
+ +

New functions that can load multiple functions at once + have been added to the 'code' module. The + functions are code:atomic_load/1, + code:prepare_loading/1, + code:finish_loading/1, and + code:ensure_modules_loaded/1.

+

+ Own Id: OTP-13111

+
+ +

The function erl_prim_loader:start/3 has been + removed. Its documentation has also been removed.

+

The undocumented and unsupported function + erl_prim_loader:get_files/2 has been removed.

+

+ Own Id: OTP-13112

+
+ +

+ Low level BIF erlang:purge_module/1 is made more + robust against incorrect use. Lingering processes that + still refer the old code are now killed before the module + is purged to prevent fatal VM behavior.

+

+ Own Id: OTP-13122

+
+ +

+ Improved dirty scheduler implementation. For more + information see the NIF documentation.

+

+ Note that support for determining whether dirty NIF + support exist or not at compile time using the C + preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT + has been removed.

+

+ Own Id: OTP-13123

+
+ +

+ Various optimizations done to process dictionary access.

+

+ Own Id: OTP-13167

+
+ +

+ Added max_heap_size process flag. See erlang:process_flag + for more details.

+

+ Own Id: OTP-13174

+
+ +

+ Allow dynamic drivers and NIF libraries to be built with + gcc option -fvisibility=hidden for faster loading + and more optimized code.

+

+ Own Id: OTP-13227

+
+ +

+ Add erlang:process_info(Pid, + garbage_collection_info) which returns extended + garbage_collection information. For more details see the + documentation.

+

+ Own Id: OTP-13265

+
+ +

+ The functions erlang:list_to_integer/1 and + string:to_integer/1 have been optimized for large + inputs.

+

+ Own Id: OTP-13293

+
+ +

+ Introduction of configurable management of data referred + to by the message queue of a process. Each process can be + configured individually.

+

+ It is now possible to configure the message queue of a + process, so that all data referred by it will be kept + outside of the heap, and by this prevent this data from + being part of garbage collections.

+

+ For more information see the documentation of process_flag(message_queue_data, + MQD).

+

+ Own Id: OTP-13366 Aux Id: OTP-13047

+
+ +

+ Processes now yield when scanning large message queues + and not finding a matching message. This in order to + improve real time characteristics.

+

+ Own Id: OTP-13401

+
+ +

+ Optimized an erts internal function that is used to + traverse erlang terms. The internal function was mainly + used by term_to_binary and comparison of terms. + Benchmarks have shown up to a 10% performance increase in + those functions after the optimization.

+

+ Own Id: OTP-13440

+
+ +

+ Add the following NIF API functions:

+

+ enif_cpu_time + enif_now_time + enif_make_unique_integer + enif_is_process_alive + enif_is_port_alive + enif_term_to_binary + enif_binary_to_term + enif_port_command +

+

+ for details of what each function does, see the erl_nif + documentation.

+

+ Own Id: OTP-13442

+
+ +

+ Optimize '++' operator and lists:append/2 + by using a single pass to build a new list while checking + for properness.

+

+ Own Id: OTP-13487

+
+ +

+ Handle terms (pids,ports and refs) from nodes with a + 'creation' value larger than 3. This is a preparation of + the distribution protocol to allow OTP 19 nodes to + correctly communicate with future nodes (20 or higher). + The 'creation' value differentiates different + incarnations of the same node (name).

+

+ Own Id: OTP-13488

+
+ +

+ Don't send unasked for systemd notifications in epmd

+

+ Own Id: OTP-13493 Aux Id: PR-999

+
+ +

+ The enif_send API has been extended to allow NULL to be + used as the message environment. When used this way, a + message environent is implicitly created and the given + term is copied into that environment before sending. This + can be an optimization if many small messages are being + sent by the nif.

+

+ Own Id: OTP-13495

+
+ +

+ The tracing support has been extended to allow tracing on + ports. Ports can be traced on using the 'ports', 'send' + and 'receive' trace flags.

+

+ The first argument of erlang:trace/3 has + been extended so that 'all', 'existing' and + 'new' now include both processes and ports. New + Tracee variants, 'all_processes', + 'all_ports', 'existing_processes' etc have + been added to specify only processes or ports.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13496

+
+ +

+ When the 'procs' trace flag is enabled, a + 'spawned' trace event is now also generated by a + newly created process. The previous event 'spawn' + remains, but as it is generated by the process that did + the spawn, it is not guaranteed that it is ordered with + other trace events from the newly spawned process. So + when tracking the lifetime of a process this new event + should be used as the creation event.

+

+ This new trace event is marked as an incompatabiliy + because tools that expect certain trace events when + enabling 'procs' will have to updated.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13497

+
+ +

+ Add the erlang:match_spec_test/3 + function. The functions allows the testing of match + specifications for both tracing and ets tables. It can be + used to test that a match specification does the expected + filtering on specific data. It also returns more verbose + error reasons for incorrectly constructed match + specifications.

+

+ Own Id: OTP-13501

+
+ +

+ The erts internal tracing support has been changed to + have much less overhead and be more scalable.

+

+ This rewrite does not break any backwards + incompatabilities, but it does change the ordering of + some trace messages when compared to previous releases. + It should be noted that this only applies to trace + messages sent to processes or ports, it does not apply to + the new tracer module. However in future releases they + may also be effected by this.

+

+ Trace messages are only guaranteed to be ordered from one + traced process or port. In previous releases this was not + visible as a 'send' trace message would always + arrive before the corresponding 'receive' trace + message that is no longer always the case. This also + means that timestamped trace messages may seem to arrive + out of order as the timestamp is taken when the event is + triggered and not when it is put in the queue of the + tracer.

+

+ Own Id: OTP-13503

+
+ +

+ Add possibility to filter send and receive + trace with match specifications.

+

+ Own Id: OTP-13507

+
+ +

+ Add maps:update_with/3,4 and maps:take/2

+

+ Own Id: OTP-13522 Aux Id: PR-1025

+
+ +

+ Introduce LTTng tracing via Erlang tracing.

+

+ For LTTng to be enabled OTP needs to be built with + configure option --with-dynamic-trace=lttng.

+

The dynamic trace module dyntrace is now + capable to be used as a LTTng sink for Erlang tracing. + For a list of all tracepoints, see Runtime Tools User's + Guide .

+

This feature also introduces an incompatible change in + trace tags. The trace tags gc_start and + gc_end has been split into gc_minor_start, + gc_minor_end and gc_major_start, + gc_major_end.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13532

+
+ +

+ Print heap pointers for garbing processes during + crashdump

+

+ Own Id: OTP-13541 Aux Id: PR-1026

+
+ +

+ Changed and improved low level memory statistics returned + by erlang:system_info/1. The info for + erts_mmap has been moved from mseg_alloc to + its own section returned by {allocator, + erts_mmap}.

+

+ Own Id: OTP-13560

+
+
+
+ +
+
Erts 7.3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c324aab53c00cfe2d0809bf25fed14a78ccf3ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 11 May 2016 17:59:06 +0200 Subject: erts: Document enif_snprintf --- erts/doc/src/erl_nif.xml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 7546f7ef81..d13302fa54 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1653,6 +1653,15 @@ enif_map_iterator_destroy(env, &iter);

Get the byte size of a resource object obj obtained by enif_alloc_resource.

+ + intenif_snprintf(char *str, size_t size, const char *format, ...) + Format strings and Erlang terms + +

Similar to snprintf but this format string also accepts "%T" which formats Erlang terms. +

+
+
+ voidenif_system_info(ErlNifSysInfo *sys_info_ptr, size_t size) Get information about the Erlang runtime system -- cgit v1.2.3 From 663e847459686604ea051f036a0e4caff18cea6f Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 12 May 2016 12:04:14 +0200 Subject: Revert "Prepare release" This reverts commit bd64ad8e15d66e48b36dbe3584315dd5cfc8b59a. --- erts/doc/src/notes.xml | 625 ------------------------------------------------- 1 file changed, 625 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 7d39461f10..7501ccd9ce 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,631 +32,6 @@

This document describes the changes made to the ERTS application.

-
Erts 8.0 - -
Fixed Bugs and Malfunctions - - -

The handling of on_load functions has been - improved. The major improvement is that if a code upgrade - fails because the on_load function fails, the - previous version of the module will now be retained.

-

- Own Id: OTP-12593

-
- -

is_builtin(erlang, apply, 3) will now return - true.

-

- Own Id: OTP-13034

-
- -

- Fix enif_get_list_length to return false if list - is improper or have length larger than UINT_MAX - (did return true and an incorrect length value).

-

- Own Id: OTP-13288 Aux Id: PR913

-
- -

- Cleanup hipe signal handling code for x86 and make it - more portable.

-

- Own Id: OTP-13341 Aux Id: PR951

-
- -

- Use fsync instead of fdatasync on Mac OSX.

-

- Own Id: OTP-13411

-
- -

- Make sure to create a crash dump when running out of - memory. This was accidentally removed in the erts-7.3 - release.

-

- Own Id: OTP-13419

-
- -

- A bug has been fixed where if erlang was started +B on a - unix platform it would be killed by a SIGUSR2 signal when - creating a crash dump.

-

- Own Id: OTP-13425

-
- -

- Fix race between process_flag(trap_exit,true) and - a received exit signal.

-

- A process could terminate due to exit signal even though - process_flag(trap_exit,true) had returned. A very - specific timing between call to process_flag/2 and - exit signal from another scheduler was required for this - to happen.

-

- Own Id: OTP-13452

-
- -

Don't search for non-existing Map keys twice

-

For maps:get/2,3 and maps:find/2, - searching for an immediate key, e.g. an atom, in a small - map, the search was performed twice if the key did not - exist.

-

- Own Id: OTP-13459

-
- -

- When a abnormally large distribution message is about to - be sent, the VM has been changed to create a crash dump - instead of a core dump.

-

- Own Id: OTP-13474

-
- -

- Fix erlang:process_info/2 type specification

-

- Own Id: OTP-13485 Aux Id: ERL-123

-
- -

- Fix bug in open_port/2 with option {args, - List}. A vm crash could be caused by an improper - List.

-

- Own Id: OTP-13489 Aux Id: ERL-127

-
- -

- Don't crash on terminating processes with - erlang:system_profile/1,2

-

- Own Id: OTP-13494 Aux Id: ERL-126

-
- -

- Fixed bugs where the reduction counter was not handled - correct.

-

- Own Id: OTP-13512

-
- -

- Fixed typo in description of the EPMD_DUMP_REQ - response.

-

- Own Id: OTP-13517

-
- -

- Fixed a bug where a process flagged as sensitive would - sometimes record its save_calls when it shouldn't.

-

- Own Id: OTP-13540

-
- -

- Update configure scripts to not use hardcoded path for - /bin/pwd and /bin/rm.

-

- Own Id: OTP-13562

-
-
-
- - -
Improvements and New Features - - -

- The tracing support has been extended to allow a tracer module to be the - trace event handler instead of a process or port. The - tracer module - makes it possible for trace tools to filter or manipulate - trace event data without the trace event first haing to - be copied from the traced process or port.

-

- With the introduction of this feature, - erlang:trace(all|existing, _, _) now also returns - the tracer process as part of the number of processes on - which tracing is enabled. The is incompatible with the - previous releases.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-10267

-
- -

- Introduce LTTng tracing of Erlang Runtime System

-

- For LTTng to be enabled OTP needs to be built with - configure option --with-dynamic-trace=lttng.

-

- This feature introduces tracepoints for schedulers, - drivers, memory carriers, memory and async thread pool.

-

For a list of all tracepoints, see Runtime Tools User's - Guide .

-

- Own Id: OTP-10282 Aux Id: kunagi-14 [14]

-
- -

- Add microstate accounting

-

- Microstate accounting is a way to track which state the - different threads within ERTS are in. The main usage area - is to pin point performance bottlenecks by checking which - states the threads are in and then from there figuring - out why and where to optimize.

-

- Since checking whether microstate accounting is on or off - is relatively expensive only a few of the states are - enabled by default and more states can be enabled through - configure.

-

- There is a convinence module called msacc that has been - added to runtime_tools that can assist in gathering and - interpreting the data from Microstate accounting.

-

- For more information see erlang:statistics(microstate_accounting, - _) and the msacc module in - runtime_tools.

-

- Own Id: OTP-12345

-
- -

- The port of Erlang/OTP to the realtime operating system - OSE has been removed.

-

- Own Id: OTP-12573

-
- -

- Sharing preserved copy for messages and exit signals

-

- Enable sharing preserved copy with configure option - --enable-sharing-preserving. This will preserve - sharing, within the process, when communication with - other processes in the Erlang node. There is a trade-off, - the copy is more costly but this cost can be reclaimed if - there is a lot of sharing in the message. With this - feature enabled literals will not be copied in a send - except during a purge phase of the module where the - literals are located.

-

- Own Id: OTP-12590 Aux Id: OTP-10251

-
- -

- Halfword BEAM has been removed.

-

- Own Id: OTP-12883

-
- -

- Added os:perf_counter/1.

-

- The perf_counter is a very very cheap and high resolution - timer that can be used to timestamp system events. It - does not have monoticity guarantees, but should on most - OS's expose a monotonous time.

-

- Own Id: OTP-12908

-
- -

- Support for a fragmented young heap generation. That is, - the young heap generation can consist of multiple non - continuous memory areas. The main reason for this change - is to avoid extra copying of messages that could not be - allocated directly on the receivers heap.

-

- Own Id: OTP-13047

-
- -

- Erlang linked-in driver can now force the call to - open_port to block until a call to erl_drv_init_ack is - made inside the driver. This is useful when you want to - do some asynchronous initialization, for example getting - configuration from a pipe, and you want the initial - open_port call to fail if the configuration is incomplete - or wrong. See the erl_driver documentation for more - details on the API.

-

- Own Id: OTP-13086

-
- -

- Erlang linked-in drivers can now set their own pid's as - seen in erlang:port_info/1 by using the - erl_drv_set_pid function. For more details see the - erl_driver documentation.

-

- Own Id: OTP-13087

-
- -

- The functionality behind erlang:open_port/2 when - called with spawn or spawn_executable has been redone so - that the forking of the new program is done in a separate - process called erl_child_setup. This allows for a much - more robust implementation that uses less memory and does - not block the entire emulator if the program to be - started is on an un-accessible NFS. Benchmarks have shown - this approach to be about 3-5 times as fast as the old - approach where the fork/vfork was done by erts. This is a - pure stability and performance fix, however some error - messages may have changed, which is why it is marked as a - backwards incompatible change.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13088

-
- -

Improved yielding strategy in the implementation of - the following native functions:

- erlang:binary_to_list/1 - erlang:binary_to_list/3 - erlang:bitstring_to_list/1 - erlang:list_to_binary/1 - erlang:iolist_to_binary/1 - erlang:list_to_bitstring/1 - binary:list_to_bin/1

This - in order to improve performance of these functions.

-

- Own Id: OTP-13096

-
- -

- All garbage collections of processes now bump reductions. - Also the amount of reductions bumped when garbage - collecting has been adjusted. It now better corresponds - to the amount of work performed. This in order to improve - the real time characteristics of the system.

-

- Own Id: OTP-13097

-
- -

New functions that can load multiple functions at once - have been added to the 'code' module. The - functions are code:atomic_load/1, - code:prepare_loading/1, - code:finish_loading/1, and - code:ensure_modules_loaded/1.

-

- Own Id: OTP-13111

-
- -

The function erl_prim_loader:start/3 has been - removed. Its documentation has also been removed.

-

The undocumented and unsupported function - erl_prim_loader:get_files/2 has been removed.

-

- Own Id: OTP-13112

-
- -

- Low level BIF erlang:purge_module/1 is made more - robust against incorrect use. Lingering processes that - still refer the old code are now killed before the module - is purged to prevent fatal VM behavior.

-

- Own Id: OTP-13122

-
- -

- Improved dirty scheduler implementation. For more - information see the NIF documentation.

-

- Note that support for determining whether dirty NIF - support exist or not at compile time using the C - preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT - has been removed.

-

- Own Id: OTP-13123

-
- -

- Various optimizations done to process dictionary access.

-

- Own Id: OTP-13167

-
- -

- Added max_heap_size process flag. See erlang:process_flag - for more details.

-

- Own Id: OTP-13174

-
- -

- Allow dynamic drivers and NIF libraries to be built with - gcc option -fvisibility=hidden for faster loading - and more optimized code.

-

- Own Id: OTP-13227

-
- -

- Add erlang:process_info(Pid, - garbage_collection_info) which returns extended - garbage_collection information. For more details see the - documentation.

-

- Own Id: OTP-13265

-
- -

- The functions erlang:list_to_integer/1 and - string:to_integer/1 have been optimized for large - inputs.

-

- Own Id: OTP-13293

-
- -

- Introduction of configurable management of data referred - to by the message queue of a process. Each process can be - configured individually.

-

- It is now possible to configure the message queue of a - process, so that all data referred by it will be kept - outside of the heap, and by this prevent this data from - being part of garbage collections.

-

- For more information see the documentation of process_flag(message_queue_data, - MQD).

-

- Own Id: OTP-13366 Aux Id: OTP-13047

-
- -

- Processes now yield when scanning large message queues - and not finding a matching message. This in order to - improve real time characteristics.

-

- Own Id: OTP-13401

-
- -

- Optimized an erts internal function that is used to - traverse erlang terms. The internal function was mainly - used by term_to_binary and comparison of terms. - Benchmarks have shown up to a 10% performance increase in - those functions after the optimization.

-

- Own Id: OTP-13440

-
- -

- Add the following NIF API functions:

-

- enif_cpu_time - enif_now_time - enif_make_unique_integer - enif_is_process_alive - enif_is_port_alive - enif_term_to_binary - enif_binary_to_term - enif_port_command -

-

- for details of what each function does, see the erl_nif - documentation.

-

- Own Id: OTP-13442

-
- -

- Optimize '++' operator and lists:append/2 - by using a single pass to build a new list while checking - for properness.

-

- Own Id: OTP-13487

-
- -

- Handle terms (pids,ports and refs) from nodes with a - 'creation' value larger than 3. This is a preparation of - the distribution protocol to allow OTP 19 nodes to - correctly communicate with future nodes (20 or higher). - The 'creation' value differentiates different - incarnations of the same node (name).

-

- Own Id: OTP-13488

-
- -

- Don't send unasked for systemd notifications in epmd

-

- Own Id: OTP-13493 Aux Id: PR-999

-
- -

- The enif_send API has been extended to allow NULL to be - used as the message environment. When used this way, a - message environent is implicitly created and the given - term is copied into that environment before sending. This - can be an optimization if many small messages are being - sent by the nif.

-

- Own Id: OTP-13495

-
- -

- The tracing support has been extended to allow tracing on - ports. Ports can be traced on using the 'ports', 'send' - and 'receive' trace flags.

-

- The first argument of erlang:trace/3 has - been extended so that 'all', 'existing' and - 'new' now include both processes and ports. New - Tracee variants, 'all_processes', - 'all_ports', 'existing_processes' etc have - been added to specify only processes or ports.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13496

-
- -

- When the 'procs' trace flag is enabled, a - 'spawned' trace event is now also generated by a - newly created process. The previous event 'spawn' - remains, but as it is generated by the process that did - the spawn, it is not guaranteed that it is ordered with - other trace events from the newly spawned process. So - when tracking the lifetime of a process this new event - should be used as the creation event.

-

- This new trace event is marked as an incompatabiliy - because tools that expect certain trace events when - enabling 'procs' will have to updated.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13497

-
- -

- Add the erlang:match_spec_test/3 - function. The functions allows the testing of match - specifications for both tracing and ets tables. It can be - used to test that a match specification does the expected - filtering on specific data. It also returns more verbose - error reasons for incorrectly constructed match - specifications.

-

- Own Id: OTP-13501

-
- -

- The erts internal tracing support has been changed to - have much less overhead and be more scalable.

-

- This rewrite does not break any backwards - incompatabilities, but it does change the ordering of - some trace messages when compared to previous releases. - It should be noted that this only applies to trace - messages sent to processes or ports, it does not apply to - the new tracer module. However in future releases they - may also be effected by this.

-

- Trace messages are only guaranteed to be ordered from one - traced process or port. In previous releases this was not - visible as a 'send' trace message would always - arrive before the corresponding 'receive' trace - message that is no longer always the case. This also - means that timestamped trace messages may seem to arrive - out of order as the timestamp is taken when the event is - triggered and not when it is put in the queue of the - tracer.

-

- Own Id: OTP-13503

-
- -

- Add possibility to filter send and receive - trace with match specifications.

-

- Own Id: OTP-13507

-
- -

- Add maps:update_with/3,4 and maps:take/2

-

- Own Id: OTP-13522 Aux Id: PR-1025

-
- -

- Introduce LTTng tracing via Erlang tracing.

-

- For LTTng to be enabled OTP needs to be built with - configure option --with-dynamic-trace=lttng.

-

The dynamic trace module dyntrace is now - capable to be used as a LTTng sink for Erlang tracing. - For a list of all tracepoints, see Runtime Tools User's - Guide .

-

This feature also introduces an incompatible change in - trace tags. The trace tags gc_start and - gc_end has been split into gc_minor_start, - gc_minor_end and gc_major_start, - gc_major_end.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13532

-
- -

- Print heap pointers for garbing processes during - crashdump

-

- Own Id: OTP-13541 Aux Id: PR-1026

-
- -

- Changed and improved low level memory statistics returned - by erlang:system_info/1. The info for - erts_mmap has been moved from mseg_alloc to - its own section returned by {allocator, - erts_mmap}.

-

- Own Id: OTP-13560

-
-
-
- -
-
Erts 7.3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 031e4e19120af3e40fcc937bebb4cc45b59f5b87 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 11 May 2016 19:08:49 +0200 Subject: erts: Fix confusion among match spec examples Tracing and ETS examples were not separated correctly under the corresponding headings. --- erts/doc/src/match_spec.xml | 75 +++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 37 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index 3944f24f84..ca73d78b8d 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -528,7 +528,7 @@
- ETS Examples + Tracing Examples

Match an argument list of three where the first and third arguments are equal:

has to be a proper list.

-

Match all objects in an ets table where the first element is - the atom 'strider' and the tuple arity is 3 and return the whole - object.

- -

Match all objects in an ets table with arity > 1 and the first - element is 'gandalf', return element 2.

- =',{size, '$1'},2}], - [{element,2,'$1'}]}] - ]]> -

In the above example, if the first element had been the key, - it's much more efficient to match that key in the - part than in the part. The search space of - the tables is restricted with regards to the so - that only objects with the matching key are searched. -

-

Match tuples of 3 elements where the second element is either - 'merry' or 'pippin', return the whole objects.

- -

The function can be useful for testing - complicated ets matches.

-
-
- Tracing Examples

Only generate trace message if trace control word is set to 1:

+ +
+ ETS Examples +

Match all objects in an ets table where the first element is + the atom 'strider' and the tuple arity is 3 and return the whole + object.

+ +

Match all objects in an ets table with arity > 1 and the first + element is 'gandalf', return element 2.

+ =',{size, '$1'},2}], + [{element,2,'$1'}]}] + ]]> +

In the above example, if the first element had been the key, + it's much more efficient to match that key in the + part than in the part. The search space of + the tables is restricted with regards to the so + that only objects with the matching key are searched. +

+

Match tuples of 3 elements where the second element is either + 'merry' or 'pippin', return the whole objects.

+ +

The function can be useful for testing + complicated ets matches.

+
-- cgit v1.2.3 From 46f08788d88e61f41f34f775314444191ebe3b41 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 12 May 2016 18:13:20 +0200 Subject: erts: Add send/receive trace to match spec user guide Introduce section/terminology "Match target". --- erts/doc/src/match_spec.xml | 74 +++++++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 20 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index ca73d78b8d..7be3d15de6 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -33,21 +33,15 @@ match_spec.xml

A "match specification" (match_spec) is an Erlang term describing a - small "program" that will try to match something (either the - parameters to a function as used in the - BIF, or the objects in an ETS table.). + small "program" that will try to match something. It can be used + to either control tracing with + erlang:trace_pattern/3 + or to search for objects in an ETS table with for example + ets:select/2. The match_spec in many ways works like a small function in Erlang, but is interpreted/compiled by the Erlang runtime system to something much more efficient than calling an Erlang function. The match_spec is also very limited compared to the expressiveness of real Erlang functions.

-

Match specifications are given to the BIF to - execute matching of function arguments as well as to define some actions - to be taken when the match succeeds (the part). Match - specifications can also be used in ETS, to specify objects to be - returned from an call (or other select - calls). The semantics and restrictions differ slightly when using - match specifications for tracing and in ETS, the differences are - defined in a separate paragraph below.

The most notable difference between a match_spec and an Erlang fun is of course the syntax. Match specifications are Erlang terms, not Erlang code. A match_spec also has a somewhat strange concept of @@ -382,6 +376,51 @@ the pid() of the current process.

+ +
+ Match target +

Each execution of a match specification is done against + a match target term. The format and content of the target term + depends on the context in which the match is done. The match + target for ETS is always a full table tuple. The match target + for call trace is always a list of all function arguments. The + match target for event trace depends on the event type, see + table below.

+ + + Context + Type + Match target + Description + + + ETS + + {Key, Value1, Value2, ...} + A table object + + + Trace + call + [Arg1, Arg2, ...] + Function arguments + + + Trace + send + [Receiver, Message] + Receiving process/port and message term + + + Trace + 'receive' + [Node, Sender, Message] + Sending node, process/port and message term + + Match target depending on context +
+
+
Variables and literals

Variables take the form ']]> where @@ -396,10 +435,8 @@ parts, only variables bound previously may be used. As a special case, in the parts, the variable - expands to the whole expression which matched the - (i.e., the whole parameter list to the possibly - traced function or the whole matching object in the ets table) - and the variable expands to a list + expands to the whole match target + term and the variable expands to a list of the values of all bound variables in order (i.e. ).

@@ -480,8 +517,8 @@

For each tuple in the list and while no match has succeeded:

- Match the part against the arguments to the - function, + Match the part against the + match target term, binding the ']]> variables (much like in ). If the cannot match the arguments, the match fails. @@ -522,9 +559,6 @@ term. The 's are executed as in an imperative language, i.e. for their side effects. Functions with side effects are also allowed when tracing.

-

In ETS the match head is a (or a single match - variable) while it is a list (or a single match variable) when - tracing.

-- cgit v1.2.3 From 2fccb09b710b1e42157b3801ac1b154f76ae6898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 16 May 2016 11:58:28 +0200 Subject: Remove the warning about using erlang:raise/3 There is no good reason to say that erlang:raise/3 is only for debugging. Here is an example where it can be extremely useful: try do_something(Args) catch Class:Error -> Stack = erlang:get_stacktrace(), io:format("Args: ~p\n", [Args]), erlang:raise(Class, Error, Stack) That is, we can let it crash, but log additional useful information before crashing. Noticed-by: Per Hedeland --- erts/doc/src/erlang.xml | 4 ---- 1 file changed, 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e0723127f2..34933d6f48 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -5070,10 +5070,6 @@ os_prompt%

Stops the execution of the calling process with an exception of given class, reason, and call stack backtrace (stacktrace).

- -

This BIF is intended for debugging. Avoid to use it in applications, - unless you really know what you are doing.

-

Class is error, exit, or throw. So, if it were not for the stacktrace, erlang:raise(Class, Reason, -- cgit v1.2.3 From 29b7e1762d69d4173cba8edb273772f05a215083 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 17 May 2016 13:00:49 +0200 Subject: erts: Remove no longer needed anchors in documentation --- erts/doc/src/erlang.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e0723127f2..8724139c01 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -52,7 +52,6 @@ ext_binary() -

A binary data object, structured according to the Erlang external term format.

-- cgit v1.2.3 From 1ba422f4e4a18dd9874c9704b73cbf38b4252fa7 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 13 May 2016 10:28:22 +0200 Subject: erts: Fix erl_tracer xml doc errors --- erts/doc/src/erl_tracer.xml | 62 ++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml index 7fd5512b33..d4c8bbad31 100644 --- a/erts/doc/src/erl_tracer.xml +++ b/erts/doc/src/erl_tracer.xml @@ -67,7 +67,7 @@

The different trace tags that the tracer will be called with. Each trace tag is described in greater detail in - Module:trace/6 + Module:trace/6

@@ -81,7 +81,7 @@ -

The options for the tracee. +

The options for the tracee.

timestamp If not set to undefined, the tracer has been requested to @@ -93,7 +93,6 @@ Set to a number if the scheduler id is to be included by the tracer. Otherwise it is set to undefined. -

@@ -114,30 +113,30 @@

The following functions should be exported from a erl_tracer callback module.

- Module:enabled/3 + Module:enabled/3 Mandatory - Module:trace/6 + Module:trace/6 Mandatory - Module:enabled_procs/3 + Module:enabled_procs/3 Optional - Module:trace_procs/6 + Module:trace_procs/6 Optional - Module:enabled_ports/3 + Module:enabled_ports/3 Optional - Module:trace_ports/6 + Module:trace_ports/6 Optional - Module:enabled_running_ports/3 + Module:enabled_running_ports/3 Optional - Module:trace_running_ports/6 + Module:trace_running_ports/6 Optional - Module:enabled_running_procs/3 + Module:enabled_running_procs/3 Optional - Module:trace_running_procs/6 + Module:trace_running_procs/6 Optional
- + Module:enabled(TraceTag, TracerState, Tracee) -> Result @@ -166,7 +165,6 @@ is important that it is both fast and side effect free.

- Module:trace(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -181,7 +179,7 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled/3 + the Module:enabled/3 callback returned trace. In it any side effects needed by the tracer should be done. The tracepoint payload is located in the FirstTraceTerm and SecondTraceTerm. The content @@ -212,7 +210,6 @@ - Module:enabled_procs(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -230,7 +227,6 @@ - Module:trace_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -245,13 +241,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_procs/3 + the Module:enabled_procs/3 callback returned trace.

If trace_procs/6 is not defined trace/6 will be called instead.

- Module:enabled_ports(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -269,7 +264,6 @@ - Module:trace_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -284,13 +278,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_ports/3 + the Module:enabled_ports/3 callback returned trace.

If trace_ports/6 is not defined trace/6 will be called instead.

- Module:enabled_running_procs(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -308,7 +301,6 @@ - Module:trace_running_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -323,13 +315,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_running_procs/3 + the Module:enabled_running_procs/3 callback returned trace.

If trace_running_procs/6 is not defined trace/6 will be called instead.

- Module:enabled_running_ports(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -347,7 +338,6 @@ - Module:trace_running_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -362,13 +352,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_running_ports/3 + the Module:enabled_running_ports/3 callback returned trace.

If trace_running_ports/6 is not defined trace/6 will be called instead.

- Module:enabled_call(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -386,7 +375,6 @@ - Module:trace_call(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -401,13 +389,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_call/3 + the Module:enabled_call/3 callback returned trace.

If trace_call/6 is not defined trace/6 will be called instead.

- Module:enabled_send(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -425,7 +412,6 @@ - Module:trace_send(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -440,13 +426,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_send/3 + the Module:enabled_send/3 callback returned trace.

If trace_send/6 is not defined trace/6 will be called instead.

- Module:enabled_receive(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -464,7 +449,6 @@ - Module:trace_receive(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -479,13 +463,12 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_receive/3 + the Module:enabled_receive/3 callback returned trace.

If trace_receive/6 is not defined trace/6 will be called instead.

- Module:enabled_garbage_collection(TraceTag, TracerState, Tracee) -> Result Check if a trace event should be generated. @@ -503,7 +486,6 @@ - Module:trace_garbage_collection(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result Check if a trace event should be generated. @@ -518,7 +500,7 @@

This callback will be called when a tracepoint is triggered and - the Module:enabled_garbage_collection/3 + the Module:enabled_garbage_collection/3 callback returned trace.

If trace_garbage_collection/6 is not defined trace/6 will be called instead.

-- cgit v1.2.3 From f1be30c44044e7bb0167a34d234b6b2322328def Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Tue, 1 Dec 2015 13:14:43 +0100 Subject: Clarify limitation on halt/2 slogan string --- erts/doc/src/erlang.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 9287b32fec..1e251d33f3 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1802,6 +1802,8 @@ os_prompt% string() An Erlang crash dump is produced with Status as slogan. Then the runtime system exits with status code 1. + Note that the string may not be longer than 200 characters and only + code points in the range 0-255 may be used. abort -- cgit v1.2.3 From be353901879b3cccda7cd01947936cf1550dea04 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Tue, 1 Dec 2015 11:25:12 +0100 Subject: Check exit status in init:stop/1 and simplify documentation --- erts/doc/src/init.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index 84a5aea335..3546099fad 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -178,14 +178,8 @@ Take down an Erlang node smoothly -

All applications are taken down smoothly, all code is - unloaded, and all ports are closed before the system - terminates. If the -heart command line flag was given, - the heart program is terminated before the Erlang node - terminates. Refer to heart(3) for more information.

-

To limit the shutdown time, the time init is allowed - to spend taking down applications, the -shutdown_time - command line flag should be used.

+

The same as + stop(0).

-- cgit v1.2.3 From 730b5c14a33800bb5b0c19e8e48b213e07402179 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 13 May 2016 14:15:21 +0200 Subject: minor fixes --- erts/doc/src/erl_nif.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 33a4fee182..181c6f50d7 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -322,13 +322,13 @@ ok

The enif_consume_timeslice() - function can be used to inform the runtime system about the lenght of the + function can be used to inform the runtime system about the length of the NIF call. It should typically always be used unless the NIF executes very quickly.

-

If the NIF call is too lenghty one needs to handle this in one of the +

If the NIF call is too lengthy one needs to handle this in one of the following ways in order to avoid degraded responsiveness, scheduler load - balancing problems, and other strange behaviours:

+ balancing problems, and other strange behaviors:

Yielding NIF @@ -410,14 +410,14 @@ ok erlang:system_flag(multi_scheduling, block), might also take a very long time to complete. This since all ongoing dirty operations on all - dirty schedulers need to complete before the the block + dirty schedulers need to complete before the block operation can complete.

A lot of operations communicating with a process executing a dirty NIF can, however, complete while it is executing the - dirty NIF. For example, retreiving information about it via + dirty NIF. For example, retrieving information about it via process_info(), setting its group leader, register/unregister its name, etc.

@@ -425,10 +425,10 @@ ok

Termination of a process executing a dirty NIF can only be completed up to a certain point while it is executing the - dirty NIF. All Erlang resources such as registered names, - ETS tables, etc will be released. All links and monitors + dirty NIF. All Erlang resources such as its registered name, + its ETS tables, etc will be released. All links and monitors will be triggered. The actual execution of the NIF will - however not be stopped. The NIF can safely contiue + however not be stopped. The NIF can safely continue execution, allocate heap memory, etc, but it is of course better to stop executing as soon as possible. The NIF can check whether current process is alive or not using @@ -450,8 +450,8 @@ ok collect a process in order to determine if it has references to the module, a process executing a dirty NIF might delay purging for a very long time. Delaying - a purge operatin implies delaying all code - loding operations which might cause severe problems for + a purge operation implies delaying all code + loading operations which might cause severe problems for the system as a whole.

-- cgit v1.2.3 From 115f0ba77ad7d01ab95fd9f9bbeca53f04f12284 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 19 May 2016 10:54:43 +0200 Subject: erts: Move tracer SecondTraceTerm to Opts map The extra trace data has been moved to the opts map in order for the tracer to be able to distinguish inbetween extra trace data 'undefined' and no extra trace data. In the same commit all opts associations have been changed so that if the tracer should not use them, the key is left unassicated instead of being sent to undefined. This should be give a small performance gain and also makes the API easier to work with. --- erts/doc/src/erl_tracer.xml | 96 +++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 51 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_tracer.xml b/erts/doc/src/erl_tracer.xml index d4c8bbad31..7841fdfd63 100644 --- a/erts/doc/src/erl_tracer.xml +++ b/erts/doc/src/erl_tracer.xml @@ -67,7 +67,7 @@

The different trace tags that the tracer will be called with. Each trace tag is described in greater detail in - Module:trace/6 + Module:trace/5

@@ -84,14 +84,18 @@

The options for the tracee.

timestamp - If not set to undefined, the tracer has been requested to - include a timestamp. + If set the tracer has been requested to include a timestamp. + extra + If set the tracepoint has included additonal data about + the trace event. What the additional data is depends on which + TraceTag has been triggered. The extra trace data + corresponds to the fifth elemnt in the trace tuples described in + erlang:trace/3. match_spec_result - If not set to true, the tracer has been requested to - include the output of a match specification that was run. + If set the tracer has been requested to include the output + of a match specification that was run. scheduler_id - Set to a number if the scheduler id is to be included by the tracer. - Otherwise it is set to undefined. + Set the scheduler id is to be included by the tracer. @@ -115,23 +119,23 @@ Module:enabled/3 Mandatory - Module:trace/6 + Module:trace/5 Mandatory Module:enabled_procs/3 Optional - Module:trace_procs/6 + Module:trace_procs/5 Optional Module:enabled_ports/3 Optional - Module:trace_ports/6 + Module:trace_ports/5 Optional Module:enabled_running_ports/3 Optional - Module:trace_running_ports/6 + Module:trace_running_ports/5 Optional Module:enabled_running_procs/3 Optional - Module:trace_running_procs/6 + Module:trace_running_procs/5 Optional @@ -166,14 +170,13 @@
- Module:trace(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -182,17 +185,17 @@ the Module:enabled/3 callback returned trace. In it any side effects needed by the tracer should be done. The tracepoint payload is located in - the FirstTraceTerm and SecondTraceTerm. The content - of the TraceTerms depends on which TraceTag has been triggered. - The FirstTraceTerm and SecondTraceTerm correspond to the - fourth and fifth slot in the trace tuples described in + the TraceTerm. The content of the TraceTerm depends on which + TraceTag has been triggered. + The TraceTerm corresponds to the + fourth element in the trace tuples described in erlang:trace/3. - If the tuple only has four elements, SecondTraceTerm will be - undefined.

+ If the trace tuple has five elements, the fifth element will be sent as + the extra value in the Opts maps.

- Module:trace(seq_trace, TracerState, Label, SeqTraceInfo, undefined, Opts) -> Result + Module:trace(seq_trace, TracerState, Label, SeqTraceInfo, Opts) -> Result Check if a sequence trace event should be generated. TracerState = term() @@ -228,14 +231,13 @@ - Module:trace_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_procs(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -243,7 +245,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_procs/3 callback returned trace.

-

If trace_procs/6 is not defined trace/6 will be called instead.

+

If trace_procs/5 is not defined trace/5 will be called instead.

@@ -265,14 +267,13 @@ - Module:trace_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_ports(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -280,7 +281,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_ports/3 callback returned trace.

-

If trace_ports/6 is not defined trace/6 will be called instead.

+

If trace_ports/5 is not defined trace/5 will be called instead.

@@ -302,14 +303,13 @@ - Module:trace_running_procs(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_running_procs(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag_running_procs() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -317,7 +317,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_running_procs/3 callback returned trace.

-

If trace_running_procs/6 is not defined trace/6 will be called instead.

+

If trace_running_procs/5 is not defined trace/5 will be called instead.

@@ -339,14 +339,13 @@ - Module:trace_running_ports(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_running_ports(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag_running_ports() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -354,7 +353,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_running_ports/3 callback returned trace.

-

If trace_running_ports/6 is not defined trace/6 will be called instead.

+

If trace_running_ports/5 is not defined trace/5 will be called instead.

@@ -376,14 +375,13 @@ - Module:trace_call(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_call(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag_call() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -391,7 +389,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_call/3 callback returned trace.

-

If trace_call/6 is not defined trace/6 will be called instead.

+

If trace_call/5 is not defined trace/5 will be called instead.

@@ -413,14 +411,13 @@ - Module:trace_send(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_send(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag_send() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -428,7 +425,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_send/3 callback returned trace.

-

If trace_send/6 is not defined trace/6 will be called instead.

+

If trace_send/5 is not defined trace/5 will be called instead.

@@ -450,14 +447,13 @@ - Module:trace_receive(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_receive(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag_receive() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -465,7 +461,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_receive/3 callback returned trace.

-

If trace_receive/6 is not defined trace/6 will be called instead.

+

If trace_receive/5 is not defined trace/5 will be called instead.

@@ -487,14 +483,13 @@ - Module:trace_garbage_collection(TraceTag, TracerState, Tracee, FirstTraceTerm, SecondTraceTerm, Opts) -> Result + Module:trace_garbage_collection(TraceTag, TracerState, Tracee, TraceTerm, Opts) -> Result Check if a trace event should be generated. TraceTag = trace_tag_gc() TracerState = term() Tracee = tracee() FirstTraceTerm = term() - SecondTraceTerm = term() | undefined Opts = trace_opts() Result = ok @@ -502,7 +497,7 @@

This callback will be called when a tracepoint is triggered and the Module:enabled_garbage_collection/3 callback returned trace.

-

If trace_garbage_collection/6 is not defined trace/6 will be called instead.

+

If trace_garbage_collection/5 is not defined trace/5 will be called instead.

@@ -543,7 +538,7 @@ ok
 -module(erl_msg_tracer).
 
--export([enabled/3, trace/6, load/0]).
+-export([enabled/3, trace/5, load/0]).
 
 load() ->
     erlang:load_nif("erl_msg_tracer", []).
@@ -551,7 +546,7 @@ load() ->
 enabled(_, _, _) ->
     error.
 
-trace(_, _, _,_, _, _) ->
+trace(_, _, _,_, _) ->
     error.
     

erl_msg_tracer.c

@@ -569,7 +564,7 @@ static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); static ErlNifFunc nif_funcs[] = { {"enabled", 3, enabled}, - {"trace", 6, trace} + {"trace", 5, trace} }; ERL_NIF_INIT(erl_msg_tracer, nif_funcs, load, NULL, upgrade, unload) @@ -632,9 +627,8 @@ static ERL_NIF_TERM enabled(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) * argv[0]: TraceTag, should only be 'send' * argv[1]: TracerState, process to send {argv[2], argv[4]} to * argv[2]: Tracee - * argv[3]: Message, ignored - * argv[4]: Recipient - * argv[5]: Options, ignored + * argv[3]: Recipient + * argv[4]: Options, ignored */ static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) { -- cgit v1.2.3 From dcaa52d75e3bcbc808696597a34f2fca5677fff9 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 20 May 2016 15:56:56 +0200 Subject: erts: Make erlang:halt/2 truncate string arg if too long. --- erts/doc/src/erlang.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 1e251d33f3..665429d290 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1802,8 +1802,8 @@ os_prompt% string() An Erlang crash dump is produced with Status as slogan. Then the runtime system exits with status code 1. - Note that the string may not be longer than 200 characters and only - code points in the range 0-255 may be used. + Note that only code points in the range 0-255 may be used + and the string will be truncated if longer than 200 characters. abort -- cgit v1.2.3 From 36f98375d57daaba3fec42bb91482cdac9ef4cc9 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 25 May 2016 16:15:36 +0200 Subject: Remove the 'message_queue_data' option 'mixed' --- erts/doc/src/erl.xml | 4 ++-- erts/doc/src/erlang.xml | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 1bbde7f1e0..2fae3bfb1f 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -660,11 +660,11 @@

Sets the initial process dictionary size of processes to the size .

- +hmqd off_heap|on_heap|mixed + +hmqd off_heap|on_heap

Sets the default value for the process flag message_queue_data. If +hmqd is not - passed, mixed will be the default. For more information, + passed, on_heap will be the default. For more information, see the documentation of process_flag(message_queue_data, MQD). diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 9287b32fec..ddde1c96c4 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4449,11 +4449,6 @@ os_prompt% off heap. This is how messages always have been stored up until ERTS version 8.0.

- mixed -

- Messages may be placed either on the heap or outside - of the heap. -

The default message_queue_data process flag is determined @@ -4877,7 +4872,7 @@ os_prompt%

Returns the current state of the message_queue_data process flag. MQD is either off_heap, - on_heap, or mixed. For more information, see the + or on_heap. For more information, see the documentation of process_flag(message_queue_data, MQD).

@@ -5808,7 +5803,7 @@ true

Sets the state of the message_queue_data process flag. MQD should be either off_heap, - on_heap, or mixed. The default + or on_heap. The default message_queue_data process flag is determined by the +hmqd erl command line argument. For more information, see the @@ -7164,7 +7159,7 @@ ok message_queue_data

Returns the default value of the message_queue_data - process flag which is either off_heap, on_heap, or mixed. + process flag which is either off_heap, or on_heap. This default is set by the erl command line argument +hmqd. For more information on the message_queue_data process flag, see documentation of -- cgit v1.2.3 From 34f853950685e4e7ab38f30fc3f17a6beac13349 Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Wed, 20 Apr 2016 14:40:39 +0100 Subject: Add -start_epmd command line option Add a command line option that lets you disable automatic starting of epmd when starting a distributed node. This differs from the undocumented setting -no_epmd, in that it does not affect the starting of an erl_epmd process within erl_distribution: the newly started node will expect an epmd instance to have been started previously. --- erts/doc/src/erl.xml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 1bbde7f1e0..e63928ddb0 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -338,7 +338,8 @@ net_kernel(3). It is also ensured that runs on the current host before Erlang is started. See - epmd(1).

+ epmd(1) and the + -start_epmd option.

The name of the node will be , where is the fully qualified host name of the current host. For short names, use the flag instead.

@@ -463,6 +464,21 @@ flag and those running with the flag, as node names must be unique in distributed Erlang systems.

+ -start_epmd true | false + + +

Specifies whether Erlang should start + epmd on startup. By default + this is true, but if you prefer to start epmd + manually, set this to false.

+ +

This only applies if Erlang is started as a distributed node, + i.e. if -name or -sname is specified. Otherwise, + epmd is not started even if -start_epmd true is given.

+ +

Note that a distributed node will fail to start if epmd is + not running.

+

-smp enable and -smp starts the Erlang runtime -- cgit v1.2.3 From 252c60632664fdf54395d54ad8d7b7e9e6e74cca Mon Sep 17 00:00:00 2001 From: Magnus Henoch Date: Wed, 20 Apr 2016 17:20:05 +0100 Subject: Use the -epmd_module flag consistently If the -epmd_module flag has been specified on the command line, use that module to register and look up node names instead of the default, erl_epmd. Also document this option. --- erts/doc/src/init.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index 84a5aea335..878a33c9ca 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -241,6 +241,11 @@ marker="kernel:code">code(3).

+ -epmd_module Module + +

Specifies the module to use for registration and lookup of + node names. Defaults to erl_epmd.

+
-eval Expr

Scans, parses and evaluates an arbitrary expression -- cgit v1.2.3 From 4a2b7cd9a8cab8e8a6842f7d08ddc36613eba678 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 25 May 2016 17:05:49 +0200 Subject: Minor doc fix --- erts/doc/src/erl_nif.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 33a4fee182..57e047af08 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -295,14 +295,14 @@ ok

Time Measurement -

Support for time measurement in NIF libraries: +

Support for time measurement in NIF libraries:

ErlNifTime ErlNifTimeUnit enif_monotonic_time() enif_time_offset() enif_convert_time_unit() -

+
Long-running NIFs -- cgit v1.2.3 From e020f75c10410a6943cd055bfa072a2641eab7da Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 2 Jun 2016 10:55:26 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 693 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 693 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 7501ccd9ce..2b2898f0c1 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,699 @@

This document describes the changes made to the ERTS application.

+
Erts 8.0 + +
Fixed Bugs and Malfunctions + + +

The handling of on_load functions has been + improved. The major improvement is that if a code upgrade + fails because the on_load function fails, the + previous version of the module will now be retained.

+

+ Own Id: OTP-12593

+
+ +

is_builtin(erlang, apply, 3) will now return + true.

+

+ Own Id: OTP-13034

+
+ +

+ Fix enif_get_list_length to return false if list + is improper or have length larger than UINT_MAX + (did return true and an incorrect length value).

+

+ Own Id: OTP-13288 Aux Id: PR913

+
+ +

+ Cleanup hipe signal handling code for x86 and make it + more portable.

+

+ Own Id: OTP-13341 Aux Id: PR951

+
+ +

+ Use fsync instead of fdatasync on Mac OSX.

+

+ Own Id: OTP-13411

+
+ +

+ Make sure to create a crash dump when running out of + memory. This was accidentally removed in the erts-7.3 + release.

+

+ Own Id: OTP-13419

+
+ +

+ A bug has been fixed where if erlang was started +B on a + unix platform it would be killed by a SIGUSR2 signal when + creating a crash dump.

+

+ Own Id: OTP-13425

+
+ +

+ Fix race between process_flag(trap_exit,true) and + a received exit signal.

+

+ A process could terminate due to exit signal even though + process_flag(trap_exit,true) had returned. A very + specific timing between call to process_flag/2 and + exit signal from another scheduler was required for this + to happen.

+

+ Own Id: OTP-13452

+
+ +

Don't search for non-existing Map keys twice

+

For maps:get/2,3 and maps:find/2, + searching for an immediate key, e.g. an atom, in a small + map, the search was performed twice if the key did not + exist.

+

+ Own Id: OTP-13459

+
+ +

+ When a abnormally large distribution message is about to + be sent, the VM has been changed to create a crash dump + instead of a core dump.

+

+ Own Id: OTP-13474

+
+ +

+ Fix erlang:process_info/2 type specification

+

+ Own Id: OTP-13485 Aux Id: ERL-123

+
+ +

+ Fix bug in open_port/2 with option {args, + List}. A vm crash could be caused by an improper + List.

+

+ Own Id: OTP-13489 Aux Id: ERL-127

+
+ +

+ Don't crash on terminating processes with + erlang:system_profile/1,2

+

+ Own Id: OTP-13494 Aux Id: ERL-126

+
+ +

+ Fixed bugs where the reduction counter was not handled + correct.

+

+ Own Id: OTP-13512

+
+ +

+ Fixed typo in description of the EPMD_DUMP_REQ + response.

+

+ Own Id: OTP-13517

+
+ +

+ Fixed a bug where a process flagged as sensitive would + sometimes record its save_calls when it shouldn't.

+

+ Own Id: OTP-13540

+
+ +

+ Update configure scripts to not use hardcoded path for + /bin/pwd and /bin/rm.

+

+ Own Id: OTP-13562

+
+ +

+ When passing a larger binary than the outputv callback of + a linked-in driver can handle in one io vector slot, the + binary is now split into multiple slots in the io vector. + This change only effects system where the max size of an + io vector slot is smaller then the word size of the + system (e.g. Windows).

+

+ This change means that it is now possible on Windows to + send binaries that are larger than 4GB to port_comnmand, + which is what is used for file:write, gen_tcp:send etc.

+

+ Own Id: OTP-13628

+
+
+
+ + +
Improvements and New Features + + +

+ The tracing support has been extended to allow a tracer module to be the + trace event handler instead of a process or port. The + tracer module + makes it possible for trace tools to filter or manipulate + trace event data without the trace event first haing to + be copied from the traced process or port.

+

+ With the introduction of this feature, + erlang:trace(all|existing, _, _) now also returns + the tracer process as part of the number of processes on + which tracing is enabled. The is incompatible with the + previous releases.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-10267

+
+ +

+ Introduce LTTng tracing of Erlang Runtime System

+

+ For LTTng to be enabled OTP needs to be built with + configure option --with-dynamic-trace=lttng.

+

+ This feature introduces tracepoints for schedulers, + drivers, memory carriers, memory and async thread pool.

+

For a list of all tracepoints, see Runtime Tools User's + Guide .

+

+ Own Id: OTP-10282

+
+ +

+ Add microstate accounting

+

+ Microstate accounting is a way to track which state the + different threads within ERTS are in. The main usage area + is to pin point performance bottlenecks by checking which + states the threads are in and then from there figuring + out why and where to optimize.

+

+ Since checking whether microstate accounting is on or off + is relatively expensive only a few of the states are + enabled by default and more states can be enabled through + configure.

+

+ There is a convinence module called msacc that has been + added to runtime_tools that can assist in gathering and + interpreting the data from Microstate accounting.

+

+ For more information see erlang:statistics(microstate_accounting, + _) and the msacc module in + runtime_tools.

+

+ Own Id: OTP-12345

+
+ +

+ The port of Erlang/OTP to the realtime operating system + OSE has been removed.

+

+ Own Id: OTP-12573

+
+ +

+ Sharing preserved copy for messages and exit signals

+

+ Enable sharing preserved copy with configure option + --enable-sharing-preserving. This will preserve + sharing, within the process, when communication with + other processes in the Erlang node. There is a trade-off, + the copy is more costly but this cost can be reclaimed if + there is a lot of sharing in the message. With this + feature enabled literals will not be copied in a send + except during a purge phase of the module where the + literals are located. This feature is considered + experimental in 19.0.

+

+ Own Id: OTP-12590 Aux Id: OTP-10251

+
+ +

+ Halfword BEAM has been removed.

+

+ Own Id: OTP-12883

+
+ +

+ Added os:perf_counter/1.

+

+ The perf_counter is a very very cheap and high resolution + timer that can be used to timestamp system events. It + does not have monoticity guarantees, but should on most + OS's expose a monotonous time.

+

+ Own Id: OTP-12908

+
+ +

+ Support for a fragmented young heap generation. That is, + the young heap generation can consist of multiple non + continuous memory areas. The main reason for this change + is to avoid extra copying of messages that could not be + allocated directly on the receivers heap.

+

+ Own Id: OTP-13047

+
+ +

+ Erlang linked-in driver can now force the call to + open_port to block until a call to erl_drv_init_ack is + made inside the driver. This is useful when you want to + do some asynchronous initialization, for example getting + configuration from a pipe, and you want the initial + open_port call to fail if the configuration is incomplete + or wrong. See the erl_driver documentation for more + details on the API.

+

+ Own Id: OTP-13086

+
+ +

+ Erlang linked-in drivers can now set their own pid's as + seen in erlang:port_info/1 by using the + erl_drv_set_pid function. For more details see the + erl_driver documentation.

+

+ Own Id: OTP-13087

+
+ +

+ The functionality behind erlang:open_port/2 when + called with spawn or spawn_executable has been redone so + that the forking of the new program is done in a separate + process called erl_child_setup. This allows for a much + more robust implementation that uses less memory and does + not block the entire emulator if the program to be + started is on an un-accessible NFS. Benchmarks have shown + this approach to be about 3-5 times as fast as the old + approach where the fork/vfork was done by erts. This is a + pure stability and performance fix, however some error + messages may have changed, which is why it is marked as a + backwards incompatible change.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13088

+
+ +

Improved yielding strategy in the implementation of + the following native functions:

+ erlang:binary_to_list/1 + erlang:binary_to_list/3 + erlang:bitstring_to_list/1 + erlang:list_to_binary/1 + erlang:iolist_to_binary/1 + erlang:list_to_bitstring/1 + binary:list_to_bin/1

This + in order to improve performance of these functions.

+

+ Own Id: OTP-13096

+
+ +

+ All garbage collections of processes now bump reductions. + Also the amount of reductions bumped when garbage + collecting has been adjusted. It now better corresponds + to the amount of work performed. This in order to improve + the real time characteristics of the system.

+

+ Own Id: OTP-13097

+
+ +

New functions that can load multiple functions at once + have been added to the 'code' module. The + functions are code:atomic_load/1, + code:prepare_loading/1, + code:finish_loading/1, and + code:ensure_modules_loaded/1.

+

+ Own Id: OTP-13111

+
+ +

The -boot_var option for erl now only + supports a single key and single value (as documented). + The option used to allow multiple key/value pairs, but + that behavior was undocumented.

+

The function erl_prim_loader:start/3 has been + removed. Its documentation has also been removed.

+

The undocumented and unsupported function + erl_prim_loader:get_files/2 has been removed.

+

+ Own Id: OTP-13112

+
+ +

+ Low level BIF erlang:purge_module/1 is made more + robust against incorrect use. Lingering processes that + still refer the old code are now killed before the module + is purged to prevent fatal VM behavior.

+

+ Own Id: OTP-13122

+
+ +

+ Improved dirty scheduler implementation. For more + information see the NIF documentation.

+

+ Note that support for determining whether dirty NIF + support exist or not at compile time using the C + preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT + has been removed.

+

+ Own Id: OTP-13123

+
+ +

+ Various optimizations done to process dictionary access.

+

+ Own Id: OTP-13167

+
+ +

+ Added max_heap_size process flag. See erlang:process_flag + for more details.

+

+ Own Id: OTP-13174

+
+ +

+ Allow dynamic drivers and NIF libraries to be built with + gcc option -fvisibility=hidden for faster loading + and more optimized code.

+

+ Own Id: OTP-13227

+
+ +

+ Add erlang:process_info(Pid, + garbage_collection_info) which returns extended + garbage_collection information. For more details see the + documentation.

+

+ Own Id: OTP-13265

+
+ +

+ The functions erlang:list_to_integer/1 and + string:to_integer/1 have been optimized for large + inputs.

+

+ Own Id: OTP-13293

+
+ +

+ Improved memory allocation strategy for hipe native code + on x86_64 (amd64) architectures by reserving enough low + virtual address space needed for the HiPE/AMD64 small + code model. The default virtual address area for hipe + code is set to 512Mb, but can be changed with emulator + flag +MXscs.

+

+ Own Id: OTP-13359

+
+ +

+ Introduction of configurable management of data referred + to by the message queue of a process. Each process can be + configured individually.

+

+ It is now possible to configure the message queue of a + process, so that all data referred by it will be kept + outside of the heap, and by this prevent this data from + being part of garbage collections.

+

+ For more information see the documentation of process_flag(message_queue_data, + MQD).

+

+ Own Id: OTP-13366 Aux Id: OTP-13047

+
+ +

+ Processes now yield when scanning large message queues + and not finding a matching message. This in order to + improve real time characteristics.

+

+ Own Id: OTP-13401

+
+ +

+ Optimized an erts internal function that is used to + traverse erlang terms. The internal function was mainly + used by term_to_binary and comparison of terms. + Benchmarks have shown up to a 10% performance increase in + those functions after the optimization.

+

+ Own Id: OTP-13440

+
+ +

+ Add the following NIF API functions:

+

+ enif_cpu_time + enif_now_time + enif_make_unique_integer + enif_is_process_alive + enif_is_port_alive + enif_term_to_binary + enif_binary_to_term + enif_port_command +

+

+ for details of what each function does, see the erl_nif + documentation.

+

+ Own Id: OTP-13442

+
+ +

+ Optimize '++' operator and lists:append/2 + by using a single pass to build a new list while checking + for properness.

+

+ Own Id: OTP-13487

+
+ +

+ Handle terms (pids,ports and refs) from nodes with a + 'creation' value larger than 3. This is a preparation of + the distribution protocol to allow OTP 19 nodes to + correctly communicate with future nodes (20 or higher). + The 'creation' value differentiates different + incarnations of the same node (name).

+

+ Own Id: OTP-13488

+
+ +

+ Don't send unasked for systemd notifications in epmd

+

+ Own Id: OTP-13493 Aux Id: PR-999

+
+ +

+ The enif_send API has been extended to allow NULL to be + used as the message environment. When used this way, a + message environent is implicitly created and the given + term is copied into that environment before sending. This + can be an optimization if many small messages are being + sent by the nif.

+

+ Own Id: OTP-13495

+
+ +

+ The tracing support has been extended to allow tracing on + ports. Ports can be traced on using the 'ports', 'send' + and 'receive' trace flags.

+

+ The first argument of erlang:trace/3 has + been extended so that 'all', 'existing' and + 'new' now include both processes and ports. New + Tracee variants, 'all_processes', + 'all_ports', 'existing_processes' etc have + been added to specify only processes or ports.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13496

+
+ +

+ When the 'procs' trace flag is enabled, a + 'spawned' trace event is now also generated by a + newly created process. The previous event 'spawn' + remains, but as it is generated by the process that did + the spawn, it is not guaranteed that it is ordered with + other trace events from the newly spawned process. So + when tracking the lifetime of a process this new event + should be used as the creation event.

+

+ This new trace event is marked as an incompatabiliy + because tools that expect certain trace events when + enabling 'procs' will have to updated.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13497

+
+ +

+ Add the erlang:match_spec_test/3 + function. The functions allows the testing of match + specifications for both tracing and ets tables. It can be + used to test that a match specification does the expected + filtering on specific data. It also returns more verbose + error reasons for incorrectly constructed match + specifications.

+

+ Own Id: OTP-13501

+
+ +

+ The erts internal tracing support has been changed to + have much less overhead and be more scalable.

+

+ This rewrite does not break any backwards + incompatabilities, but it does change the ordering of + some trace messages when compared to previous releases. + It should be noted that this only applies to trace + messages sent to processes or ports, it does not apply to + the new tracer module. However in future releases they + may also be effected by this.

+

+ Trace messages are only guaranteed to be ordered from one + traced process or port. In previous releases this was not + visible as a 'send' trace message would always + arrive before the corresponding 'receive' trace + message that is no longer always the case. This also + means that timestamped trace messages may seem to arrive + out of order as the timestamp is taken when the event is + triggered and not when it is put in the queue of the + tracer.

+

+ Own Id: OTP-13503

+
+ +

+ Add possibility to filter send and receive + trace with match specifications.

+

+ Own Id: OTP-13507

+
+ +

+ Add maps:update_with/3,4 and maps:take/2

+

+ Own Id: OTP-13522 Aux Id: PR-1025

+
+ +

+ Introduce LTTng tracing via Erlang tracing.

+

+ For LTTng to be enabled OTP needs to be built with + configure option --with-dynamic-trace=lttng.

+

The dynamic trace module dyntrace is now + capable to be used as a LTTng sink for Erlang tracing. + For a list of all tracepoints, see Runtime Tools User's + Guide .

+

This feature also introduces an incompatible change in + trace tags. The trace tags gc_start and + gc_end has been split into gc_minor_start, + gc_minor_end and gc_major_start, + gc_major_end.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13532

+
+ +

+ Print heap pointers for garbing processes during + crashdump

+

+ Own Id: OTP-13541 Aux Id: PR-1026

+
+ +

+ Changed and improved low level memory statistics returned + by erlang:system_info/1. The info for + erts_mmap has been moved from mseg_alloc to + its own section returned by {allocator, + erts_mmap}.

+

+ Own Id: OTP-13560

+
+ +

+ Add enif_snprintf to the NIF API

+

+ The fucntion enif_snprintf is similar to + snprintf call but can handle formating of Erlang + terms via %T format specifier.

+

+ Own Id: OTP-13580

+
+ +

The warning in the documentation for + erlang:raise/3 has been removed. It is now + officially perfectly fine to use raise/3 in production + code. (Thanks to Per Hedeland.)

+

+ Own Id: OTP-13599

+
+ +

+ Add -start_epmd command line option, this lets you + disable automatic starting of epmd when starting a + distributed node.

+

+ Add -epmd_module command line option, this lets + you specify a module to register and lookup node names + in. The default module is erl_epmd.

+

+ Own Id: OTP-13627

+
+ +

+ erlang:halt now truncates strings longer than 200 + characters instead of failing with badarg.

+

+ Own Id: OTP-13630

+
+
+
+ +
+
Erts 7.3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From c04cad3ba921deb086d19e2de2526af4854add75 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Thu, 2 Jun 2016 11:39:07 +0200 Subject: Revert "Prepare release" This reverts commit e020f75c10410a6943cd055bfa072a2641eab7da. --- erts/doc/src/notes.xml | 693 ------------------------------------------------- 1 file changed, 693 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 2b2898f0c1..7501ccd9ce 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,699 +32,6 @@

This document describes the changes made to the ERTS application.

-
Erts 8.0 - -
Fixed Bugs and Malfunctions - - -

The handling of on_load functions has been - improved. The major improvement is that if a code upgrade - fails because the on_load function fails, the - previous version of the module will now be retained.

-

- Own Id: OTP-12593

-
- -

is_builtin(erlang, apply, 3) will now return - true.

-

- Own Id: OTP-13034

-
- -

- Fix enif_get_list_length to return false if list - is improper or have length larger than UINT_MAX - (did return true and an incorrect length value).

-

- Own Id: OTP-13288 Aux Id: PR913

-
- -

- Cleanup hipe signal handling code for x86 and make it - more portable.

-

- Own Id: OTP-13341 Aux Id: PR951

-
- -

- Use fsync instead of fdatasync on Mac OSX.

-

- Own Id: OTP-13411

-
- -

- Make sure to create a crash dump when running out of - memory. This was accidentally removed in the erts-7.3 - release.

-

- Own Id: OTP-13419

-
- -

- A bug has been fixed where if erlang was started +B on a - unix platform it would be killed by a SIGUSR2 signal when - creating a crash dump.

-

- Own Id: OTP-13425

-
- -

- Fix race between process_flag(trap_exit,true) and - a received exit signal.

-

- A process could terminate due to exit signal even though - process_flag(trap_exit,true) had returned. A very - specific timing between call to process_flag/2 and - exit signal from another scheduler was required for this - to happen.

-

- Own Id: OTP-13452

-
- -

Don't search for non-existing Map keys twice

-

For maps:get/2,3 and maps:find/2, - searching for an immediate key, e.g. an atom, in a small - map, the search was performed twice if the key did not - exist.

-

- Own Id: OTP-13459

-
- -

- When a abnormally large distribution message is about to - be sent, the VM has been changed to create a crash dump - instead of a core dump.

-

- Own Id: OTP-13474

-
- -

- Fix erlang:process_info/2 type specification

-

- Own Id: OTP-13485 Aux Id: ERL-123

-
- -

- Fix bug in open_port/2 with option {args, - List}. A vm crash could be caused by an improper - List.

-

- Own Id: OTP-13489 Aux Id: ERL-127

-
- -

- Don't crash on terminating processes with - erlang:system_profile/1,2

-

- Own Id: OTP-13494 Aux Id: ERL-126

-
- -

- Fixed bugs where the reduction counter was not handled - correct.

-

- Own Id: OTP-13512

-
- -

- Fixed typo in description of the EPMD_DUMP_REQ - response.

-

- Own Id: OTP-13517

-
- -

- Fixed a bug where a process flagged as sensitive would - sometimes record its save_calls when it shouldn't.

-

- Own Id: OTP-13540

-
- -

- Update configure scripts to not use hardcoded path for - /bin/pwd and /bin/rm.

-

- Own Id: OTP-13562

-
- -

- When passing a larger binary than the outputv callback of - a linked-in driver can handle in one io vector slot, the - binary is now split into multiple slots in the io vector. - This change only effects system where the max size of an - io vector slot is smaller then the word size of the - system (e.g. Windows).

-

- This change means that it is now possible on Windows to - send binaries that are larger than 4GB to port_comnmand, - which is what is used for file:write, gen_tcp:send etc.

-

- Own Id: OTP-13628

-
-
-
- - -
Improvements and New Features - - -

- The tracing support has been extended to allow a tracer module to be the - trace event handler instead of a process or port. The - tracer module - makes it possible for trace tools to filter or manipulate - trace event data without the trace event first haing to - be copied from the traced process or port.

-

- With the introduction of this feature, - erlang:trace(all|existing, _, _) now also returns - the tracer process as part of the number of processes on - which tracing is enabled. The is incompatible with the - previous releases.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-10267

-
- -

- Introduce LTTng tracing of Erlang Runtime System

-

- For LTTng to be enabled OTP needs to be built with - configure option --with-dynamic-trace=lttng.

-

- This feature introduces tracepoints for schedulers, - drivers, memory carriers, memory and async thread pool.

-

For a list of all tracepoints, see Runtime Tools User's - Guide .

-

- Own Id: OTP-10282

-
- -

- Add microstate accounting

-

- Microstate accounting is a way to track which state the - different threads within ERTS are in. The main usage area - is to pin point performance bottlenecks by checking which - states the threads are in and then from there figuring - out why and where to optimize.

-

- Since checking whether microstate accounting is on or off - is relatively expensive only a few of the states are - enabled by default and more states can be enabled through - configure.

-

- There is a convinence module called msacc that has been - added to runtime_tools that can assist in gathering and - interpreting the data from Microstate accounting.

-

- For more information see erlang:statistics(microstate_accounting, - _) and the msacc module in - runtime_tools.

-

- Own Id: OTP-12345

-
- -

- The port of Erlang/OTP to the realtime operating system - OSE has been removed.

-

- Own Id: OTP-12573

-
- -

- Sharing preserved copy for messages and exit signals

-

- Enable sharing preserved copy with configure option - --enable-sharing-preserving. This will preserve - sharing, within the process, when communication with - other processes in the Erlang node. There is a trade-off, - the copy is more costly but this cost can be reclaimed if - there is a lot of sharing in the message. With this - feature enabled literals will not be copied in a send - except during a purge phase of the module where the - literals are located. This feature is considered - experimental in 19.0.

-

- Own Id: OTP-12590 Aux Id: OTP-10251

-
- -

- Halfword BEAM has been removed.

-

- Own Id: OTP-12883

-
- -

- Added os:perf_counter/1.

-

- The perf_counter is a very very cheap and high resolution - timer that can be used to timestamp system events. It - does not have monoticity guarantees, but should on most - OS's expose a monotonous time.

-

- Own Id: OTP-12908

-
- -

- Support for a fragmented young heap generation. That is, - the young heap generation can consist of multiple non - continuous memory areas. The main reason for this change - is to avoid extra copying of messages that could not be - allocated directly on the receivers heap.

-

- Own Id: OTP-13047

-
- -

- Erlang linked-in driver can now force the call to - open_port to block until a call to erl_drv_init_ack is - made inside the driver. This is useful when you want to - do some asynchronous initialization, for example getting - configuration from a pipe, and you want the initial - open_port call to fail if the configuration is incomplete - or wrong. See the erl_driver documentation for more - details on the API.

-

- Own Id: OTP-13086

-
- -

- Erlang linked-in drivers can now set their own pid's as - seen in erlang:port_info/1 by using the - erl_drv_set_pid function. For more details see the - erl_driver documentation.

-

- Own Id: OTP-13087

-
- -

- The functionality behind erlang:open_port/2 when - called with spawn or spawn_executable has been redone so - that the forking of the new program is done in a separate - process called erl_child_setup. This allows for a much - more robust implementation that uses less memory and does - not block the entire emulator if the program to be - started is on an un-accessible NFS. Benchmarks have shown - this approach to be about 3-5 times as fast as the old - approach where the fork/vfork was done by erts. This is a - pure stability and performance fix, however some error - messages may have changed, which is why it is marked as a - backwards incompatible change.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13088

-
- -

Improved yielding strategy in the implementation of - the following native functions:

- erlang:binary_to_list/1 - erlang:binary_to_list/3 - erlang:bitstring_to_list/1 - erlang:list_to_binary/1 - erlang:iolist_to_binary/1 - erlang:list_to_bitstring/1 - binary:list_to_bin/1

This - in order to improve performance of these functions.

-

- Own Id: OTP-13096

-
- -

- All garbage collections of processes now bump reductions. - Also the amount of reductions bumped when garbage - collecting has been adjusted. It now better corresponds - to the amount of work performed. This in order to improve - the real time characteristics of the system.

-

- Own Id: OTP-13097

-
- -

New functions that can load multiple functions at once - have been added to the 'code' module. The - functions are code:atomic_load/1, - code:prepare_loading/1, - code:finish_loading/1, and - code:ensure_modules_loaded/1.

-

- Own Id: OTP-13111

-
- -

The -boot_var option for erl now only - supports a single key and single value (as documented). - The option used to allow multiple key/value pairs, but - that behavior was undocumented.

-

The function erl_prim_loader:start/3 has been - removed. Its documentation has also been removed.

-

The undocumented and unsupported function - erl_prim_loader:get_files/2 has been removed.

-

- Own Id: OTP-13112

-
- -

- Low level BIF erlang:purge_module/1 is made more - robust against incorrect use. Lingering processes that - still refer the old code are now killed before the module - is purged to prevent fatal VM behavior.

-

- Own Id: OTP-13122

-
- -

- Improved dirty scheduler implementation. For more - information see the NIF documentation.

-

- Note that support for determining whether dirty NIF - support exist or not at compile time using the C - preprocessor macro ERL_NIF_DIRTY_SCHEDULER_SUPPORT - has been removed.

-

- Own Id: OTP-13123

-
- -

- Various optimizations done to process dictionary access.

-

- Own Id: OTP-13167

-
- -

- Added max_heap_size process flag. See erlang:process_flag - for more details.

-

- Own Id: OTP-13174

-
- -

- Allow dynamic drivers and NIF libraries to be built with - gcc option -fvisibility=hidden for faster loading - and more optimized code.

-

- Own Id: OTP-13227

-
- -

- Add erlang:process_info(Pid, - garbage_collection_info) which returns extended - garbage_collection information. For more details see the - documentation.

-

- Own Id: OTP-13265

-
- -

- The functions erlang:list_to_integer/1 and - string:to_integer/1 have been optimized for large - inputs.

-

- Own Id: OTP-13293

-
- -

- Improved memory allocation strategy for hipe native code - on x86_64 (amd64) architectures by reserving enough low - virtual address space needed for the HiPE/AMD64 small - code model. The default virtual address area for hipe - code is set to 512Mb, but can be changed with emulator - flag +MXscs.

-

- Own Id: OTP-13359

-
- -

- Introduction of configurable management of data referred - to by the message queue of a process. Each process can be - configured individually.

-

- It is now possible to configure the message queue of a - process, so that all data referred by it will be kept - outside of the heap, and by this prevent this data from - being part of garbage collections.

-

- For more information see the documentation of process_flag(message_queue_data, - MQD).

-

- Own Id: OTP-13366 Aux Id: OTP-13047

-
- -

- Processes now yield when scanning large message queues - and not finding a matching message. This in order to - improve real time characteristics.

-

- Own Id: OTP-13401

-
- -

- Optimized an erts internal function that is used to - traverse erlang terms. The internal function was mainly - used by term_to_binary and comparison of terms. - Benchmarks have shown up to a 10% performance increase in - those functions after the optimization.

-

- Own Id: OTP-13440

-
- -

- Add the following NIF API functions:

-

- enif_cpu_time - enif_now_time - enif_make_unique_integer - enif_is_process_alive - enif_is_port_alive - enif_term_to_binary - enif_binary_to_term - enif_port_command -

-

- for details of what each function does, see the erl_nif - documentation.

-

- Own Id: OTP-13442

-
- -

- Optimize '++' operator and lists:append/2 - by using a single pass to build a new list while checking - for properness.

-

- Own Id: OTP-13487

-
- -

- Handle terms (pids,ports and refs) from nodes with a - 'creation' value larger than 3. This is a preparation of - the distribution protocol to allow OTP 19 nodes to - correctly communicate with future nodes (20 or higher). - The 'creation' value differentiates different - incarnations of the same node (name).

-

- Own Id: OTP-13488

-
- -

- Don't send unasked for systemd notifications in epmd

-

- Own Id: OTP-13493 Aux Id: PR-999

-
- -

- The enif_send API has been extended to allow NULL to be - used as the message environment. When used this way, a - message environent is implicitly created and the given - term is copied into that environment before sending. This - can be an optimization if many small messages are being - sent by the nif.

-

- Own Id: OTP-13495

-
- -

- The tracing support has been extended to allow tracing on - ports. Ports can be traced on using the 'ports', 'send' - and 'receive' trace flags.

-

- The first argument of erlang:trace/3 has - been extended so that 'all', 'existing' and - 'new' now include both processes and ports. New - Tracee variants, 'all_processes', - 'all_ports', 'existing_processes' etc have - been added to specify only processes or ports.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13496

-
- -

- When the 'procs' trace flag is enabled, a - 'spawned' trace event is now also generated by a - newly created process. The previous event 'spawn' - remains, but as it is generated by the process that did - the spawn, it is not guaranteed that it is ordered with - other trace events from the newly spawned process. So - when tracking the lifetime of a process this new event - should be used as the creation event.

-

- This new trace event is marked as an incompatabiliy - because tools that expect certain trace events when - enabling 'procs' will have to updated.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13497

-
- -

- Add the erlang:match_spec_test/3 - function. The functions allows the testing of match - specifications for both tracing and ets tables. It can be - used to test that a match specification does the expected - filtering on specific data. It also returns more verbose - error reasons for incorrectly constructed match - specifications.

-

- Own Id: OTP-13501

-
- -

- The erts internal tracing support has been changed to - have much less overhead and be more scalable.

-

- This rewrite does not break any backwards - incompatabilities, but it does change the ordering of - some trace messages when compared to previous releases. - It should be noted that this only applies to trace - messages sent to processes or ports, it does not apply to - the new tracer module. However in future releases they - may also be effected by this.

-

- Trace messages are only guaranteed to be ordered from one - traced process or port. In previous releases this was not - visible as a 'send' trace message would always - arrive before the corresponding 'receive' trace - message that is no longer always the case. This also - means that timestamped trace messages may seem to arrive - out of order as the timestamp is taken when the event is - triggered and not when it is put in the queue of the - tracer.

-

- Own Id: OTP-13503

-
- -

- Add possibility to filter send and receive - trace with match specifications.

-

- Own Id: OTP-13507

-
- -

- Add maps:update_with/3,4 and maps:take/2

-

- Own Id: OTP-13522 Aux Id: PR-1025

-
- -

- Introduce LTTng tracing via Erlang tracing.

-

- For LTTng to be enabled OTP needs to be built with - configure option --with-dynamic-trace=lttng.

-

The dynamic trace module dyntrace is now - capable to be used as a LTTng sink for Erlang tracing. - For a list of all tracepoints, see Runtime Tools User's - Guide .

-

This feature also introduces an incompatible change in - trace tags. The trace tags gc_start and - gc_end has been split into gc_minor_start, - gc_minor_end and gc_major_start, - gc_major_end.

-

- *** POTENTIAL INCOMPATIBILITY ***

-

- Own Id: OTP-13532

-
- -

- Print heap pointers for garbing processes during - crashdump

-

- Own Id: OTP-13541 Aux Id: PR-1026

-
- -

- Changed and improved low level memory statistics returned - by erlang:system_info/1. The info for - erts_mmap has been moved from mseg_alloc to - its own section returned by {allocator, - erts_mmap}.

-

- Own Id: OTP-13560

-
- -

- Add enif_snprintf to the NIF API

-

- The fucntion enif_snprintf is similar to - snprintf call but can handle formating of Erlang - terms via %T format specifier.

-

- Own Id: OTP-13580

-
- -

The warning in the documentation for - erlang:raise/3 has been removed. It is now - officially perfectly fine to use raise/3 in production - code. (Thanks to Per Hedeland.)

-

- Own Id: OTP-13599

-
- -

- Add -start_epmd command line option, this lets you - disable automatic starting of epmd when starting a - distributed node.

-

- Add -epmd_module command line option, this lets - you specify a module to register and lookup node names - in. The default module is erl_epmd.

-

- Own Id: OTP-13627

-
- -

- erlang:halt now truncates strings longer than 200 - characters instead of failing with badarg.

-

- Own Id: OTP-13630

-
-
-
- -
-
Erts 7.3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3 From 77192f7f32d4bbe293a6e8cb9da79b8a6dd6b181 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Wed, 8 Jun 2016 14:58:33 +0200 Subject: Replace enif_is_on_dirty_scheduler() with enif_thread_type() --- erts/doc/src/erl_nif.xml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 4efd155b09..b2e2254a65 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1101,15 +1101,6 @@ typedef enum { Erlang operators =:= and =/=.

- intenif_is_on_dirty_scheduler(ErlNifEnv* env) - Check to see if executing on a dirty scheduler thread - -

Check to see if the current NIF is executing on a dirty scheduler thread. If - executing on a dirty scheduler thread true returned; otherwise false.

-

This function can only be used from a NIF-calling thread, and with an - environment corresponding to currently executing processes.

-
-
intenif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term) Determine if a term is a pid

Return true if term is a pid.

@@ -1820,7 +1811,25 @@ enif_map_iterator_destroy(env, &iter);

Same as erl_drv_thread_self.

- + intenif_thread_type(void) + Determine type of current thread + +

Determine the type of currently executing thread. A positive value + indicates a scheduler thread while a negative value or zero indicates + another type of thread. Currently the following specific types exist + (which may be extended in the future):

+ + ERL_NIF_THR_UNDEFINED +

Undefined thread that is not a scheduler thread.

+ ERL_NIF_THR_NORMAL_SCHEDULER +

A normal scheduler thread.

+ ERL_NIF_THR_DIRTY_CPU_SCHEDULER +

A dirty CPU scheduler thread.

+ ERL_NIF_THR_DIRTY_IO_SCHEDULER +

A dirty I/O scheduler thread.

+
+
+
ErlNifTimeenif_time_offset(ErlNifTimeUnit time_unit) Get current Time Offset -- cgit v1.2.3 From 3b2d98cf1cf8983896293a220275b6ebfa7a609d Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 19 May 2016 09:21:02 +0200 Subject: erts: Correct character repr in doc of the abstract format Barklund's and Virding's spec states that character literals are represented by {integer, Line, L}. The copy-and-paste bug is fixed the description of the abstract format. --- erts/doc/src/absform.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index bfabb7f042..0b04f8f70e 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -152,9 +152,11 @@ If L is an atom literal, then Rep(L) = {atom,LINE,L}. + If L is a character literal, then + Rep(L) = {char,LINE,L}. If L is a float literal, then Rep(L) = {float,LINE,L}. - If L is an integer or character literal, then + If L is an integer literal, then Rep(L) = {integer,LINE,L}. If L is a string literal consisting of the characters C_1, ..., C_k, then -- cgit v1.2.3 From 7bb89126c6e6b25a120e02c1d680093f08e137e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 9 Jun 2016 18:35:54 +0200 Subject: erts: Fix erl_nif.xml xmllint errors --- erts/doc/src/erl_nif.xml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index b2e2254a65..123d353432 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -1812,23 +1812,23 @@ enif_map_iterator_destroy(env, &iter);

intenif_thread_type(void) - Determine type of current thread - -

Determine the type of currently executing thread. A positive value - indicates a scheduler thread while a negative value or zero indicates - another type of thread. Currently the following specific types exist - (which may be extended in the future):

- - ERL_NIF_THR_UNDEFINED -

Undefined thread that is not a scheduler thread.

- ERL_NIF_THR_NORMAL_SCHEDULER -

A normal scheduler thread.

- ERL_NIF_THR_DIRTY_CPU_SCHEDULER -

A dirty CPU scheduler thread.

- ERL_NIF_THR_DIRTY_IO_SCHEDULER -

A dirty I/O scheduler thread.

-
-
+ Determine type of current thread + +

Determine the type of currently executing thread. A positive value + indicates a scheduler thread while a negative value or zero indicates + another type of thread. Currently the following specific types exist + (which may be extended in the future):

+ + ERL_NIF_THR_UNDEFINED +

Undefined thread that is not a scheduler thread.

+ ERL_NIF_THR_NORMAL_SCHEDULER +

A normal scheduler thread.

+ ERL_NIF_THR_DIRTY_CPU_SCHEDULER +

A dirty CPU scheduler thread.

+ ERL_NIF_THR_DIRTY_IO_SCHEDULER +

A dirty I/O scheduler thread.

+
+
ErlNifTimeenif_time_offset(ErlNifTimeUnit time_unit) -- cgit v1.2.3 From 3ee5343415d6ae0ce1ff1c2a2555051431a9315e Mon Sep 17 00:00:00 2001 From: Dmytro Lytovchenko Date: Wed, 25 May 2016 14:37:03 +0200 Subject: erts: Add port monitors * erlang:monitor/2 with port argument is added, erlang:demonitor, using port task API and avoiding locking; * port_info and process_info support for monitored ports (with named port monitors support); * Exit signals contain type 'process' or 'port'; * Propagation of port exit signals; * Self-cleaning when origin process dies with monitor on; * 8 test cases + testcase for port driver crashing; * Documentation for all of the above (monitor, demonitor, port_info and process_info) updated --- erts/doc/src/erlang.xml | 239 ++++++++++++++++++++++++++---------------------- 1 file changed, 132 insertions(+), 107 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index e0c3fed0c2..fa13e4c142 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2916,107 +2916,105 @@ os_prompt% + Starts monitoring. + -

Send a monitor request of type Type to the - entity identified by Item. The caller of - monitor/2 will later be notified by a monitor message on the - following format if the monitored state is changed:

+

Sends a monitor request of type Type to the + entity identified by Item. If the monitored entity + does not exist or when it dies, the caller of monitor/2 will + be notified by a message on the following format:

{Tag, MonitorRef, Type, Object, Info}

The monitor request is an asynchronous signal. That is, it takes time before the signal reaches its destination.

-

Valid Types:

- - process - -

Monitor the existence of the process identified by - Item. Valid - Items in combination with the - process Type can be any of the following:

- - pid() - -

The process identifier of the process to monitor.

-
- {RegisteredName, Node} - -

A tuple consisting of a registered name of a process and - a node name. The process residing on the node Node - with the registered name {RegisteredName, Node} will - be monitored.

-
- RegisteredName - -

The process locally registered as RegisteredName - will become monitored.

-
-
-

When a registered name is used, the - process that has the registered name when the - monitor request reach its destination will be monitored. - The monitor is not effected if the registered name is - unregistered, or unregistered and later registered on another - process.

-

The monitor is triggered either when the monitored process - terminates, is non existing, or if the connection to it is - lost. In the case the connection to it is lost, we do not know - if it still exist or not. After this type of monitor has been - triggered, the monitor is automatically removed.

-

When the monitor is triggered a 'DOWN' message is - sent to the monitoring process. A 'DOWN' message has - the following pattern:

- {'DOWN', MonitorRef, Type, Object, Info} -

Here MonitorRef and Type are the same as - described earlier, and:

- - Object - -

equals:

- - Item - If Item is specified by a - process identifier. - {RegisteredName, Node} - If Item is specified as - RegisteredName, or {RegisteredName, Node} - where Node corresponds to the node that the - monitored process resides on. - -
- Info - -

Either the exit reason of the process, noproc - (non-existing process), or noconnection (no - connection to the node where the monitored process - resides).

-
-

The monitoring is turned off when the 'DOWN' - message is sent or when - demonitor/1 - is called.

-

If an attempt is made to monitor a process on an older node - (where remote process monitoring is not implemented or - where remote process monitoring by registered name is not - implemented), the call fails with badarg.

- -

The format of the 'DOWN' message changed in ERTS - version 5.2 (OTP R9B) for monitoring - by registered name. Element Object of - the 'DOWN' message could in earlier versions - sometimes be the process identifier of the monitored process and sometimes - be the registered name. Now element Object is - always a tuple consisting of the registered name and - the node name. Processes on new nodes (ERTS version 5.2 - or higher) always get 'DOWN' messages on - the new format even if they are monitoring processes on old - nodes. Processes on old nodes always get 'DOWN' - messages on the old format.

-
-
- time_offset + +

Type can be one of the following atoms: + process, port or time_offset.

+ +

A monitor is triggered only once, after that it is removed from + both monitoring process and the monitored entity. + Monitors are fired when the monitored process or port terminates, + does not exist at the moment of creation, or if the connection to + it is lost. In the case with connection, we lose knowledge about + the fact if it still exists or not. The monitoring is also turned off + when demonitor/1 + is called.

+ +

When monitoring by name please note, that the RegisteredName + is resolved to pid() or port() only once + at the moment of monitor instantiation, later changes to the name + registration will not affect the existing monitor.

+ +

When a monitor is triggered, a 'DOWN' message that has the + following pattern {'DOWN', MonitorRef, Type, Object, Info} + is sent to the monitoring process.

+ +

In monitor message MonitorRef and Type are the same as + described earlier, and:

+ + Object + +

The monitored entity, which triggered the event. When monitoring + a local process or port, Object will be equal to the + pid() or port() that was being monitored. When + monitoring process or port by name, Object will have format + {RegisteredName, Node} where RegisteredName is the + name which has been used with monitor/2 call and + Node is local or remote node name (for ports monitored by + name, Node is always local node name).

+
+ Info + +

Either the exit reason of the process, noproc + (process or port did not exist at the time of monitor creation), + or noconnection (no connection to the node where the + monitored process resides).

+
+ +

If an attempt is made to monitor a process on an older node + (where remote process monitoring is not implemented or + where remote process monitoring by registered name is not + implemented), the call fails with badarg.

+ +

The format of the 'DOWN' message changed in ERTS + version 5.2 (OTP R9B) for monitoring + by registered name. Element Object of + the 'DOWN' message could in earlier versions + sometimes be the process identifier of the monitored process and sometimes + be the registered name. Now element Object is + always a tuple consisting of the registered name and + the node name. Processes on new nodes (ERTS version 5.2 + or higher) always get 'DOWN' messages on + the new format even if they are monitoring processes on old + nodes. Processes on old nodes always get 'DOWN' + messages on the old format.

+
+ + + Monitoring a process + +

Creates monitor between the current process and another + process identified by Item, which can be a + pid() (local or remote), an atom RegisteredName or + a tuple {RegisteredName, Node} for a registered process, + located elsewhere.

+
+ + Monitoring a port + +

Creates monitor between the current process and a port + identified by Item, which can be a + port() (only local), an atom RegisteredName or + a tuple {RegisteredName, Node} for a registered port, + located on this node. Note, that attempt to monitor a remote port + will result in badarg.

+
+ + Monitoring a + time_offset

Monitor changes in time offset @@ -3072,15 +3070,17 @@ os_prompt% Note that you can observe the change of the time offset when calling erlang:time_offset() before you get the 'CHANGE' message.

-
+

Making several calls to monitor/2 for the same - Item and/or Type is not - an error; it results in as many independent monitoring instances.

+ Item and/or Type is not + an error; it results in as many independent monitoring instances.

+

The monitor functionality is expected to be extended. That is, - other Types and Items - are expected to be supported in a future release.

+ other Types and Items + are expected to be supported in a future release.

+

If or when monitor/2 is extended, other possible values for Tag, Object and @@ -4150,6 +4150,22 @@ os_prompt% + Which processes are monitoring this port. + +

Returns list of pids that are monitoring given port at the + moment.

+

If the port identified by Port is not open, + undefined is returned. If the port is closed and the + calling process was previously linked to the port, the exit + signal from the port is guaranteed to be delivered before + port_info/2 returns undefined.

+

Failure: badarg if Port is not a local + port identifier, or an atom.

+
+
+ + + Information about the name of a port.

Name is the command name set by @@ -4165,7 +4181,7 @@ os_prompt% - + Information about the OS pid of a port.

OsPid is the process identifier (or equivalent) @@ -4184,7 +4200,7 @@ os_prompt% - + Information about the output of a port.

Bytes is the total number of bytes written @@ -4203,7 +4219,7 @@ os_prompt% - + Information about the parallelism hint of a port.

Boolean corresponds to the port parallelism @@ -4214,7 +4230,7 @@ os_prompt% - + Information about the queue size of a port.

Bytes is the total number @@ -4231,7 +4247,7 @@ os_prompt% - + Information about the registered name of a port.

RegisteredName is the registered name of @@ -4865,10 +4881,19 @@ os_prompt%

A list of monitors (started by monitor/2) that are active for the process. For a local process monitor or a remote process monitor by a process - identifier, the list item is {process, Pid}. - For a remote process - monitor by name, the list item is - {process, {RegName, Node}}.

+ identifier, the list consists of:

+ + {process, Pid} + Process is monitored by pid. + {process, {RegName, Node}} + Local or remote process is monitored by name. + {port, PortId} + Local port is monitored by port id. + {port, {RegName, Node}} + Local port is monitored by name. Please note, that + remote port monitors are not supported, so Node will + always be the local node name. + {message_queue_data, MQD} -- cgit v1.2.3 From 7b5ca88b32c22a7f1a3152265d8d73418013b1c0 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 13 May 2016 10:38:20 +0200 Subject: erts: Fix doc xml errors --- erts/doc/src/erl.xml | 11 +- erts/doc/src/erl_driver.xml | 4 +- erts/doc/src/erl_nif.xml | 26 ++--- erts/doc/src/erlang.xml | 242 ++++++++++++++++++++++---------------------- 4 files changed, 143 insertions(+), 140 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 5d5bfb141f..7b90a1ccca 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -643,8 +643,7 @@

Sets the default binary virtual heap size of processes to the size .

- - +

Sets the default maximum heap size of processes to the size . If +hmax is not given, the default is 0 @@ -653,8 +652,7 @@ process_flag(max_heap_size, MaxHeapSize).

- - +

Sets whether to send an error logger message for processes that reach the maximum heap size or not. If +hmaxel is not given, the default is true. @@ -662,8 +660,7 @@ process_flag(max_heap_size, MaxHeapSize).

- - +

Sets whether to kill processes that reach the maximum heap size or not. If +hmaxk is not given, the default is true. For more information, @@ -676,7 +673,7 @@

Sets the initial process dictionary size of processes to the size .

- +hmqd off_heap|on_heap + +hmqd off_heap|on_heap

Sets the default value for the process flag message_queue_data. If +hmqd is not diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 175b7f6bfb..82215ead46 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -348,14 +348,14 @@ all will work as before.

Time Measurement -

Support for time measurement in drivers: +

Support for time measurement in drivers:

ErlDrvTime ErlDrvTimeUnit erl_drv_monotonic_time() erl_drv_time_offset() erl_drv_convert_time_unit() -

+
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 123d353432..8b02b3bae1 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -518,13 +518,15 @@ ok int (*reload)(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info) -

The reload mechanism is deprecated. It was only intended - as a development feature. Do not use it as an upgrade method for - live production systems. It might be removed in future releases. Be sure - to pass reload as NULL to ERL_NIF_INIT - to disable it when not used.

-
-

reload is called when the NIF library is loaded + + +

The reload mechanism is deprecated. It was only intended + as a development feature. Do not use it as an upgrade method for + live production systems. It might be removed in future releases. Be sure + to pass reload as NULL to ERL_NIF_INIT + to disable it when not used.

+ +

reload is called when the NIF library is loaded and there is already a previously loaded library for this module code.

Works the same as load. The only difference is that @@ -583,9 +585,9 @@ ok

typedef struct { - const char* name; - unsigned arity; - ERL_NIF_TERM (*fptr)(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); + const char* name; + unsigned arity; + ERL_NIF_TERM (*fptr)(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); unsigned flags; } ErlNifFunc; @@ -618,8 +620,8 @@ typedef struct {

typedef struct { - unsigned size; - unsigned char* data; + unsigned size; + unsigned char* data; } ErlNifBinary;

ErlNifBinary contains transient information about an diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index fa13e4c142..6289f033b2 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -4361,86 +4361,86 @@ os_prompt% - Sets process flag max_heap_size for the calling process. +

This flag sets the maximum heap size for the calling process. If MaxHeapSize is an integer, the system default values for kill and error_logger are used. - - size - -

- The maximum size in words of the process. If set to zero, the - heap size limit is disabled. Badarg will be thrown if the value is - smaller than - min_heap_size. - The size check is only done when a garbage collection is triggered. -

-

- size is the entire heap of the process when garbage collection - is triggered, this includes all generational heaps, the process stack, - any - messages that are considered to be part of the heap and any - extra memory that the garbage collector needs during collection. -

-

- size is the same as can be retrieved using - - erlang:process_info(Pid, total_heap_size), - or by adding heap_block_size, old_heap_block_size - and mbuf_size from - erlang:process_info(Pid, garbage_collection_info). -

-
- kill - -

- When set to true the runtime system will send an - untrappable exit signal with reason kill to the process - if the maximum heap size is reached. The garbage collection - that triggered the kill will not be completed, instead the - process will exit as soon as is possible. When set to false - no exit signal will be sent to the process, instead it will - continue executing. -

-

- If kill is not defined in the map - the system default will be used. The default system default - is true. It can be changed by either the erl - +hmaxk option, - or - erlang:system_flag(max_heap_size, MaxHeapSize). -

-
- error_logger - -

- When set to true the runtime system will send a - message to the current error_logger - containing details about the process when the maximum - heap size is reached. One error_logger report will - be sent each time the limit is reached. -

-

- If error_logger is not defined in the map the system - default will be used. The default system default is true. - It can be changed by either the erl +hmaxel - option, or - erlang:system_flag(max_heap_size, MaxHeapSize). -

-
+

+ + size + +

+ The maximum size in words of the process. If set to zero, the + heap size limit is disabled. Badarg will be thrown if the value is + smaller than + min_heap_size. + The size check is only done when a garbage collection is triggered. +

+

+ size is the entire heap of the process when garbage collection + is triggered, this includes all generational heaps, the process stack, + any + messages that are considered to be part of the heap and any + extra memory that the garbage collector needs during collection. +

+

+ size is the same as can be retrieved using + + erlang:process_info(Pid, total_heap_size), + or by adding heap_block_size, old_heap_block_size + and mbuf_size from + erlang:process_info(Pid, garbage_collection_info). +

+
+ kill + +

+ When set to true the runtime system will send an + untrappable exit signal with reason kill to the process + if the maximum heap size is reached. The garbage collection + that triggered the kill will not be completed, instead the + process will exit as soon as is possible. When set to false + no exit signal will be sent to the process, instead it will + continue executing. +

- The heap size of a process is quite hard to predict, especially the - amount of memory that is used during the garbage collection. When - contemplating using this option, it is recommended to first run - it in production with kill set to false and inspect - the error_logger reports to see what the normal peak sizes - of the processes in the system is and then tune the value - accordingly. + If kill is not defined in the map + the system default will be used. The default system default + is true. It can be changed by either the erl + +hmaxk option, + or + erlang:system_flag(max_heap_size, MaxHeapSize).

-
+ + error_logger + +

+ When set to true the runtime system will send a + message to the current error_logger + containing details about the process when the maximum + heap size is reached. One error_logger report will + be sent each time the limit is reached. +

+

+ If error_logger is not defined in the map the system + default will be used. The default system default is true. + It can be changed by either the erl +hmaxel + option, or + erlang:system_flag(max_heap_size, MaxHeapSize). +

+
+ +

+ The heap size of a process is quite hard to predict, especially the + amount of memory that is used during the garbage collection. When + contemplating using this option, it is recommended to first run + it in production with kill set to false and inspect + the error_logger reports to see what the normal peak sizes + of the processes in the system is and then tune the value + accordingly.

@@ -4797,8 +4797,10 @@ os_prompt% The content of GCInfo can be changed without prior notice.

- - {garbage_collection_info, GCInfo} + + + {garbage_collection_info, GCInfo} +

GCInfo is a list containing miscellaneous detailed information about garbage collection for this process. @@ -4986,8 +4988,10 @@ os_prompt% total suspend count on Suspendee, only the parts contributed by Pid.

- - {total_heap_size, Size} + + + {total_heap_size, Size} +

Size is the total size, in words, of all heap fragments of the process. This includes the process stack and @@ -6631,8 +6635,8 @@ ok - Sets system flag max_heap_size +

Sets the default maximum heap size settings for processes. @@ -7136,9 +7140,9 @@ ok + Information about the default process heap settings. - Information about the default process heap settings. fullsweep_after @@ -7183,7 +7187,7 @@ ok where MinHeapSize is the current system-wide minimum heap size for spawned processes.

- message_queue_data + message_queue_data

Returns the default value of the message_queue_data process flag which is either off_heap, or on_heap. @@ -7664,7 +7668,7 @@ ok and erlang:system_info(schedulers).

- otp_release + otp_release

Returns a string containing the OTP release number of the @@ -8617,21 +8621,21 @@ timestamp() -> send

Traces sending of messages.

-

Message tags: send and - send_to_non_existing_process.

+

Message tags: send and + send_to_non_existing_process.

'receive'

Traces receiving of messages.

-

Message tags: 'receive'.

+

Message tags: 'receive'.

call

Traces certain function calls. Specify which function calls to trace by calling erlang:trace_pattern/3.

-

Message tags: call and - return_from.

+

Message tags: call and + return_from.

silent @@ -8649,9 +8653,9 @@ timestamp() -> specification function {silent,Bool}, giving a high degree of control of which functions with which arguments that trigger the trace.

-

Message tags: call, - return_from, and - return_to. Or rather, the absence of.

+

Message tags: call, + return_from, and + return_to. Or rather, the absence of.

return_to @@ -8672,43 +8676,43 @@ timestamp() ->

To get trace messages containing return values from functions, use the {return_trace} match specification action instead.

-

Message tags: return_to.

+

Message tags: return_to.

procs

Traces process-related events.

-

Message tags: spawn, - spawned, - exit, - register, - unregister, - link, - unlink, - getting_linked, and - getting_unlinked.

+

Message tags: spawn, + spawned, + exit, + register, + unregister, + link, + unlink, + getting_linked, and + getting_unlinked.

ports

Traces port-related events.

-

Message tags: open, - closed, - register, - unregister, - getting_linked, and - getting_unlinked.

+

Message tags: open, + closed, + register, + unregister, + getting_linked, and + getting_unlinked.

running

Traces scheduling of processes.

-

Message tags: in and - out.

+

Message tags: in and + out.

exiting

Traces scheduling of exiting processes.

-

Message tags: in_exiting, - out_exiting, and - out_exited.

+

Message tags: in_exiting, + out_exiting, and + out_exited.

running_procs @@ -8716,21 +8720,21 @@ timestamp() -> However this option also includes schedule events when the process executes within the context of a port without being scheduled out itself.

-

Message tags: in and - out.

+

Message tags: in and + out.

running_ports

Traces scheduling of ports.

-

Message tags: in and - out.

+

Message tags: in and + out.

garbage_collection

Traces garbage collections of processes.

-

Message tags: gc_minor_start, - gc_max_heap_size and - gc_minor_end.

+

Message tags: gc_minor_start, + gc_max_heap_size and + gc_minor_end.

timestamp @@ -8758,7 +8762,7 @@ timestamp() -> 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(nano_seconds). + erlang:monotonic_time(nano_seconds). This flag overrides the cpu_timestamp flag.

strict_monotonic_timestamp @@ -8768,8 +8772,8 @@ timestamp() -> 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(nano_seconds), - erlang:unique_integer([monotonic])}. + {erlang:monotonic_time(nano_seconds), + erlang:unique_integer([monotonic])}. This flag overrides the cpu_timestamp flag.

arity -- cgit v1.2.3 From 615b79a01706033e1ef0d78f020ebbb47fc80b86 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Thu, 16 Jun 2016 17:33:28 +0200 Subject: Add documentation about dirty job type --- erts/doc/src/erl.xml | 19 ++++++++++++++++++- erts/doc/src/erl_nif.xml | 20 +++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 7b90a1ccca..436c2c57e1 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -915,6 +915,13 @@ number of dirty CPU schedulers online can be changed at run time via erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline).

+

+ The amount of dirty CPU schedulers is limited by the amount of + normal schedulers in order to limit the effect on processes + executing on ordinary schedulers. If the amount of dirty CPU + schedulers was allowed to be unlimited, dirty CPU bound jobs would + potentially starve normal jobs. +

This option is ignored if the emulator doesn't have threading support enabled. Currently, this option is experimental and is supported only if the emulator was configured and built with support for dirty schedulers @@ -944,7 +951,7 @@ enabled (it's disabled by default).

- +

Sets the number of dirty I/O scheduler threads to create when threading support has been enabled. The valid range is 0-1024. By default, the number @@ -952,6 +959,16 @@ threads in the async thread pool .

+

+ The amount of dirty IO schedulers is not limited by the amount of + normal schedulers like the amount of + dirty CPU schedulers. This since only I/O bound work is + expected to execute on dirty I/O schedulers. I/O bound jobs are + expected to either block waiting for I/O, and/or spend a limited + amount of time moving data. However, if the user should schedule CPU + bound jobs on dirty I/O schedulers, these jobs might starve ordinary + jobs executing on ordinary schedulers. +

This option is ignored if the emulator doesn't have threading support enabled. Currently, this option is experimental and is supported only if the emulator was configured and built with support for dirty schedulers diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index 8b02b3bae1..c9b2092c17 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -442,6 +442,24 @@ ok dirty NIF has completed.

+

+ It is important to classify the dirty job correct. An I/O bound + job should be classified as such and execute on a dirty I/O + scheduler, and a CPU bound job should be classified as such and + execute on a dirty CPU scheduler. If you classify CPU bound jobs + as I/O bound jobs, dirty I/O schedulers might starve ordinary + schedulers. For more information see the documentation + of the erl command line arguments + +SDcpu, and + +SDio as well + as enif_schedule_nif, + and ErlNifFunc. + A job that alternates between I/O bound and CPU bound can + be reclassified and rescheduled using enif_schedule_nif + so that it exectutes on the correct type of dirty scheduler + at all times. +

+

Currently known issues that are planned to be fixed:

@@ -1702,7 +1720,7 @@ enif_map_iterator_destroy(env, &iter); be converted to an atom, enif_schedule_nif returns a badarg exception.

The flags argument must be set to 0 for a regular NIF, or if the emulator was built the experimental dirty scheduler support enabled, flags can be set to either ERL_NIF_DIRTY_JOB_CPU_BOUND - if the job is expected to be primarily CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will + if the job is expected to be CPU-bound, or ERL_NIF_DIRTY_JOB_IO_BOUND for jobs that will be I/O-bound. If dirty scheduler threads are not available in the emulator, a try to schedule such a job will result in a badarg exception.

-- cgit v1.2.3 From 0cf97f4d5c6a3c30dd7d8e200188001442b3822c Mon Sep 17 00:00:00 2001 From: Zandra Hird Date: Thu, 16 Jun 2016 14:59:31 +0200 Subject: Remove unused Cookie from ControlMessage in the dist protocol doc The Cookie was removed a long time ago, but the documentation was not updated accordingly. --- erts/doc/src/erl_dist_protocol.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl_dist_protocol.xml b/erts/doc/src/erl_dist_protocol.xml index f9fa981d9a..25f601a235 100644 --- a/erts/doc/src/erl_dist_protocol.xml +++ b/erts/doc/src/erl_dist_protocol.xml @@ -930,11 +930,14 @@ DiB == gen_digest(ChA,ICA) ? SEND

- {2, Cookie, ToPid} + {2, Unused, ToPid}

Note followed by Message

+

+ Unused is kept for backward compatibility +

EXIT @@ -961,11 +964,14 @@ DiB == gen_digest(ChA,ICA) ? REG_SEND

- {6, FromPid, Cookie, ToName} + {6, FromPid, Unused, ToName}

Note followed by Message

+

+ Unused is kept for backward compatibility +

GROUP_LEADER @@ -991,11 +997,14 @@ DiB == gen_digest(ChA,ICA) ? SEND_TT

- {12, Cookie, ToPid, TraceToken} + {12, Unused, ToPid, TraceToken}

Note followed by Message

+

+ Unused is kept for backward compatibility +

EXIT_TT @@ -1008,11 +1017,14 @@ DiB == gen_digest(ChA,ICA) ? REG_SEND_TT

- {16, FromPid, Cookie, ToName, TraceToken} + {16, FromPid, Unused, ToName, TraceToken}

Note followed by Message

+

+ Unused is kept for backward compatibility +

EXIT2_TT -- cgit v1.2.3 From c9ad0c9fed1d33891f5fa8a4c4511de48417ec10 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Fri, 17 Jun 2016 11:53:29 +0200 Subject: Minor reorganization of dirty NIF documentation --- erts/doc/src/erl.xml | 4 +--- erts/doc/src/erl_nif.xml | 55 +++++++++++++++++++++++++----------------------- 2 files changed, 30 insertions(+), 29 deletions(-) (limited to 'erts/doc') diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 436c2c57e1..37387f2c59 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -963,9 +963,7 @@ The amount of dirty IO schedulers is not limited by the amount of normal schedulers like the amount of dirty CPU schedulers. This since only I/O bound work is - expected to execute on dirty I/O schedulers. I/O bound jobs are - expected to either block waiting for I/O, and/or spend a limited - amount of time moving data. However, if the user should schedule CPU + expected to execute on dirty I/O schedulers. If the user should schedule CPU bound jobs on dirty I/O schedulers, these jobs might starve ordinary jobs executing on ordinary schedulers.

diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml index c9b2092c17..f3921f1922 100644 --- a/erts/doc/src/erl_nif.xml +++ b/erts/doc/src/erl_nif.xml @@ -385,18 +385,39 @@ ok

A NIF that cannot be split and cannot execute in a millisecond or less is called a "dirty NIF" because it performs work that the - Erlang runtime cannot handle cleanly. Applications that make use - of such functions must indicate to the runtime that the functions - are dirty so they can be handled specially. To schedule a dirty - NIF for execution, the appropriate flags value can be set for the - NIF in its ErlNifFunc + ordinary schedulers of the Erlang runtime system cannot handle cleanly. + Applications that make use of such functions must indicate to the + runtime that the functions are dirty so they can be handled + specially. This is handled by executing dirty jobs on a separate + set of schedulers called dirty schedulers. A dirty NIF executing + on a dirty scheduler does not have the same duration restriction + as a normal NIF. +

+ +

+ It is important to classify the dirty job correct. An I/O bound + job should be classified as such, and a CPU bound job should be + classified as such. If you should classify CPU bound jobs + as I/O bound jobs, dirty I/O schedulers might starve ordinary + schedulers. I/O bound jobs are expected to either block waiting + for I/O, and/or spend a limited amount of time moving data. +

+ +

+ To schedule a dirty NIF for execution, the appropriate + flags value can be set for the NIF in its + ErlNifFunc entry, or the application can call enif_schedule_nif, passing to it a pointer to the dirty NIF to be executed and indicating with the flags argument whether it expects the - operation to be CPU-bound or I/O-bound. A dirty NIF executing - on a dirty scheduler does not have the same duration restriction - as a normal NIF. + operation to be CPU-bound or I/O-bound. A job that alternates + between I/O bound and CPU bound can be reclassified and + rescheduled using enif_schedule_nif so that it executes on + the correct type of dirty scheduler at all times. For more + information see the documentation of the erl command line + arguments +SDcpu, + and +SDio.

@@ -442,24 +463,6 @@ ok dirty NIF has completed.

-

- It is important to classify the dirty job correct. An I/O bound - job should be classified as such and execute on a dirty I/O - scheduler, and a CPU bound job should be classified as such and - execute on a dirty CPU scheduler. If you classify CPU bound jobs - as I/O bound jobs, dirty I/O schedulers might starve ordinary - schedulers. For more information see the documentation - of the erl command line arguments - +SDcpu, and - +SDio as well - as enif_schedule_nif, - and ErlNifFunc. - A job that alternates between I/O bound and CPU bound can - be reclassified and rescheduled using enif_schedule_nif - so that it exectutes on the correct type of dirty scheduler - at all times. -

-

Currently known issues that are planned to be fixed:

-- cgit v1.2.3 From 6e51c6d19612d03abc81b86bb70b8d7da678ce5d Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 21 Jun 2016 15:12:41 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 736 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 736 insertions(+) (limited to 'erts/doc') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 7501ccd9ce..3c3129d543 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -32,6 +32,742 @@

This document describes the changes made to the ERTS application.

+
Erts 8.0 + +
Fixed Bugs and Malfunctions + + +

The handling of on_load functions has been + improved. The major improvement is that if a code upgrade + fails because the on_load function fails, the + previous version of the module will now be retained.

+

+ Own Id: OTP-12593

+
+ +

is_builtin(erlang, apply, 3) will now return + true.

+

+ Own Id: OTP-13034

+
+ +

+ Fix enif_get_list_length to return false if list + is improper or have length larger than UINT_MAX + (did return true and an incorrect length value).

+

+ Own Id: OTP-13288 Aux Id: PR913

+
+ +

+ Cleanup hipe signal handling code for x86 and make it + more portable.

+

+ Own Id: OTP-13341 Aux Id: PR951

+
+ +

+ Make file:datasync use fsync instead of fdatasync on Mac + OSX.

+

+ Own Id: OTP-13411

+
+ +

+ Make sure to create a crash dump when running out of + memory. This was accidentally removed in the erts-7.3 + release.

+

+ Own Id: OTP-13419

+
+ +

+ A bug has been fixed where if erlang was started +B on a + unix platform it would be killed by a SIGUSR2 signal when + creating a crash dump.

+

+ Own Id: OTP-13425

+
+ +

+ Fix race between process_flag(trap_exit,true) and + a received exit signal.

+

+ A process could terminate due to exit signal even though + process_flag(trap_exit,true) had returned. A very + specific timing between call to process_flag/2 and + exit signal from another scheduler was required for this + to happen.

+

+ Own Id: OTP-13452

+
+ +

Don't search for non-existing Map keys twice

+

For maps:get/2,3 and maps:find/2, + searching for an immediate key, e.g. an atom, in a small + map, the search was performed twice if the key did not + exist.

+

+ Own Id: OTP-13459

+
+ +

+ When an abnormally large distribution message is about to + be sent, the VM has been changed to create a crash dump + instead of a core dump.

+

+ Own Id: OTP-13474

+
+ +

+ Fix erlang:process_info/2 type specification

+

+ Own Id: OTP-13485 Aux Id: ERL-123

+
+ +

+ Fix bug in open_port/2 with option {args, + List}. A vm crash could be caused by an improper + List.

+

+ Own Id: OTP-13489 Aux Id: ERL-127

+
+ +

+ Fixed a race-condition bug where the emulator could crash + when erlang:system_profile/1,2 was enabled and a + process had to be re-scheduled during termination.

+

+ Own Id: OTP-13494 Aux Id: ERL-126

+
+ +

+ Fixed bugs where the reduction counter was not handled + correct.

+

+ Own Id: OTP-13512

+
+ +

+ Fixed typo in description of the EPMD_DUMP_REQ + response.

+

+ Own Id: OTP-13517

+
+ +

+ Fixed a bug where a process flagged as sensitive would + sometimes record its save_calls when it shouldn't.

+

+ Own Id: OTP-13540

+
+ +

+ Update configure scripts to not use hard-coded path for + /bin/pwd and /bin/rm.

+

+ Own Id: OTP-13562

+
+ +

+ When passing a larger binary than the outputv callback of + a linked-in driver can handle in one io vector slot, the + binary is now split into multiple slots in the io vector. + This change only effects system where the max size of an + io vector slot is smaller then the word size of the + system (e.g. Windows).

+

+ This change means that it is now possible on Windows to + send binaries that are larger than 4GB to port_command, + which is what is used for file:write, gen_tcp:send etc.

+

+ Own Id: OTP-13628

+
+ +

+ Workaround of Maps output in crashdumps. Currently the + atom 'undefined' is generated instead of Map data if a + Map type is encountered during crash.

+

+ Own Id: OTP-13657

+
+
+
+ + +
Improvements and New Features + + +

+ The tracing support has been extended to allow a tracer module to be the + trace event handler instead of a process or port. The + tracer module + makes it possible for trace tools to filter or manipulate + trace event data without the trace event first having to + be copied from the traced process or port.

+

+ With the introduction of this feature, + erlang:trace(all|existing, _, _) now also returns + the tracer process as part of the number of processes on + which tracing is enabled. The is incompatible with the + previous releases.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-10267

+
+ +

+ Introduce LTTng tracing of Erlang Runtime System

+

+ For LTTng to be enabled OTP needs to be built with + configure option --with-dynamic-trace=lttng.

+

+ This feature introduces tracepoints for schedulers, + drivers, memory carriers, memory and async thread pool.

+

For a list of all tracepoints, see Runtime Tools User's + Guide .

+

+ Own Id: OTP-10282

+
+ +

+ Make it possible to monitor/demonitor ports using the + erlang:monitor/2 API. + The process and port information functions have also been + updated to include information about monitors from + processes to ports.

+

+ Own Id: OTP-11384

+
+ +

+ Add microstate accounting

+

+ Microstate accounting is a way to track which state the + different threads within ERTS are in. The main usage area + is to pin point performance bottlenecks by checking which + states the threads are in and then from there figuring + out why and where to optimize.

+

+ Since checking whether microstate accounting is on or off + is relatively expensive only a few of the states are + enabled by default and more states can be enabled through + configure.

+

+ There is a convenience module called msacc that has been + added to runtime_tools that can assist in gathering and + interpreting the data from Microstate accounting.

+

+ For more information see erlang:statistics(microstate_accounting, + _) and the msacc module in + runtime_tools.

+

+ Own Id: OTP-12345

+
+ +

+ The port of Erlang/OTP to the real-time operating system + OSE has been removed.

+

+ Own Id: OTP-12573

+
+ +

+ Sharing preserved copy for messages and exit signals

+

+ Enable sharing preserved copy with configure option + --enable-sharing-preserving. This will preserve + sharing, within the process, when communication with + other processes in the Erlang node. There is a trade-off, + the copy is more costly but this cost can be reclaimed if + there is a lot of sharing in the message. In addition + literals will not be copied in a send except during a + purge phase of the module where the literals are located. + This feature is considered experimental in 19.0.

+

+ Own Id: OTP-12590 Aux Id: OTP-10251

+
+ +

+ Halfword BEAM has been removed.

+

+ Own Id: OTP-12883

+
+ +

+ Added os:perf_counter/1.

+

+ The perf_counter is a very very cheap and high resolution + timer that can be used to timestamp system events. It + does not have monoticity guarantees, but should on most + OS's expose a monotonous time.

+

+ Own Id: OTP-12908

+
+ +

+ Support for a fragmented young heap generation. That is, + the young heap generation can consist of multiple non + continuous memory areas. The main reason for this change + is to avoid extra copying of messages that could not be + allocated directly on the receivers heap.

+

+ Own Id: OTP-13047

+
+ +

+ Erlang linked-in driver can now force the call to + open_port to block until a call to erl_drv_init_ack is + made inside the driver. This is useful when you want to + do some asynchronous initialization, for example getting + configuration from a pipe, and you want the initial + open_port call to fail if the configuration is incomplete + or wrong. See the erl_driver documentation for more + details on the API.

+

+ Own Id: OTP-13086

+
+ +

+ Erlang linked-in drivers can now set their own pids as + seen in erlang:port_info/1 by using the + erl_drv_set_pid function. For more details see the + erl_driver documentation.

+

+ Own Id: OTP-13087

+
+ +

+ The functionality behind erlang:open_port/2 when + called with spawn or spawn_executable has been redone so + that the forking of the new program is done in a separate + process called erl_child_setup. This allows for a much + more robust implementation that uses less memory and does + not block the entire emulator if the program to be + started is on an un-accessible NFS. Benchmarks have shown + this approach to be about 3-5 times as fast as the old + approach where the fork/vfork was done by erts. This is a + pure stability and performance fix, however some error + messages may have changed, which is why it is marked as a + backwards incompatible change.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13088

+
+ +

Improved yielding strategy in the implementation of + the following native functions:

+ erlang:binary_to_list/1 + erlang:binary_to_list/3 + erlang:bitstring_to_list/1 + erlang:list_to_binary/1 + erlang:iolist_to_binary/1 + erlang:list_to_bitstring/1 + binary:list_to_bin/1

This + in order to improve performance of these functions.

+

+ Own Id: OTP-13096

+
+ +

+ All garbage collections of processes now bump reductions. + Also the amount of reductions bumped when garbage + collecting has been adjusted. It now better corresponds + to the amount of work performed. This in order to improve + the real time characteristics of the system.

+

+ Own Id: OTP-13097

+
+ +

New functions that can load multiple modules at once + have been added to the 'code' module. The + functions are code:atomic_load/1, + code:prepare_loading/1, + code:finish_loading/1, and + code:ensure_modules_loaded/1.

+

+ Own Id: OTP-13111

+
+ +

The -boot_var option for erl now only + supports a single key and single value (as documented). + The option used to allow multiple key/value pairs, but + that behavior was undocumented.

+

The function erl_prim_loader:start/3 has been + removed. Its documentation has also been removed.

+

The undocumented and unsupported function + erl_prim_loader:get_files/2 has been removed.

+

+ Own Id: OTP-13112

+
+ +

+ Low level BIF erlang:purge_module/1 is made more + robust against incorrect use. Lingering processes that + still refer the old code are now killed before the module + is purged to prevent fatal VM behavior.

+

+ Own Id: OTP-13122

+
+ +

Improved dirty scheduler implementation. For more + information see the NIF + documentation.

The + dirty scheduler support is still + experimental.

The support + for determining whether dirty NIF support exist or not at + compile time using the C preprocessor macro + ERL_NIF_DIRTY_SCHEDULER_SUPPORT has been + removed.

The + enif_is_on_dirty_scheduler() function has been + removed. Use enif_thread_type() + instead.

+

+ Own Id: OTP-13123

+
+ +

+ Various optimizations done to process dictionary access.

+

+ Own Id: OTP-13167

+
+ +

+ Added max_heap_size process flag. max_heap_size allows + the user to limit the maximum heap used by a process. See + erlang:process_flag + for more details.

+

+ Own Id: OTP-13174

+
+ +

+ Allow dynamic drivers and NIF libraries to be built with + gcc option -fvisibility=hidden for faster loading + and more optimized code.

+

+ Own Id: OTP-13227

+
+ +

+ Add erlang:process_info(Pid, + garbage_collection_info) which returns extended + garbage_collection information. For more details see the + documentation.

+

+ Own Id: OTP-13265

+
+ +

+ The functions erlang:list_to_integer/1 and + string:to_integer/1 have been optimized for large + inputs.

+

+ Own Id: OTP-13293

+
+ +

+ Improved memory allocation strategy for hipe native code + on x86_64 (amd64) architectures by reserving enough low + virtual address space needed for the HiPE/AMD64 small + code model. The default virtual address area for hipe + code is set to 512Mb, but can be changed with emulator + flag +MXscs.

+

+ Own Id: OTP-13359

+
+ +

+ Introduction of configurable management of data referred + to by the message queue of a process. Each process can be + configured individually.

+

+ It is now possible to configure the message queue of a + process, so that all data referred by it will be kept + outside of the heap, and by this prevent this data from + being part of garbage collections.

+

+ For more information see the documentation of process_flag(message_queue_data, + MQD).

+

+ Own Id: OTP-13366 Aux Id: OTP-13047

+
+ +

+ Processes now yield when scanning large message queues + and not finding a matching message. This in order to + improve real time characteristics.

+

+ Own Id: OTP-13401

+
+ +

+ Optimized an erts internal function that is used to + traverse erlang terms. The internal function was mainly + used by term_to_binary and comparison of terms. + Benchmarks have shown up to a 10% performance increase in + those functions after the optimization.

+

+ Own Id: OTP-13440

+
+ +

+ Add the following NIF API functions:

+

+ enif_cpu_time + enif_now_time + enif_make_unique_integer + enif_is_process_alive + enif_is_port_alive + enif_term_to_binary + enif_binary_to_term + enif_port_command +

+

+ for details of what each function does, see the erl_nif + documentation.

+

+ Own Id: OTP-13442

+
+ +

+ Optimize '++' operator and lists:append/2 + by using a single pass to build a new list while checking + for properness.

+

+ Own Id: OTP-13487

+
+ +

+ Handle terms (pids,ports and refs) from nodes with a + 'creation' value larger than 3. This is a preparation of + the distribution protocol to allow OTP 19 nodes to + correctly communicate with future nodes (20 or higher). + The 'creation' value differentiates different + incarnations of the same node (name).

+

+ Own Id: OTP-13488

+
+ +

+ Don't send unasked for systemd notifications in epmd

+

+ Own Id: OTP-13493 Aux Id: PR-999

+
+ +

+ The enif_send API has been extended to allow NULL to be + used as the message environment. When used this way, a + message environment is implicitly created and the given + term is copied into that environment before sending. This + can be an optimization if many small messages are being + sent by the nif.

+

+ Own Id: OTP-13495

+
+ +

+ The tracing support has been extended to allow tracing on + ports. Ports can be traced on using the 'ports', 'send' + and 'receive' trace flags.

+

+ The first argument of erlang:trace/3 has + been extended so that 'all', 'existing' and + 'new' now include both processes and ports. New + Tracee variants, 'all_processes', + 'all_ports', 'existing_processes' etc have + been added to specify only processes or ports.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13496

+
+ +

+ When the 'procs' trace flag is enabled, a + 'spawned' trace event is now also generated by a + newly created process. The previous event 'spawn' + remains, but as it is generated by the process that did + the spawn, it is not guaranteed that it is ordered with + other trace events from the newly spawned process. So + when tracking the lifetime of a process this new event + should be used as the creation event.

+

+ This new trace event is marked as an incompatibility + because tools that expect certain trace events when + enabling 'procs' will have to updated.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13497

+
+ +

+ Add the erlang:match_spec_test/3 + function. The functions allows the testing of match + specifications for both tracing and ets tables. It can be + used to test that a match specification does the expected + filtering on specific data. It also returns more verbose + error reasons for incorrectly constructed match + specifications.

+

+ Own Id: OTP-13501

+
+ +

+ The erts internal tracing support has been changed to + have much less overhead and be more scalable.

+

+ This rewrite does not break any backwards + incompatibilities, but it does change the ordering of + some trace messages when compared to previous releases. + It should be noted that this only applies to trace + messages sent to processes or ports, it does not apply to + the new tracer module. However in future releases they + may also be effected by this.

+

+ Trace messages are only guaranteed to be ordered from one + traced process or port. In previous releases this was not + visible as a 'send' trace message would always + arrive before the corresponding 'receive' trace + message that is no longer always the case. This also + means that timestamped trace messages may seem to arrive + out of order as the timestamp is taken when the event is + triggered and not when it is put in the queue of the + tracer.

+

+ Own Id: OTP-13503

+
+ +

+ Add possibility to filter send and receive + trace with match specifications.

+

+ Own Id: OTP-13507

+
+ +

+ Add maps:update_with/3,4 and maps:take/2

+

+ Own Id: OTP-13522 Aux Id: PR-1025

+
+ +

+ Introduce LTTng tracing via Erlang tracing.

+

+ For LTTng to be enabled OTP needs to be built with + configure option --with-dynamic-trace=lttng.

+

The dynamic trace module dyntrace is now + capable to be used as a LTTng sink for Erlang tracing. + For a list of all tracepoints, see Runtime Tools User's + Guide .

+

This feature also introduces an incompatible change in + trace tags. The trace tags gc_start and + gc_end has been split into gc_minor_start, + gc_minor_end and gc_major_start, + gc_major_end.

+

+ *** POTENTIAL INCOMPATIBILITY ***

+

+ Own Id: OTP-13532

+
+ +

+ Print heap pointers for garbing processes during + crashdump

+

+ Own Id: OTP-13541 Aux Id: PR-1026

+
+ +

+ Changed and improved low level memory statistics returned + by erlang:system_info/1. The info for + erts_mmap has been moved from mseg_alloc to + its own section returned by {allocator, + erts_mmap}.

+

+ Own Id: OTP-13560

+
+ +

+ Add enif_snprintf to the NIF API

+

+ The function enif_snprintf is similar to + snprintf call but can handle formatting of Erlang + terms via %T format specifier.

+

+ Own Id: OTP-13580

+
+ +

The warning in the documentation for + erlang:raise/3 has been removed. It is now + officially perfectly fine to use raise/3 in production + code.

+

+ Own Id: OTP-13599

+
+ +

+ Fix bugs caused by the VM sometimes truncating object + sizes or offsets to 32 bits on 64-bit hosts. These bugs + were mainly found when working with large unicode strings + and nifs environments.

+

+ Own Id: OTP-13606

+
+ +

+ Add -start_epmd command line option, this lets you + disable automatic starting of epmd when starting a + distributed node.

+

+ Add -epmd_module command line option, this lets + you specify a module to register and look-up node names + in. The default module is erl_epmd.

+

+ Own Id: OTP-13627

+
+ +

+ erlang:halt now truncates strings longer than 200 + characters instead of failing with badarg.

+

+ Own Id: OTP-13630

+
+ +

+ Fix possible race in poller wake up on windows

+

+ Own Id: OTP-13634

+
+
+
+ +
+
Erts 7.3.1
Fixed Bugs and Malfunctions -- cgit v1.2.3