aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_port_task.c
AgeCommit message (Collapse)Author
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-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-06Merge branch 'egil/erts/tracing-beam-lttng/OTP-10282'Björn-Egil Dahlberg
* egil/erts/tracing-beam-lttng/OTP-10282: erts: Don't use ratio in carrier lttng tracepoints Add lttng testcases erts: Extend erlang:system_info/1 with lttng Refactor and fix dtrace define in erl_message erts: Add lttng tracepoints for async pool queue erts: Add lttng tracepoints for drivers erts: Add lttng tracepoints for scheduler events erts: Add lttng tracepoints for memory carriers erts: Update lttng-wrapper with mfa conversion erts: Teach lttng to configure and build system
2016-04-06erts: Add lttng tracepoints for driversBjörn-Egil Dahlberg
* driver_event * driver_flush * driver_finish * driver_init * driver_output * driver_outputv * driver_process_exit * driver_ready_async * driver_ready_input * driver_ready_output * driver_start * driver_stop * driver_stop_select * driver_timeout
2016-03-29erts: Add enif_port_commandLukas Larsson
2016-03-15update copyright-yearHenrik Nord
2016-02-24Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson
2016-02-24erts: Change erl_exit into erts_exitSverker Eriksson
This is mostly a pure refactoring. Except for the buggy cases when calling erlang:halt() with a positive integer in the range -(INT_MIN+2) to -INT_MIN that got confused with ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT. Outcome OLD erl_exit(n, ) NEW erts_exit(n, ) ------- ------------------- ------------------------------------------- exit(Status) n = -Status <= 0 n = Status >= 0 crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0 The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and ERTS_DUMP_EXIT are the same as before (even though their values have changed).
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
2015-07-10ose: Remove all code related to the OSE portLukas Larsson
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.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-05-08Optimized timer implementationRickard Green
2014-09-25Merge branch 'rickard/eager-check-io/OTP-12117' into ↵Rickard Green
rickard/maint-17/eager-check-io/OTP-12117 * rickard/eager-check-io/OTP-12117: Introduce support for eager check I/O scheduling Conflicts: erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.c erts/preloaded/ebin/erlang.beam
2014-09-25Introduce support for eager check I/O schedulingRickard Green
2014-08-22Ensure "runnable port" trace messages are not sent out of orderRickard Green
2014-08-18Merge branch 'rickard/port-emigrate-bug/OTP-12084' into ↵Rickard Green
rickard/port-emigrate-bug/maint/OTP-12084 * rickard/port-emigrate-bug/OTP-12084: Verify run-queue asserts Fix emigrate bug in erts_port_task_schedule() Conflicts: erts/emulator/beam/erl_port_task.c
2014-08-14Verify run-queue assertsRickard Green
2014-08-07Fix emigrate bug in erts_port_task_schedule()Rickard Green
While current run-queue lock is unlocked in the call to erts_check_emigration_need() from erts_port_task_schedule() the port can be migrated to another run-queue by another thread. The code in erts_port_task_schedule() needs to check if this has occurred when returning from erts_check_emigration_need(), and if so respect the migration decision. When this was not done, the thread calling erts_port_task_schedule() held the wrong run-queue lock which caused invalid updates of the port task queue. This bug was automatically fixed by the rewrites in the branch rickard/r16b/port-optimizations-fixes/OTP-10336 (commit 56cef897ca3ad2377e34a6ea5800a54a28cbeb6e) introduced in erts-5.10 and do not effect erts versions after that.
2014-08-05Fix abort of nosuspend-tasks in erts_port_task_schedule()Rickard Green
The counter for the amount of outstanding data in the port queue became inconsistent when aborting nosuspend-signals in erts_port_task_schedule(). This since the counter was subtracted by the data size of the signal although the data size had never been added to it. This inconsistency caused the port queue to remain in a busy state forever.
2014-03-25Merge branch 'paulgray/dtrace_snprintf_fix/OTP-11816'Lukas Larsson
* paulgray/dtrace_snprintf_fix/OTP-11816: Fix DTrace/SystemTap-related formatting
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
2014-03-25Merge branch 'paulgray/dtrace_snprintf_fix/OTP-11816'Lukas Larsson
* paulgray/dtrace_snprintf_fix/OTP-11816: Pass full strings to DTrace probes
2014-03-12Pass full strings to DTrace probesMichal Ptaszek
Whenever string is passed as an argument to a DTrace probe, its length should be properly computed. Until now in order to get length of the input buffer size_of(char *) was used - which evalutes to 4 or 8 (depending on the architecture). To get a proper length, size_of(DTRACE_CHARBUF_NAME(buffer_name)) should be used.
2014-02-24Added support for ENEA OSELukas Larsson
This port has support for both non-smp and smp. It contains a new way to do io checking in which erts_poll_wait receives the payload of the polled entity. This has implications for all linked-in drivers.
2014-01-27Fix usage of non-empty run-queue flagRickard Green
2013-08-27erts: Fix segfault when scheduling release_port later_opLukas Larsson
begin_port_cleanup can be called from a non-scheduler thread, this means that there is no esdp available and thus erts_schedule_thr_prgr_later_op segfaults.
2013-06-05Merge branch 'pan/r16b01/system_monitor_long_schedule/OTP-11067' into maintPatrik Nyblom
* pan/r16b01/system_monitor_long_schedule/OTP-11067: Minor spelling correction Add system_monitor of long_schedule
2013-06-04Merge branch 'rickard/stale-driver-select/OTP-11084' into maintRickard Green
* rickard/stale-driver-select/OTP-11084: Fix crash when reporting stale driver select
2013-05-06Only verify not busy for erlang:send(Port, Msg, [nosuspend]) until scheduledRickard Green
2013-05-06Fix crash when reporting stale driver selectRickard Green
2013-05-02Add system_monitor of long_schedulePatrik Nyblom
2013-04-04Make port close not be delayedPatrik Nyblom
Drivers are dereferenced when the port is completely gone, in the operation scheduled with erts_schedule_thr_prgr_later_op. If we use erts_schedule_thr_prgr_later_cleanup_op, it may not happen for a long time and the driver can not be unloaded. We can not dereference the driver before the thread_progress_later thing, because references to the driver may exist in other threads, so the unloading of the driver may free locks held by other schedulers and whatnot.
2013-04-03Be less eager requesting wakeup for cleanup jobsRickard Green
2013-02-13Implement erl_drv_consume_timeslice()Rickard Green
2013-02-13Fix driver port accessesRickard Green
2013-02-01Fix port exitRickard Green
2013-01-25Merge branch 'pan/fix-compiler-warnings-clang-and-new-gcc'Patrik Nyblom
* pan/fix-compiler-warnings-clang-and-new-gcc: Fix compiler warnings from GCC 4.7.1 on ARCH Linux Fix clang compiler warnings on FreeBSD in erts
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-24Bump fewer vreds per task callbackRickard Green
2013-01-23Fix compiler warnings from GCC 4.7.1 on ARCH LinuxPatrik Nyblom
2013-01-23Bump reductions also for immediate driver callsRickard Green
2012-12-14Fix aborts of port tasks when terminating portsRickard Green
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-07Add support for busy port message queueRickard Green
2012-12-07Add driver callback epilogueRickard Green
2012-12-07Implement true asynchronous signaling between processes and portsRickard Green
2012-12-03Add erl_drv_[send|output]_termRickard Green
2012-12-03Move busy port flagRickard Green
2012-12-03Optimize management of port tasksRickard Green
2012-12-03Use ptab functionality also for portsRickard Green