| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Scheduler names changed in OTP26, so we need a different `sed` expresion
to merge data from all schedulers. The example is now compatible with
versions prior to OTP26 and OTP26+
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than allowing modules to be writable all the time, either
through RWX pages or a dual-mapped RW page, support making them
writable only in the brief window that they are actually being
modified.
To avoid introducing subtle bugs this late in the release cycle,
we'll settle for adding assertions that modifications are only
made while a module is marked writable. We won't change any page
permissions just yet.
The one exception to this are the per-thread permissions on MacOS,
where a thread can temporarily trade permission to execute MAP_JIT
pages for being able to write to them. This permission is added
when making a module writable and removed when we're done. This
fixes the long-standing issue GH-4911 on Apple Silicon (Intel macs
are still affected since we don't want to give up W^X).
|
|\
| |
| | |
[erts] Implement call_memory tracing
|
| |
| |
| |
| |
| | |
Similar to call_time, erlang:trace_pattern(..., [call_memory]) accumulates
memory allocations, allowing for basic heap profiling.
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
john/erts/merge-isb-26
* john/erts/instruction-synchronization-barriers/OTP-18418:
jit: Clear instruction cache ourselves
jit: Refactor breakpoints
jit: Issue ISBs on all schedulers when modifying code
jit: Remove an eyesore
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The ARM reference manual, section B2.2.5, says that it's unsafe
to concurrently modify non-branch instructions. The hardware has
license to explode in our face even if we don't care whether the
new or old instruction executes.
To be safe, change the MOVZ in the breakpoint to a (slightly
slower) LDR in the fragment, letting us change the flag without
altering any instructions.
While we're at it we'll give x86 the same treatment. The Intel
manual is rather unclear about the subject, sometimes saying that
we don't need to do anything special[0] and sometimes that we
do[1]. I've decided to play it safe by only modifying the initial
jump, as there aren't as many things that could go wrong with that.
[0]: Intel 64/IA32 software dev manual Vol 3A, section 11.6
[1]: Intel 64/IA32 software dev manual Vol 3A, section 8.1.3
|
|\ \
| |/
| |
| |
| | |
* maint:
Fix a doc link to flamegraphs on the BeamAsm page
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because funs are tied to their canonical module rather than a
specific instance of a module, they are "moved over" to the newest
instance whenever we reload _the exact same module_ over itself.
This quirk, together with how fun entries are updated when a module
is loaded, caused a small window where it was possible for a holder
of an "old" fun to call the new instance before it was fully loaded.
This commit fixes that by versioning funs in roughly the same way
we do exports. It also fixes a related bug where fun purging could
be messed up if a new module instance was loaded in the middle of
purging, solving the issue by disallowing code loading while
purging a module with funs.
|
| |
|
|
|
|
|
|
| |
By breaking ArgVal into subtypes and only letting us take a value
when we have a concrete type, we reduce the risk of errors like
PR-5727 happening again.
|
| |
|
| |
|
| |
|
|\
| |
| | |
Add -nifs() attribute
|
| | |
|
|/ |
|
| |
|
|\
| |
| |
| |
| | |
* john/erts/improve-internal-tracing-documentation:
erts: Minor improvements to internal tracing doc
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
This lets `perf` and `gdb` show Erlang source code instead of just
saying "file.erl:1234"
OTP can be built with this information by passing it in the
`ERL_COMPILER_OPTIONS` environment variable:
ERL_COMPILER_OPTIONS="[absolute_source]" ./otp_build setup -a
|
|
|
|
|
|
|
|
|
|
|
|
| |
By making local and external funs share the same structure, we can
remove a substantial amount of code from the `call_fun` family of
instructions.
As a result fun calls are now about 15% faster with the interpreter
on my machine, 10% faster with the x64 JIT on that same machine,
and 15% faster with the AArch64 JIT on my M1 Mac. The improvement
is a bit less pronounced for funs with free variables, and a bit
more for those without (including external funs).
|
|\ |
|
| |
| |
| |
| | |
Add text explaineing some best practices for using YCF for ERTS.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
Change wording to be what I think was intended.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On April 9, 2021, we reached the prompt milestone (with -oldshell
option).
On April 15, 2021, we could run the entire compiler test suite without
crashing. The test suites for tools and debugger also ran
successfully.
On April 16, 2021, we could run the entire test suites for emulator
and stdlib.
Co-authored-by: John Högberg <john@erlang.org>
Co-authored-by: Sverker Eriksson <sverker@erlang.org>
|
| |
| |
| |
| |
| | |
This shaves off an allocation on each instruction as we can point
directly into the BeamOp's argument array.
|
|/
|
|
|
|
| |
This vastly improves `perf` accuracy and makes it usable on
platforms that don't support `--call-graph=lbr`, such as most
cloud environments.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
rickard/link-protocol-fix/master/OTP-17127
* rickard/link-protocol-fix/OTP-17127:
Improve documentation of links
Document the new link protocol
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This allows the JIT to be used on systems that enforce a W^X
policy.
To help catch related errors at compile time, all code pointers
have been marked `const`.
|
| | |
|
| |
| |
| |
| | |
The flavor to use for building the interpreter is `emu` not `jit`.
|
| |
| |
| |
| | |
The instruction builder functions are locatated in `jit` not `asm`.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Using perf dump is superior to using perf map as we are
able to use `perf annotate` which means we can view which
x86 assembly instruction was using the most CPU.
perf record -k mono erl +JPperf true
perf inject --jit -i perf.data -o perf.jitted.data
perf report -M intel -i perf.jitted.data
The implementation was inspired from the mono repo:
https://github.com/mono/mono/blob/master/mono/mini/mini-runtime.c
It should be easy to add support for Erlang source file and
line mapping if we want to do that.
|
| |
| |
| |
| |
| |
| | |
Co-authored-by: Lukas Larsson <lukas@erlang.org>
Co-authored-by: John Högberg <john@erlang.org>
Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
|
| |
| |
| |
| |
| |
| | |
Co-authored-by: Lukas Larsson <lukas@erlang.org>
Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
|
| |
| |
| |
| |
| |
| | |
Co-authored-by: John Högberg <john@erlang.org>
Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
|
| | |
|
|/
|
|
|
|
|
| |
The predicates (guard constraints) and generators for transformation
rules were static functions the `beam_load.c` source code files.
Break out the predicates and generators to `predicates.tab` and
`generators.tab`, respectively.
|
|
|
|
|
|
|
|
|
| |
The `ets:insert/2` and `ets:insert_new/2` functions did not yield even
when they were given long lists and a call to one of the functions did
only consume a single reduction. This commit fixes these problems.
The fix uses the "Yielding C Fun" tool to automatically generate
yieldable versions of C functions.
|
|
|
|
|
|
|
| |
Yielding C Fun (YCF) is a tool that generates yieldable versions of
functions written in the C programming language. This commit adds the
source code of YCF and a text describing the purpose of YCF
(`erts/emulator/internal_doc/AutomaticYieldingOfCCode.md`).
|
| |
|