summaryrefslogtreecommitdiff
path: root/erts/emulator/sys
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearErlang/OTP2023-05-151-1/+1
|
* Merge pull request #7100 from frej/frej/modernize-K-and-R-syntaxBjörn Gustavsson2023-04-142-6/+6
|\ | | | | erts: Modernize K&R-style functions
| * erts: Modernize K&R-style functionsFrej Drejhammar2023-04-062-6/+6
| | | | | | | | | | | | Clang 16 now warns about functions using K&R syntax. Instead of juggling with compiler warning options, it is better to just bite the bullet and modernize the source code.
* | [erts] Remove naming of main threadRickard Green2023-04-131-1/+0
| | | | | | | | since it propagates to ps, pgrep, etc.
* | Merge pull request #6973 from lexprfuncall/runtime-thread-name-truncation-fixRickard Green2023-04-061-2/+3
|\ \ | |/ |/| | | | | Avoid truncating thread names for better runtime observability OTP-18552
| * Avoid truncating thread names for better runtime observabilitylexprfuncall2023-04-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Erlang runtime gives many of its threads descriptive names. When those threads are part of a logical group, a unique ID is added to the name for disambiguation. After construction, many thread names in Erlang have a string length greater than 16 characters. To fit within operating system limits, Erlang then truncates them from right to left. To minimize confusion after truncation, the unique ID is always placed at the left of a thread name so its information is not likely to be lost. The convention used by Erlang presents challenges to the use of thread names as keys when reporting on thread activity at the operating system level. The more common convention, used by other runtimes, is to have the description followed by a unique ID. When followed, sorting threads by name places like workers next to each other and the unique ID can be dropped to create a grouping key. Placing the unique ID first, as Erlang does, means that a different strategy needs to be used for sorting the threads of an Erlang process. Furthermore, the truncation necessitates a complicated strategy for analyzing the description to identify a possible common substring to be used as a grouping key. This change switches the Erlang runtime to use the more common convention in order to make reporting on the thread usage in an Erlang process easier for tooling. To do so, it shortens the content of the initial printf(3) format strings to ensure their output is always 16 or fewer characters so the name is never truncated. It also moves the unique ID in the format string to the right of the description, so the names of worker threads appear next to each other after sorting alphabetically from left to right. To prevent the accidental creation of long thread names in the future, the silent truncation has been eliminated from the lowest-layer of thread functionality. It now returns an EINVAL when given a long name which will be caught when the runtime is started. This would break the NIF and driver libraries so the silent truncation has moved up to a higher layer in order to preserve compatibility. New unit tests have been added to test setting and getting thread names.
* | Update copyright yearErlang/OTP2023-03-212-2/+2
| |
* | [erts] Option 'local' of term_to_binary/2 and term_to_iovec/2Rickard Green2023-03-152-0/+13
| | | | | | | | | | | | | | Introduce a local external term format with an unspecified encoding. This external term format is used for supporting the 'local' option of term_to_binary/2 and term_to_iovec/2. Terms encoded on this format is only to be decoded by the same runtime system instance that encoded it.
* | Update copyright yearErlang/OTP2023-02-143-3/+3
| |
* | Merge branch 'maint'Sverker Eriksson2023-01-231-6/+10
|\ \ | |/
| * Merge branch 'sverker/erts/fix-notify_port_task_executed/OTP-18391' into maintSverker Eriksson2023-01-232-9/+15
| |\
| | * erts: Fix bug in erts_io_notify_port_task_executedSverker Eriksson2023-01-121-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seen symptom: Failed assert DEBUG_PRINT_FD("executed ready_input", state); ASSERT(!(state->active_events & ERTS_POLL_EV_IN)); with state->type == ERTS_EV_TYPE_NIF that is, the fd already closed and then reused by a NIF.
| | * erts: Fix erts_poll_get_selected_events on some platformsJohn Högberg2023-01-121-3/+5
| | | | | | | | | | | | | | | | | | | | | Linux 5.15.0 has an extra line with `ino` before `tfd`, which needs to be skipped before parsing the latter. Cherry picked fc3295b1ebeed1235d12983184ba806f2ce2f525
* | | erts: Fix erts_poll_get_selected_events on some platformsJohn Högberg2022-12-081-3/+5
| | | | | | | | | | | | | | | Linux 5.15.0 has an extra line with `ino` before `tfd`, which needs to be skipped before parsing the latter.
* | | Merge branch 'maint'Sverker Eriksson2022-11-301-23/+25
|\ \ \ | |/ /
| * | Merge branch 'sverker/win-path-fix' into maintSverker Eriksson2022-11-301-23/+25
| |\ \ | | | | | | | | | | | | OTP-18345
| | * | erts: Remove unused 'requote' argument to application_type()Sverker Eriksson2022-10-271-10/+10
| | | |
| | * | erts: Fix open_port spawn with spaces in PATH on windowsSverker Eriksson2022-10-271-14/+16
| | | |
* | | | Merge branch 'maint' into masterLukas Larsson2022-10-241-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * | | Update copyright yearErlang/OTP2022-10-241-1/+1
| |/ /
* | | Merge branch 'maint'Lukas Larsson2022-10-212-0/+83
|\ \ \ | |/ /
| * | Revert "erts: Stop marking memory regions as discardable (`madvise(2)`)"Lukas Larsson2022-10-122-0/+83
| | | | | | | | | | | | This reverts commit df450823fcdb1657743c94023318abe3731366bb.
* | | Merge branch 'maint' into masterHenrik Nord2022-09-211-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * | Update copyright yearErlang/OTP2022-09-201-1/+1
| | |
* | | erts: Clear fallback flag when stopping selectLukas Larsson2022-08-311-0/+1
| | | | | | | | | | | | | | | Not clearing it triggered the assert below when stdin was deselected.
* | | erts: Reset tty when child_setup exitsLukas Larsson2022-08-291-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | If the cleanup code in sys_tty_reset is never run it can leave the terminal in a broken state. The cleanup code is not executed if erts receives a SIGKILL or if Ctrl-C is pressed when +B is started. Closes #3150
* | | erts: Re-Implement shell using nifLukas Larsson2022-08-292-32/+48
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit re-implements the entire tty driver for both Unix and Windows to use a common nif instead of two seperate drivers. The Unix implementation works pretty much as it did before only that a lot more of the terminal logic has been moved from Erlang to C. The windows implementation now uses Windows Terminal Sequences, i.e. the same sequences as most Unixes to control the terminal. This means that werl.exe is no longer needed and erl.exe will have the "newshell" with all the features normally only found on Unix. The new implementation also uses dirty I/O threads for all I/O which means that it can leave the FDs in blocking mode. This fixes problems when the Erlang tty is interacting with other systems such as bash. Closes #3150 Closes #3390 Closes #4343
* | Call mach_clock_getres only on initialized clocksEvan Miller2022-06-211-2/+2
| | | | | | | | | | Mac OS X 10.6 and earlier produced a segmentation fault due to a condition mismatch between calls to host_get_clock_service and mach_clock_getres.
* | Merge branch 'maint' into masterLukas Larsson2022-05-033-3/+3
|\ \ | | | | | | | | | | | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * | Update copyright yearErlang/OTP2022-05-024-4/+4
| | |
| * | Merge branch 'lukas/erts/remove-child-setup-assert' into maint-24Erlang/OTP2022-05-021-1/+0
| |\ \ | | | | | | | | | | | | | | | | * lukas/erts/remove-child-setup-assert: erts: Remove faulty child setup assert
| * \ \ Merge branch 'lukas/22/erts/fix-localtime-tz-change/OTP-18076' into maint-24Erlang/OTP2022-05-023-3/+21
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * lukas/22/erts/fix-localtime-tz-change/OTP-18076: erts: Fix localtime_r summer/winter-time change bug
* | \ \ \ Merge branch 'maint'Lukas Larsson2022-05-023-3/+21
|\ \ \ \ \
| * \ \ \ \ Merge branch 'lukas/22/erts/fix-localtime-tz-change/OTP-18076' into maintLukas Larsson2022-05-023-3/+21
| |\ \ \ \ \ | | | |/ / / | | |/| | | | | | | | | | | | | | | * lukas/22/erts/fix-localtime-tz-change/OTP-18076: erts: Fix localtime_r summer/winter-time change bug
| | * | | | erts: Fix localtime_r summer/winter-time change bugLukas Larsson2022-04-193-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to POSIX, localtime_r does not have to update the process internal tz data when called. So if time went from winter to summertime erts is running localtime_r may return an incorrect time. So we need to make sure to call tzset before each call to localtime_r. localtime is guaranteed to update the tz information, so no need to call it when using localtime.
* | | | | | Update copyright yearErlang/OTP2022-04-112-2/+2
| | | | | |
* | | | | | Merge PR-5809 from sverker/sched-poll-flag OTP-17945Sverker Eriksson2022-04-072-55/+113
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add option +IOs to disable scheduler thread polling
| * | | | | | erts: Add option +IOs to disable scheduler pollingSverker Eriksson2022-04-072-40/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enabled (true) by default.
| * | | | | | Filter out diff from cleared oneshot eventsSverker Eriksson2022-04-071-3/+11
| | | | | | |
| * | | | | | erts: Fix EventStateFlag printing ERTS_EV_FLAG_WANT_ERRORSverker Eriksson2022-04-071-12/+25
| | | | | | |
* | | | | | | erts: Fix child_setup partial readLukas Larsson2022-04-071-45/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling read it may return a partial result. So we make sure that all the data is read before returning. The problem has been observed when reading the ACK message, but we use the new routine for all reads in the child so that we know that it will work everywhere.
* | | | | | | Merge branch 'maint'Lukas Larsson2022-04-051-1/+0
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | Merge branch 'lukas/erts/remove-child-setup-assert' into maintLukas Larsson2022-04-051-1/+0
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | / / | | | |_|/ / | | |/| | | * lukas/erts/remove-child-setup-assert: erts: Remove faulty child setup assert
| | * | | | erts: Remove faulty child setup assertLukas Larsson2022-04-051-1/+0
| | | |/ / | | |/| |
* | | | | Update copyright yearErlang/OTP2022-03-231-1/+1
| |_|/ / |/| | |
* | | | Merge branch 'maint'Raimo Niskanen2022-03-181-18/+20
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | * maint: Requote for plain spawn Fix erlang:open_port({spawn_executable,_},_) on Windows
| * | | Requote for plain spawnRaimo Niskanen2022-03-161-10/+20
| | | |
| * | | Fix erlang:open_port({spawn_executable,_},_) on WindowsRaimo Niskanen2022-03-151-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the looked up absolute program name instead of (incorrectly) spawning the pre-lookup command from the path. Remove redundant incorrect command line quoting.
| * | | Update copyright yearErlang/OTP2022-03-091-1/+1
| | | |
* | | | Check for and use dlvsym for sctp_connectx in dynamically loaded libSimon Cornish2022-03-011-0/+25
| | | |