Age | Commit message (Collapse) | Author |
|
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
|
|
* paulgray/inet_db_fix/PR-949/OTP-13470:
Fix start timestamp instead of time check
Allow to refresh resolver settings on startup
|
|
* henrik/update-copyrightyear:
update copyright-year
|
|
to let future nodes know that we can handle
NEW_PID_EXT, NEW_PORT_EXT and NEWER_REFERENCE_EXT.
|
|
rpc:pinfo/2 is documented as a location-transparent version
of process_info/2. Therefore, it should be expected that
the spec would allow calls with an item list, for example:
rpc:pinfo(Pid, [initial_call,last_calls])
Report-URL: http://bugs.erlang.org/browse/ERL-124
Reported-by: bjfish
|
|
Verify with:
erl -noshell -eval 'io:write(inet_res:lookup("localhost",in,a)),io:nl(),init:stop().'
Prints:
[{127,0,0,1}]
Without this correction you will get [] on a hostname that works
later after system start.
|
|
* bjorn/kernel/remove-deprecated/OTP-13449:
rpc: Remove functions deprecated in R12B
|
|
OTP-13458
* dcorbacho/dist_util_logs:
Keep error reasons for some common distribution errors
|
|
|
|
code:set_path/1 no longer returns {error,bad_path} (an exception
will be thrown instead).
|
|
This is necessary for windows to perform correctly when writing
large files.
|
|
On Windows, the pathnames for modules that are loaded early are
returned with mixed backslashes and slashes:
1> code:which(lists).
"C:\\Program Files\\erl8.0/lib/stdlib-2.7/ebin/lists.beam"
2>
Modules loaded later are fully normalized.
When starting the code_server, normalize the pathnames for all modules
that have been loaded so far.
|
|
|
|
These error reasons can be seen in the logs after calling net_kernel:verbose(1).
|
|
* bjorn/kernel/rpc/OTP-13409:
Don't throw exceptions from rpc:call() and rpc:block_call()
Reduce code duplication in called_node_dies/1 and friends
|
|
* bjorn/clearer-startup-crashes/OTP-13294:
Make distribution failures during start-up easier to read
net_kernel: Separate exports into documented and non-documented groups
erl_distribution: Simplify start_link/0 and friends
Reorder and comment API functions
Clean up splitting of node names
|
|
When an attempt is made to start a distributed Erlang node with
the same name as an existing node, the crash reports for several
supervisors would be displayed. Only the first line contains
useful information. The verbiage is annoying for old hands and
could easily scare newcomers away for good.
For all the common distribution failures during start-up, write a
simple message and terminate the emulator using halt/1. Here is an
example of what will be printed:
Protocol 'inet_tcp': the name somename@somehost seems to be in use by another Erlang node
|
|
The documentation for rpc:call() says:
Evaluates apply(Module, Function, Args) on the node Node and
returns the corresponding value Res, or {badrpc, Reason} if
the call fails.
What is not said that rpc:call() can generate an exception if the
'rex' process on the other node is killed:
(kalle@host)1> Rex = rpc:call(arne@host, erlang, whereis, [rex]).
<6937.14.0>
(kalle@host)2> rpc:call(arne@host, erlang, exit, [Rex,kill]).
** exception exit: {killed,
{gen_server,call,
[{rex,arne@host},
{call,erlang,exit,[<6937.14.0>,kill],<0.33.0>},
infinity]}}
in function rpc:rpc_check/1 (rpc.erl, line 361)
On the other hand, if the other node shuts down for some other reason,
we'll get a {badrpc,nodedown} result:
(kalle@host)5> rpc:call(arne@host, erlang, halt, []).
{badrpc,nodedown}
There does not seem to be any reason to handle the two cases
differently. If the 'rex' process is terminated on the other node,
it will shut down shortly thereafter.
Therefore, change rpc:call() and rpc:block_call() to always return
{badrpc,Reason} is the call fails:
(kalle@host)1> Rex = rpc:call(arne@host, erlang, whereis, [rex]).
<6937.14.0>
(kalle@host)2> rpc:call(arne@host, erlang, exit, [Rex,kill]).
{badrpc,{'EXIT',{killed,{gen_server,call,
[{rex,arne@host},
{call,erlang,exit,[<7126.14.0>,kill],<0.33.0>},
infinity]}}}}
|
|
|
|
start_link/0 and friends are too convoluted for me.
|
|
Move all functions meant to be called from other modules before
the internal functions. Comment them to make it clearer what their
purpose are.
|
|
|
|
- The calling process is now suspended while synchronizing
scheduler suspends via erlang:system_flag(schedulers_online, _)
and erlang:system_flag(multi_scheduling, _), instead of blocking
the scheduler thread in the BIF call waiting for the operation
to synchronize. Besides releasing the scheduler for other work
(or immediate suspend) it also makes it possible to abort the
operation by killing the process.
- erlang:system_flag(schedulers_online, _) now only wait for normal
schedulers to complete before it returns. This since it may take
a very long time before all dirty schedulers suspends.
- erlang:system_flag(multi_scheduling, block_normal|unblock_normal)
which only operate on normal schedulers has been introduced. This
since there are use cases where suspend of dirty schedulers are
not of interest (hipe loader).
- erlang:system_flag(multi_scheduling, block) still blocks all
dirty schedulers as well as all normal schedulers except one since
it is hard to redefine what multi scheduling block means.
- The three operations:
- changing amount of schedulers online
- blocking/unblocking normal multi scheduling
- blocking/unblocking full multi scheduling
can now be done in parallel. This is important since otherwise
a full multi scheduling block would potentially delay the other
operations for a very long time.
|
|
* siri/appups-19.0:
Update appups in kernel, stdlib and sasl for OTP-19
|
|
|
|
* msantos/epmd-IPv6-node-reg2/PR-864/OTP-13364:
epmd: support IPv6 node registration
|
|
|
|
|
|
* siri/appups-18.3:
Update appups in kernel, stdlib and sasl for OTP-18.3
|
|
* bjorn/multiple-load/OTP-13111:
code: Add functions that can load multiple modules
Refactor post_beam_load handling
Simplify and robustify code_server:all_loaded/1
Update preloaded modules
Add erl_prim_loader:get_modules/3
Add has_prepared_code_on_load/1 BIF
Allow erlang:finish_loading/1 to load more than one module
beam_load.c: Add a function to check for an on_load function
|
|
Conflicts:
erts/emulator/beam/erl_alloc.types
erts/emulator/beam/erl_bif_info.c
erts/emulator/beam/erl_process.c
erts/preloaded/ebin/erts_internal.beam
|
|
|
|
Change scheduler responsiveness to 'check_schedulers'.
|
|
|
|
Add functions to 'code' to allow loading of multiple modules
at once.
code:atomic_load(Modules) will load all modules at once, or fail
having loaded none of them. Since we cannot guarantee the atomicity if
there are modules with -on_load functions, the list of modules must
not contain any modules with an -on_load function.
Also, to make it possible to put an application into an inactive state
for as short time as possible, also add code:prepare_loading/1 and
code:finish_loading/1. They are used like this:
{ok,Prepared} = code:prepare_loading(Modules)
.
.
.
ok = code:finish_loading(Prepared)
code:ensure_modules_loaded/1 is useful as a pure optimization to
ensure that modules that will be needed soon have indeed been
loaded. It will not reload modules that have already been loaded and
it *will* accept modules that have an on_load function. Therefore, it
does not make sense to give any atomicity guarantees.
I did consider overloading the existing code:ensure_loaded/1
function, but rejected it because the return value is very
different. Having different forms of return values depending
on the types of arguments is confusing.
|
|
After loading a module without native code, it is still necessary
to call hipe_unified_loader:post_beam_load() to ensure that any
native calls to the module is done to the newly loaded module
(and not to a previous version of the module in native code).
Unfortunately, hipe_unified_loader:post_beam_load() can be slow
and most of the time it doesn't do anything because no previous
native code was loaded. Therefore, ad2962278f added a kludge using
the process dictionary to avoid calling post_beam_load() if no
native code at all has been loaded.
Remove the kludge by keeping track exactly of which modules that
have native code in the existing ets table. Also generalize
post_beam_load() to handle severals modules at once, since we
will soon need that functionality.
|
|
The main ets table kept by code_server contains several pieces
of information. Therefore, code_server:all_loaded/1 need to
filter the information in the table.
code_server:all_loaded/1 can be simplified if we use
ets:select/2. Currently, the filtering is done by filtering
away unwanted stuff ({sticky_dir,Mod} tuples). It is more
robust to filter on the stuff that we want to keep
({Mod,Path} tuples, where Mod is an atom) in case that we'll
add more auxiliary records to the table later.
|
|
|
|
* bernardd/gen_tcp_export_socket:
Export gen_tcp:socket() type
OTP-13380
|
|
In addition, the heart API is extended with the following functions:
* heart:set_options/1
* heart:get_options/0
If heart:set_options([scheduler]) is set, heart will check
scheduler responsiveness before every heartbeat to the heart port.
|
|
* legoscia/prettier-default-error-logger/OTP-13325:
Prettify default error_logger output somewhat
|
|
* maint:
kernel: Correct contract for inet:getifaddrs/1
|
|
See also http://bugs.erlang.org/browse/ERL-95.
|
|
* maint:
xmerl: Remove 'no_return' Dialyzer warnings
xmerl: Add suppression of Dialyzer warnings
eunit: Add suppression of Dialyzer warnings
debugger: Add suppression of Dialyzer warnings
kernel: Add suppression of Dialyzer warnings
mnesia: Add suppression of Dialyzer warnings
observer: Add suppression of Dialyzer warnings
runtime_tools: Add suppression of Dialyzer warnings
stdlib: Add suppression of Dialyzer warnings
test_server: Add suppression of Dialyzer warnings
tools: Add suppression of Dialyzer warnings
Conflicts:
lib/stdlib/src/erl_lint.erl
lib/stdlib/src/otp_internal.erl
|
|
|
|
|
|
Before a heartbeat to the port program a responsiveness check of
the schedulers is performed. If the responsiveness check fails,
stalls, the heartbeat will not be performed (as intended).
|
|
* heart:set_callback/2
* heart:get_callback/0
* heart:clear_callback/0
The callback is called before every heartbeat to the heart port.
The callback needs to return 'ok' if the validation is correct.
|
|
|
|
The default error logger, the one in use before a more sophisticated
error logger can be installed, has rather terse output, in part because
it cannot rely on io:format. This patch attempts to improve the error
logger within that constraint:
- Print timestamps as YYYY-MM-DD HH:MM:SS
- For error reports with format strings, just print the format string
and the format arguments on separate lines
- For error reports with tuple lists, print each pair on a separate line
|