aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_ptab.h
AgeCommit message (Collapse)Author
2016-06-10erts: Fix undefined shift to msb in erl_processBjörn-Egil Dahlberg
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
2015-06-18Change license text to APLv2Bruce Yinhe
2015-05-08Optimized timer implementationRickard Green
2014-12-10Use the new 64-bit atomic ops APIRickard Green
2013-08-07erts: Fix race in ptab that can cause PID mix-upsSverker Eriksson
Since: R16B01 Symptom: A spawned process may get the same PID as an existing process. The new process will "steal" the PID and make the old process unreachable through the PID. The problem also applies to port identities but has only been seen for processes. Conditions: SMP emulator with at least two scheduler threads. Rapid spawning and termination of a large number of processes. A small number of free slots in the process table will also increase the risk for this bug. Workaround: Use command line options "+P legacy" and "+Q legacy" Cause: The race happens if a process terminates and gets stalled while releasing its process table slot. The stall has to be so long (due to OS preemptive scheduling most probably) for other schedluer threads to consume all other free slots for newly spawn processes. Fix: Write invalid-markers in the free-pid-table and do atomic exhange operations in retry-loops to make sure each thread gets a unique PID.
2013-06-12Update copyright yearsBjörn-Egil Dahlberg
2013-05-17Introduce a better id allocation algorithm for PTabsRickard Green
2013-04-03Be less eager requesting wakeup for cleanup jobsRickard Green
2012-12-03Improve configuration of process and port tablesRickard Green
2012-12-03Use ptab functionality also for portsRickard Green
2012-12-03Prepare for use of ptab functionality also for portsRickard Green
2012-12-03Generalize process table implementationRickard Green