aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erlang.xml
AgeCommit message (Collapse)Author
2016-06-14erts: Fix doc xml errorsLukas Larsson
2016-06-10erts: Add port monitorsDmytro Lytovchenko
* 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
2016-05-27Merge branch 'richcarl/erts/fix-init-stop/PR-911/OTP-13630/OTP-13631'Sverker Eriksson
2016-05-25Remove the 'message_queue_data' option 'mixed'Rickard Green
2016-05-25erts: Make erlang:halt/2 truncate string argSverker Eriksson
if too long.
2016-05-20Clarify limitation on halt/2 slogan stringRichard Carlsson
2016-05-18Merge branch 'hasse/erl_docgen/datatype_anchors/OTP-13600/ERL-141'Hans Bolinder
* hasse/erl_docgen/datatype_anchors/OTP-13600/ERL-141: kernel: Remove no longer needed anchors in documentation stdlib: Remove no longer needed anchors in documentation erts: Remove no longer needed anchors in documentation erl_docgen: Add anchors to datatypes without name attribute
2016-05-17erts: Remove no longer needed anchors in documentationHans Bolinder
2016-05-16Remove the warning about using erlang:raise/3Björn Gustavsson
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
2016-05-10erts: Fix pre-bif yield current_functionLukas Larsson
2016-05-10erts: Implement max_heap_size process flagLukas Larsson
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}
2016-05-09Merge branch 'sverker/system_info-erts_mmap/OTP-13560'Sverker Eriksson
2016-05-09Merge branch 'sverker/trace-send-receive-matchspec/OTP-13507'Sverker Eriksson
2016-05-04erts: Add send and 'receive' to trace_info/2Sverker Eriksson
to obtain match specs
2016-05-04erts: Fix missing type in doc for trace_patternSverker Eriksson
2016-05-04erts: Add docs for trace_pattern with 'send' and 'receive'Sverker Eriksson
2016-05-03Merge branch 'egil/erts/gc-doc/OTP-13532'Björn-Egil Dahlberg
* egil/erts/gc-doc/OTP-13532: erts: Remove forgotten atoms in erl_tracer erts: Update garbage collection trace documentation
2016-05-03Merge branch 'lukas/erts/rename_xmqd_to_hmqd/OTP-13366'Lukas Larsson
* lukas/erts/rename_xmqd_to_hmqd/OTP-13366: erts: Rename erl flag +xmqd to +hmqd in erlexec Fix proc_lib message_queue_data spec erts: Fix total_heap_size calculation for on_heap erts: Rename erl flag +xmqd to +hmqd
2016-05-02erts: Update garbage collection trace documentationBjörn-Egil Dahlberg
2016-04-29erts: Clarify docs for trace_pattern/3Sverker Eriksson
2016-04-26erts: Fix broken doc link to erl_tracerLukas Larsson
2016-04-26erts: Rename erl flag +xmqd to +hmqdLukas Larsson
Flags that control the heap should all fall under the +h flag
2016-04-20erts: Produce statistics for literal and hipe super carriersSverker Eriksson
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.
2016-04-15erts: Make trace_delivered go via sys msg dispatcher againLukas Larsson
This is needed as otherwise messages from system_profile will not be guaranteed to arrive before trace delivered.
2016-04-15erts: Document erlang:match_spec_test/3Lukas Larsson
OTP-13501
2016-04-15erts: Add 'spawned' trace event to 'procs' trace flagLukas Larsson
OTP-13497 This trace event is triggered when a process is created from the process that is created.
2016-04-15erts: Extend process and port tracingLukas Larsson
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
2016-04-15erts: Implement tracer modulesLukas Larsson
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
2016-03-15update copyright-yearHenrik Nord
2016-03-10Improved scheduler suspend functionalityRickard Green
- 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.
2016-02-24Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson
2016-02-24erts: Make erlang:halt() accept bignums as StatusSverker Eriksson
Just mask away the high bits to get a more tolerant erlang:halt that behaves the same on 32 and 64 bit architectures.
2016-02-02Merge branch 'lukas/erts/msacc'Lukas Larsson
* lukas/erts/msacc: Update preloaded modules erts: Make msacc alloctor type thread safe Silence compiler erts: Fix msacc testcase on some windowses erts: Add power saving cpu feature tests and use them erts: Refactor perf counter internal interface erts: Add rdtscp instruction check erts: Fix hrtime for windows erts: use correct function for perf counter on non-x86 erts: Fix msacc win32 debug compile error erts: Add microstate accounting erts, kernel: Add os:perf_counter function erts: Add ERTS_WRITE_UNLIKELY
2016-02-02Merge branch 'maint'Rickard Green
* maint: Use nano second time unit in tracing
2016-02-02Merge branch 'rickard/monotonic-time-improvements/OTP-13222' into maintRickard Green
* rickard/monotonic-time-improvements/OTP-13222: Use nano second time unit in tracing
2016-02-02Use nano second time unit in tracingRickard Green
2016-02-02erts: Add microstate accountingLukas Larsson
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
2016-02-02erts, kernel: Add os:perf_counter functionLukas Larsson
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
2016-02-02Merge branch 'maint'Rickard Green
* maint: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats Conflicts: erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_driver.h erts/emulator/beam/erl_nif.h erts/emulator/beam/erl_trace.c erts/preloaded/ebin/erlang.beam
2016-02-02Merge branch 'rickard/monotonic-time-improvements/OTP-13222' into maintRickard Green
* rickard/monotonic-time-improvements/OTP-13222: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats
2016-01-26Merge branch 'lukas/erts/gc_info/OTP-13265'Lukas Larsson
* lukas/erts/gc_info/OTP-13265: erts: Add garbage_collection_info to process_info/2 Conflicts: erts/emulator/beam/erl_bif_info.c
2016-01-20Merge branch 'sverk/safe-purging/OTP-13122'Sverker Eriksson
2016-01-20erts: Update docs for erlang:purge_module/1Sverker Eriksson
2016-01-20Introduce time warp safe trace timestamp formatsRickard Green
New timestamp options for trace, sequential trace, and system profile: - monotonic_timestamp - strict_monotonic_timestamp
2016-01-14Merge branch 'maint'Sverker Eriksson
2016-01-14Merge branch 'sverk/trace-doc-typo' into maintSverker Eriksson
* sverk/trace-doc-typo: erts: Correct faulty doc for erlang:trace/3
2016-01-14erts: Correct faulty doc for erlang:trace/3Sverker Eriksson
The entire MFA tuple is replaced with 0, not just Arity.
2015-12-30Merge branch 'maint'Rickard Green
* maint: Light weight statistics of run queue lengths Conflicts: erts/preloaded/ebin/erlang.beam
2015-12-30Light weight statistics of run queue lengthsRickard Green
- statistics(total_run_queue_lengths) - statistics(run_queue_lengths) - statistics(total_active_tasks) - statistics(active_tasks) Conflicts: erts/emulator/beam/erl_process.c
2015-12-08Replace off_heap_message_queue option with message_queue_data optionRickard Green
The message_queue_data option can have the values - off_heap - on_heap - mixed