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