aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_message.c
AgeCommit message (Collapse)Author
2016-05-31Fix bad assertionRickard Green
2016-05-31Properly close message factories in erts_factory_trim_and_close()Rickard Green
2016-05-27Merge branch 'rickard/on_heap-fix/OTP-13366'Rickard Green
* rickard/on_heap-fix/OTP-13366: Improve message allocation in enif_send() Fix message queue update on replacement and removal of message
2016-05-26Fix message queue update on replacement and removal of messageRickard Green
2016-05-25Remove the 'message_queue_data' option 'mixed'Rickard Green
2016-05-11Add better support for communication with a process executing dirty NIFRickard Green
- 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.
2016-05-04erts: Add Sender in 'receive' trace matchspecSverker Eriksson
All 'EXIT' and monitor messages are sent from 'system' Timeouts are "sent" from 'clock_service'
2016-05-04erts: Add matchspec to 'receive' traceSverker Eriksson
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-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-06Refactor and fix dtrace define in erl_messageBjörn-Egil Dahlberg
2016-03-15update copyright-yearHenrik Nord
2016-01-21erts: Fix faulty assert for non-smpSverker Eriksson
2015-12-18Merge branch 'lv/fix-compilation-with-vm-probes/OTP-13209'Björn-Egil Dahlberg
* lv/fix-compilation-with-vm-probes/OTP-13209: Fix compilation with `--enable-vm-probes`
2015-12-09Merge branch 'sverk/dist-ctrl-msg-overflow-master' into masterSverker Eriksson
* sverk/dist-ctrl-msg-overflow-master: erts: Tweak hashmap heap size estimation erts: Fix bug for remote control message containing fat maps erts: Add test for remote exit signal with fat map erts: Fix bug in heap_factory_undo for FACTORY_HEAP_FRAGS mode
2015-12-08Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Replace off_heap_message_queue option with message_queue_data option Always use literal_alloc Distinguish between GC disabled by BIFs and other disabled GC Fix process_info(_, off_heap_message_queue) Off heap message queue test suite Remove unused variable Fix memory leaks
2015-12-08Merge branch 'sverk/dist-ctrl-msg-overflow' into ↵Sverker Eriksson
sverk/dist-ctrl-msg-overflow-master
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
2015-12-08Fix compilation with `--enable-vm-probes`Luca Favatella
... broken by 3ac08f9b. Compilation error: ``` beam/erl_message.c: In function 'erts_send_message': beam/erl_message.c:753:56: error: macro "copy_struct" requires 4 arguments, but only 3 given utag = copy_struct(DT_UTAG(sender), dt_utag_size, ohp); ^ beam/erl_message.c:753:10: error: 'copy_struct' undeclared (first use in this function) utag = copy_struct(DT_UTAG(sender), dt_utag_size, ohp); ^ beam/erl_message.c:753:10: note: each undeclared identifier is reported only once for each function it appears in ```
2015-12-07erts: Fix bug for remote control message containing fat mapsSverker Eriksson
that could cause the static factory to overflow Fix: Introduce a new factory mode FACTORY_TMP
2015-12-03erts: Fix bug in heap_factory_undo for FACTORY_HEAP_FRAGS modeSverker Eriksson
Make sure a heap fragment is not deallocated before all off_heap terms have been cleared. The fix assumes/asserts that the off_heap-lists of all additional heap fragments are empty. I think this bug has been harmless as hashmap nodes, which is only ones (?) that can cause a factory to produce more heap, are not linked in off_heap-list.
2015-11-19Refactor have seq_trace token testBjörn-Egil Dahlberg
2015-11-18Use sharing preserving copy error messages and exceptionsBjörn-Egil Dahlberg
2015-11-18Refactor sharing preserved copy flagsBjörn-Egil Dahlberg
The TMPBUF option is no longer needed due to is_literal test and NONE was only used for initial debugging. So we remove the entire option.
2015-11-18Fix rebase of SHCOPY seq_tokensBjörn-Egil Dahlberg
2015-11-17Add -debug +vc flag for debuging SHCOPYNikolaos S. Papaspyrou
This is very verbose, you have been warned. It should work with the copy-spy.py script, which may be a bit outdated.
2015-11-17Enable shcopy for sending messagesNikolaos S. Papaspyrou
2015-11-12Fragmented young heap generation and off_heap_message_queue optionRickard Green
* 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.
2015-11-12Introduce literal tagRickard Green
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-15erts: Add erts_factory_trim_and_closeSverker Eriksson
2015-06-15erts: Remove hashmap probabilistic heap overestimationSverker Eriksson
by adding a dynamic heap factory. "binary_to_term" is now a hybrid solution with both a call to decoded_size() to calculate needed heap space AND possible dynamic allocation of more heap space if needed for big maps. The heap size returned from decoded_size() is guaranteed to be sufficient for all term heap data except for hashmap nodes. All hashmap nodes are created at the end of dec_term() by invoking the heap factory interface that may allocate more heap space on process heap or in fragments. With this commit it is no longer guaranteed that a message is confined to only one heap fragment.
2015-05-08Merge branch 'rickard/timer-optimization/OTP-12650'Rickard Green
* rickard/timer-optimization/OTP-12650: Optimized timer implementation Reusable red-black tree implementation Conflicts: erts/emulator/beam/erl_bif_timer.c
2015-05-08Optimized timer implementationRickard Green
2015-04-14erts: Refactor erts_queue_messageBjörn-Egil Dahlberg
2015-03-20Merge branch 'rickard/time_api/OTP-11997'Rickard Green
* rickard/time_api/OTP-11997: (22 commits) Update primary bootstrap inets: Suppress deprecated warning on erlang:now/0 inets: Cleanup of multiple copies of functions Add inets_lib with common functions used by multiple modules inets: Update comments Suppress deprecated warning on erlang:now/0 Use new time API and be back-compatible in inets Remove unused functions and removed redundant test asn1 test SUITE: Eliminate use of now/0 Disable deprecated warning on erlang:now/0 in diameter_lib Use new time API and be back-compatible in ssh Replace all calls to now/0 in CT with new time API functions test_server: Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API otp_SUITE: Warn for calls to erlang:now/0 Replace usage of erlang:now() with usage of new API Multiple timer wheels Erlang based BIF timer implementation for scalability Implement ethread events with timeout ... Conflicts: bootstrap/bin/start.boot bootstrap/bin/start_clean.boot bootstrap/lib/compiler/ebin/beam_asm.beam bootstrap/lib/compiler/ebin/compile.beam bootstrap/lib/kernel/ebin/auth.beam bootstrap/lib/kernel/ebin/dist_util.beam bootstrap/lib/kernel/ebin/global.beam bootstrap/lib/kernel/ebin/hipe_unified_loader.beam bootstrap/lib/kernel/ebin/inet_db.beam bootstrap/lib/kernel/ebin/inet_dns.beam bootstrap/lib/kernel/ebin/inet_res.beam bootstrap/lib/kernel/ebin/os.beam bootstrap/lib/kernel/ebin/pg2.beam bootstrap/lib/stdlib/ebin/dets.beam bootstrap/lib/stdlib/ebin/dets_utils.beam bootstrap/lib/stdlib/ebin/erl_tar.beam bootstrap/lib/stdlib/ebin/escript.beam bootstrap/lib/stdlib/ebin/file_sorter.beam bootstrap/lib/stdlib/ebin/otp_internal.beam bootstrap/lib/stdlib/ebin/qlc.beam bootstrap/lib/stdlib/ebin/random.beam bootstrap/lib/stdlib/ebin/supervisor.beam bootstrap/lib/stdlib/ebin/timer.beam erts/aclocal.m4 erts/emulator/beam/bif.c erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_db_hash.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_thr_progress.c erts/emulator/beam/utils.c erts/emulator/sys/unix/sys.c erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/init.beam erts/preloaded/src/erts_internal.erl lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl lib/diameter/src/base/diameter_lib.erl lib/kernel/src/os.erl lib/ssh/test/ssh_basic_SUITE.erl system/doc/efficiency_guide/advanced.xml
2015-03-20Erlang based BIF timer implementation for scalabilityRickard Green
2015-03-19erts: Fix map bug in dec_term for 32-bit debug VMSverker Eriksson
Adding ERTS_SWORD_MAX to a pointer does not work as a way to disable a bound check. Remove the hp_end from ErtsHeapFactory as it isn't really used anyway.
2015-03-12First stab at binary_to_term for hamtSverker Eriksson
with over estimation of heap size.
2014-08-22Ensure "runnable proc" trace messages are not sent out of orderRickard Green
2014-05-22Do not GC other processes in non-smp runtimeRickard Green
2014-03-25Fix DTrace/SystemTap-related formattingScott Lystig Fritchie
Thanks to Michał Ptaszek for bringing this embarrassing formatting error to my attention. Many DTrace/SystemTap trace strings are incorrectly truncated at 4/8 bytes, depending on the CPU word size. This patch expands the work from commit d032e097 by zheng siyao. Michał's report to the erlang-bugs list can be found at: http://erlang.org/pipermail/erlang-bugs/2014-March/004250.html Conflicts: erts/emulator/beam/beam_emu.c erts/emulator/beam/copy.c erts/emulator/beam/dist.c erts/emulator/beam/erl_async.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/io.c
2013-12-02Compile in_heapfrag() only in debug modeAnthony Ramine
2012-12-07Merge branch 'rickard/port-optimizations/OTP-10336' into ↵Rickard Green
rickard/r16/port-optimizations/OTP-10336 * rickard/port-optimizations/OTP-10336: Change annotate level for emacs-22 in cerl Update etp-commands Add documentation on communication in Erlang Add support for busy port message queue Add driver callback epilogue Implement true asynchronous signaling between processes and ports Add erl_drv_[send|output]_term Move busy port flag Use rwlock for driver list Optimize management of port tasks Improve configuration of process and port tables Remove R9 compatibility features Use ptab functionality also for ports Prepare for use of ptab functionality also for ports Atomic port state Generalize process table implementation Implement functionality for delaying thread progress from unmanaged threads Conflicts: erts/doc/src/erl_driver.xml erts/doc/src/erlang.xml erts/emulator/beam/beam_bif_load.c erts/emulator/beam/beam_bp.c erts/emulator/beam/beam_emu.c erts/emulator/beam/bif.c erts/emulator/beam/copy.c erts/emulator/beam/erl_alloc.c erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_message.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process_lock.c erts/emulator/beam/erl_trace.c erts/emulator/beam/export.h erts/emulator/beam/global.h erts/emulator/beam/io.c erts/emulator/sys/unix/sys.c erts/emulator/sys/vxworks/sys.c erts/emulator/test/port_SUITE.erl erts/etc/unix/cerl.src erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/src/prim_inet.erl lib/hipe/cerl/erl_bif_types.erl lib/kernel/doc/src/inet.xml lib/kernel/src/inet.erl
2012-12-03Prepare for use of ptab functionality also for portsRickard Green
2012-12-03Generalize process table implementationRickard Green
2012-08-31erts: Remove some compiler warningsSverker Eriksson
2012-08-03Merge branch 'rickard/tab-unref-thr-prgr/OTP-10167'Rickard Green
* rickard/tab-unref-thr-prgr/OTP-10167: Use thread progress instead of scheduling misc aux work were possible Conflicts: erts/emulator/beam/erl_process.h
2012-08-03Merge branch 'rickard/proc-sched/OTP-9892'Rickard Green
* rickard/proc-sched/OTP-9892: Read message queue lengths while having lock Remove development debug code Fix bug scheduling free processes Conflicts: erts/emulator/beam/erl_message.c