aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
AgeCommit message (Collapse)Author
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-28Merge branch 'bjorn/kernel/clean-up-code_server'Björn Gustavsson
* bjorn/kernel/clean-up-code_server: code_server: Add specs for all exported functions code_server: Add types to the state record code_server: Don't export internal system_* functions Simplify starting of code server Remove first argument of code_server:call()
2016-01-28code_server: Add specs for all exported functionsBjörn Gustavsson
2016-01-28Merge branch 'maint'Björn Gustavsson
* maint: Update documentation for code-loading functions code: Correct the types for error returns Eliminate run-time system crash in code:load_abs/1
2016-01-28code: Correct the types for error returnsBjörn Gustavsson
The specifications for functions that load code in the 'code' module (e.g. code:load_file/1) have some problems: * The specs claim that the functions can return {error,on_load}, but they never do. However, they can return {error,on_load_failure} if the -on_load function in a module fails. * The specs claim that the functions can return {error,native_code}, but they never do. While we are it, also extend the on_load_errors/1 test case to test that the load functions return {error,on_load_failure} when an -on_load function fails.
2016-01-27code_server: Add types to the state recordBjörn Gustavsson
2016-01-27code_server: Don't export internal system_* functionsBjörn Gustavsson
There is no reason to export system_continue/3 and system_terminate/4 from code_server. Servers that use proc_lib and 'sys' to handle system message do need those functions exported, but code_server contains a modified copy of the system message handling code from 'sys', and that code only make local calls to system_continue/3 and system_terminate/4.
2016-01-27Simplify starting of code serverBjörn Gustavsson
There is unnecessary knowledge about the -nostick option in the 'kernel' module. -nostick can be handled entirely in the 'code' module. There is no need to have both code:start_link/0 and code:start_link/1. code:start_link/0 is sufficient. Also get rid of error handling for things that cannot happen: The 'init' module has made sure that init:get_argument(root) can't fail, so there is no need for any error-reporting code. (See e1dc0aa4.) We also don't need to test the return value from code_server:start_link/1, because it will always return {ok,Pid} (or crash).
2016-01-27Remove first argument of code_server:call()Björn Gustavsson
Remove the first argument for code_server:call(). It makes no sense. The only caller is 'code'. Note that the code_server module is undocumented and that code_server:call() is an internal helper function.
2016-01-25Eliminate run-time system crash in code:load_abs/1Björn Gustavsson
The run-time system would terminate if code:load_abs/1 was called with a filename containing any non-latin1 characters. The reason is that code_server would attempt to construct a module name from the filename using list_to_atom/1 and that atoms currently are limited to the latin1 character set. But how should the error be reported? I have decided to that the simplest and least confusing way is to move the call to list_to_atom/1 to 'code' module and let it crash the calling process. The resulting stack back trace will make it clear what the reason for the crash was.
2016-01-22Remove redundant test that hipe_unified_loader is loadedBjörn Gustavsson
For some reason, there is a test in code_server that hipe_unified_loader is loaded before trying to call it. The test was added in R9B, but it is not clear why. Before starting the code server, the 'code' module would always load hipe_unified_loader; thus there is now way that the test can ever fail.
2016-01-22Avoid testing for pending on_load twiceBjörn Gustavsson
2016-01-22code_server: Tighten type of modules parametersBjörn Gustavsson
The following functions in the 'code' module only allow the module argument to an atom: load_file/1 load_binary/3 ensure_loaded/1 delete/1 purge/1 soft_purge/1 get_object_code/1 Therefore, there is no reason that the corresponding implementation in code_server should allow the module to be either an atom or a string. Only accept an atom and remove the helper functions to_atom/1 and do_mod_call/4.
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-13erts: Refactor code:purge/1 and code:soft_purge/1Sverker Eriksson
by moving code from code_server to erts_code_purger. This is more or less a copy-paste from code_server.erl to erts_code_purger.erl. All the inner mechanics of code:purge/1 and code:soft_purge/1 are unchanged.
2015-12-17Merge branch 'bjorn/kernel/remove-code-path-cache/OTP-13191'Björn Gustavsson
* bjorn/kernel/remove-code-path-cache/OTP-13191: Remove the code path cache in the code server
2015-12-16Merge tag 'OTP-18.2'Henrik Nord
=== OTP-18.2 === Changed Applications: - asn1-4.0.1 - common_test-1.11.1 - compiler-6.0.2 - crypto-3.6.2 - dialyzer-2.8.2 - diameter-1.11.1 - erl_docgen-0.4.1 - erl_interface-3.8.1 - erts-7.2 - eunit-2.2.12 - hipe-3.14 - inets-6.1 - jinterface-1.6.1 - kernel-4.1.1 - observer-2.1.1 - parsetools-2.1.1 - public_key-1.1 - runtime_tools-1.9.2 - sasl-2.6.1 - snmp-5.2.1 - ssh-4.2 - ssl-7.2 - stdlib-2.7 - test_server-3.9.1 - tools-2.8.2 - typer-0.9.10 - wx-1.6 - xmerl-1.3.9 Unchanged Applications: - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosNotification-1.2 - cosProperty-1.2 - cosTime-1.2 - cosTransactions-1.3 - debugger-4.1.1 - edoc-0.7.17 - eldap-1.2 - et-1.5.1 - gs-1.6 - ic-4.4 - megaco-3.18 - mnesia-4.13.2 - odbc-2.11.1 - orber-3.8 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - percept-0.8.11 - reltool-0.7 - syntax_tools-1.7 - webtool-0.9 Conflicts: OTP_VERSION erts/vsn.mk
2015-12-15Merge branch 'lukas/erts/forker'Lukas Larsson
* lukas/erts/forker: (28 commits) erts: Never abort in the forked child erts: Mend ASSERT makro for erl_child_setup erts: Allow enomem failures in port_SUITE erts: iter_port sleep longer on freebsd erts: Allow one dangling fd if there is a gethost port erts: Only use forker StackAck on freebsd erts: It is not possible to exit the forker driver erts: Add forker StartAck for port start flowcontrol erts: Fix large open_port arg segfault for win32 erts: Fix memory leak at async open port kernel: Remove cmd server for unix os:cmd erts: Add testcase for huge port environment erts: Move os_pid to port hash to child setup erts: Handle all EINTR and EAGAIN cases in child setup erts: Make child_setup work with large environments erts: Fix forker driver ifdefs for win32 erts: Fix uds socket handling for os x erts: Fix dereferencing of unaligned integer for sparc erts: Flatten too long io vectors in uds write erts: Add fd count test for spawn_driver ... Conflicts: erts/emulator/beam/erl_node_tables.c erts/preloaded/src/erts_internal.erl
2015-12-15kernel: Remove cmd server for unix os:cmdLukas Larsson
Since we no longer to vfork in the emulator there is no need to serialize the os:cmd calls through a central command server. This greatly decreases the complexity of this code and should make it fast+more scalable. OTP-13089
2015-12-14Remove the code path cache in the code serverBjörn Gustavsson
In practice, it does not seem that code path cache can improve performance. Looking for any file that is not found will cause the cache to be rebuilt, which will negate any gain of using the cache.
2015-12-14Merge branch 'bjorn/deprecate-random/OTP-12502'Björn Gustavsson
* bjorn/deprecate-random/OTP-12502: Deprecate the 'random' module Eliminate mentions of 'random' in documentation mnesia tests: Replace 'random' with 'rand' percept tests: Replace 'random' with 'rand' system tests: Replace 'random' with 'rand' common_test tests: Replace 'random' with 'rand' gs: Remove the contribs directory wx: Replace 'random' with 'rand' stdlib tests: Replace 'random' with 'rand' kernel test: Replace 'random' with 'rand' debugger tests: Replace 'random' with 'rand' compiler tests: Replace 'random' with 'rand' Emulator test suite: Replace use of 'random' with 'rand' Use 'rand' instead of the obsolete 'random' module compile: Eliminate use of the obsolete 'random' module
2015-12-11Use 'rand' instead of the obsolete 'random' moduleBjörn Gustavsson
In most cases, we don't have to seed the random number generator, as the rand:uniform/1 takes care about that itself.
2015-12-11Update appups in kernel, stdlib and sasl for OTP-18.2Siri Hansen
2015-12-07erts: Change erts_internal:map_type/1 into term_type/1Sverker Eriksson
to support other terms, not just maps
2015-12-04Merge branch 'maint'Henrik Nord
2015-12-04Merge branch 'maint-17' into maintHenrik Nord
Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/kernel/doc/src/notes.xml lib/kernel/src/kernel.appup.src lib/kernel/vsn.mk lib/ssl/doc/src/notes.xml lib/ssl/src/ssl.appup.src lib/ssl/src/ssl_cipher.erl lib/ssl/vsn.mk otp_versions.table
2015-12-02Merge branch 'maint'Raimo Niskanen
2015-12-02Merge branch 'soranoba/fix-file-position/PR-646' into maintRaimo Niskanen
* soranoba/fix-file-position/PR-646: Unify internal error handling Fix file:pread and :pwrite to use character encoding Clean up code for file:position/2 Fix file:position (not raw mode) OTP-13155
2015-12-01Update appupRaimo Niskanen
2015-11-26Unify internal error handlingRaimo Niskanen
2015-11-26Fix file:pread and :pwrite to use character encodingRaimo Niskanen
2015-11-24Clean up code for file:position/2Raimo Niskanen
2015-11-19Fix inet:setopts/2 to take multiple raw optionsRaimo Niskanen
2015-11-17Use copy literal range check in message passing and purgingBjörn-Egil Dahlberg
2015-11-17Add machinery to enable SHCOPY dynamicallyNikolaos S. Papaspyrou
This commit is just for debugging purposes, will probably be reverted. It comes with a the erts_debug:copy_shared/1 BIF. If SHCOPY_DISABLE is defined, SHCOPY starts disabled and is dynamically enabled the first time that the BIF is called.
2015-11-17Add the BIF size_shared/1 and debug cleanupNikolaos S. Papaspyrou
2015-11-05Merge branch 'maint'Henrik Nord
2015-11-05Merge branch 'weiss/case-insensitive-lookups' into maintHenrik Nord
* weiss/case-insensitive-lookups: inet_res: Make host name lookups case-insensitive OTP-13083
2015-10-26erts: Add {line_delimiter, byte()} option to inet:setopts/2Serge Aleynikov
A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'.
2015-10-26Update primary bootstrapIngela Anderton Andin
2015-10-26erts: Add {line_delimiter, byte()} option to inet:setopts/2Serge Aleynikov
A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'.
2015-10-12Merge branch 'maint'Zandra
2015-10-12Merge branch 'stolen/unified_dist' into maintZandra
OTP-13040 * stolen/unified_dist: kernel: inet6_tcp_dist: reuse inet_tcp_dist code Conflicts: lib/kernel/src/inet_tcp_dist.erl
2015-10-08Update Kernel and STDLIBHans Bolinder
Record field types have been modified due to commit 8ce35b2: "Take out automatic insertion of 'undefined' from typed record fields".
2015-10-08Merge branch 'maint'Björn Gustavsson
* maint: Avoid always updating inet_dns in the primary bootstrap
2015-10-05Avoid always updating inet_dns in the primary bootstrapBjörn Gustavsson
The include file inet_dns_record_adts.hrl is generated by the Perl script inet_dns_record_adts.pl in a non-deterministic way. That is, every time the script is run, the functions will be in a different order. That will cause inet_dns.beam in the primary bootstrap to be updated every time the bootstrap is updated, even though there is no actual code change. Modify the Perl script to sort the keys pulled out from hashes to make the order deterministic.
2015-09-27inet_res: Make host name lookups case-insensitiveHolger Weiß
This partly reverts commit 8152505ea3793037984a7f3349ac95cc20c4e44c.
2015-09-21Merge branch 'maint'Hans Bolinder
* maint: Update application versions