aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bp.c
AgeCommit message (Collapse)Author
2014-03-20Teach the call_time trace to notice when the trace dies (non-SMP system)Björn Gustavsson
The call_time trace is a special kind of tracing that requires a tracer process just like ordinary call trace, but it never actually sends anything to the tracer. It merely use the existence of a trace process (and call trace flags) as an indication that call_time tracing is active for the process. If the tracer dies in a non-SMP run-time system, processes with call_time tracing would not notice that the tracer had died. Furthermore, if the set_on_spawn flag was active, the dead tracer could be propagaged to newly spawned processes. Before accumulating trace information in a non-SMP system, always validate the tracer process. (In an SMP system, a reference to a dead tracer will be cleared away each time a process is scheduled.) While we could put all of the new code beam_bp.c, we have chosen to make a function call from beam_bp.c to a function in erl_trace.c for clarity's sake and to ease further maintenance. In the future, we might want to handle tracing in more similar ways in the SMP and non-SMP system.
2014-02-24erts: Make source file info available in lcLukas Larsson
2013-06-12Update copyright yearsBjörn-Egil Dahlberg
2013-02-28erts: Fix memleak related to meta tracingSverker Eriksson
2013-01-23Fix clang compiler warnings on FreeBSD in ertsPatrik Nyblom
The following are deliberately left, as I have only a list of compiler warnings and no system to test on: hipe/hipe_x86_signal.c:264:5: warning: no previous prototype for function '_sigaction' [-Wmissing-prototypes] int __SIGACTION(int signum, const struct sigaction *act, struct sigaction *oldact) ^ hipe/hipe_x86_signal.c:222:21: note: expanded from macro '__SIGACTION' ^ 1 warning generated. sys/unix/sys_float.c:835:16: warning: declaration of 'struct exception' will not be visible outside of this function [-Wvisibility] matherr(struct exception *exc) ^ sys/unix/sys_float.c:835:1: warning: no previous prototype for function 'matherr' [-Wmissing-prototypes] matherr(struct exception *exc) ^ 2 warnings generated. drivers/unix/unix_efile.c:1504:11: warning: implicit declaration of function 'sendfile' [-Wimplicit-function-declaration] retval = sendfile(in_fd, out_fd, *offset, SENDFILE_CHUNK_SIZE, ^ 1 warning generated.
2012-12-14Merge branch 'sverk/egil/r16/new-alloc-header-scheme/OTP-10273'Björn-Egil Dahlberg
OTP-10415 * sverk/egil/r16/new-alloc-header-scheme/OTP-10273: (42 commits) erts: Make ll main mbc fit into 2pow size erts: Clear entire mseg cache upon request erts: Reduce max heap sizes tests: Refactor away ?line macro in beam_SUITE tests: Fix heap_sizes check tests: Refactor away ?line macro in process_SUITE tests: Use new correct min_bin_vheap_size in test erts: Set super alignment (256kb) and limits for sbct (8Mb) and lmbcs (128Mb) erts: Do not cache segments that are misaligned erts: Add mseg cache for large sbc segments erts: Reintroduce mseg options amcbf and rmcbf erts: Optimize erl_alloc_util.c by substitute MBC_BLK_SZ erts: Fix bug when allocating size near sbc_threshold erts: Make gc sizes fit into MB Carrier blocks erts: Force sbmbc to be disabled in a crude way erts: Fix new header scheme for win64 erts: Fix mseg cache. Malplaced NULL pointer erts: Remove unused mseg options amcbf and rmcbf erts: Use aligned bits as constant in mseg_alloc erts: Don't let zero be considered a power of two ... Conflicts: erts/emulator/test/process_SUITE.erl
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-03Prepare for use of ptab functionality also for portsRickard Green
2012-11-13erts: Fix compiler warnings for halfword vmSverker Eriksson
2012-08-31erts: Refactor naming regarding code_write_permissionSverker Eriksson
The concept of code_write_permission is used by tracing as well and is not specific to code_ix.
2012-08-31erts: Remove some compiler warningsSverker Eriksson
2012-06-25Don't go to single-scheduler mode when managing breakpointsBjörn Gustavsson
Calls to erlang:set_trace_pattern/3 will no longer block all other schedulers. We will still go to single-scheduler mode when new code is loaded for a module that is traced, or when loading code when there is a default trace pattern set. That is not impossible to fix, but that requires much closer cooperation between tracing BIFs and the loader BIFs.
2012-06-25Refactor the code for managing breakpointsBjörn Gustavsson
To allow us to manage breakpoints without going to single-scheduler mode, we will need to update the breakpoints in several stages with memory barriers in between each stage. Prepare for that by splitting up the breakpoint setting and clearing functions into several smaller functions.
2012-06-25Change the data structures for breakpointsBjörn Gustavsson
Change the data structures for breakpoints to make it possible (in a future commit) to manage breakpoints without taking down the system to single-scheduling mode. The current "breakpoint wheel" data structure (a circular, double-linked list of breakpoints) was invented before the SMP emulator. To support it in the SMP emulator, there is essentially one breakpoint wheel per scheduler. As more breakpoint types have been added, the implementation has become messy and hard to understand and maintain. Therefore, the time for a rewrite has come. Use one struct to hold all breakpoint data for a breakpoint in a function. Use a flag field to indicate what different type of break actions that are enabled.
2012-04-27Merge branch 'rickard/proc-sched/OTP-9892'Rickard Green
* rickard/proc-sched/OTP-9892: Teach etp-commands to understand new emulator internal data structures Optimize process state changes Optimize process table access Implement possibility to use ordinary mutexes as process locks Conflicts: erts/emulator/beam/erl_alloc.types
2012-04-27Optimize process state changesRickard Green
2012-04-16Optimize process table accessRickard Green
2012-03-30Merge branch 'maint'Björn-Egil Dahlberg
2012-03-30Update copyright yearsBjörn-Egil Dahlberg
2012-02-21erts: Move number-of-breakpoint counter from code to Module structSverker Eriksson
The is a refactoring in preparation to add a counter in Module struct for export entry tracing. It is nicer if the two are kept together.
2012-02-21erts: Multiple module tables using code_ixSverker Eriksson
2012-02-21erts: Refactor Module structSverker Eriksson
2012-02-01beam_bp: Fix faulty assertion in erts_find_local_func()Björn Gustavsson
Commit 64ccd8c9b7a782ca777ca4649dbb1f4a1ef00bce introduced BIF stubs. The stub functions were not actually remove the loaded code, but the name of the function in the func_info instruction was changed to [] to mark it as invalid.
2012-01-25Fix crash in trace_info({M,F,A}, Flags) when M:F/A has native codeBjörn Gustavsson
2011-11-25Fix clang linking problemBjörn Gustavsson
Inlining was not done in a portable way. clang follows the C99 semantics for inlining ('inline' essentially implies 'static' in C99, but not in GCC), so bp_sched2ix() was not visible outside beam_bp.c. Since the function need to be used from more than one source file, put the function definition in the beam_bp.h header file. Also, give it an 'erts_' prefix since it is globally visible.
2011-11-13Merge branch 'rickard/thr-progress-block/OTP-9631'Rickard Green
* rickard/thr-progress-block/OTP-9631: Replace system block with thread progress block
2011-11-13Replace system block with thread progress blockRickard Green
The ERTS internal system block functionality has been replaced by new functionality for blocking the system. The old system block functionality had contention issues and complexity issues. The new functionality piggy-backs on thread progress tracking functionality needed by newly introduced lock-free synchronization in the runtime system. When the functionality for blocking the system isn't used there is more or less no overhead at all. This since the functionality for tracking thread progress is there and needed anyway.
2011-11-07erts: remove debug variables in beam_bpBjörn-Egil Dahlberg
2011-06-14Use new atomic API in runtime systemRickard Green
All uses of the old deprecated atomic API in the runtime system have been replaced with the use of the new atomic API. In a lot of places this change imply a relaxation of memory barriers used.
2010-12-15Use new atomic types in emulatorRickard Green
2010-06-03Fix bp_hash_put to do hash value after rehashBjörn-Egil Dahlberg
If a rehash was done the old hash value was used. This was incorrect.
2010-06-03Fix assertion in trace_pattern for bifsBjörn-Egil Dahlberg
2010-06-03Teach call time trace patterns to include bifsBjörn-Egil Dahlberg
2010-06-03Teach call count tracing to use atomicsBjörn-Egil Dahlberg
Call count previously used a global lock for accessing and writing its counter in the breakpoint. This is now changed to atomics instead. The change will let call count tracing and cprof to scale better when increasing the number of schedulers.
2010-06-03Add a scheduler array for BpData at BeamInstr[-4]Björn-Egil Dahlberg
To solve the issue of multiple schedulers constantly updating the head pointer to the bp data wheel, each scheduler now has its own entrypoint to the wheel. This head pointer can be updated without a locking being taken. Previously there were no lock ...
2010-06-03Add search keys in breakpoints and a searchfunctionBjörn-Egil Dahlberg
2010-06-03Teach call_time trace to use intruction pointersBjörn-Egil Dahlberg
call_time trace will use instruction pointers instead of breakpoint data pointers. More costly lookup but the bdt structure might be deallocated, we do not want that. Remove unnecessary pattern lock.
2010-06-03Add return_time trace and PSD deletionsBjörn-Egil Dahlberg
2010-06-03Fix set_function_break to use correct breakpointBjörn-Egil Dahlberg
op_i_time_breakpoint is now used
2010-06-03Add processes hashes for call time breakpointsBjörn-Egil Dahlberg
Call time breakpoint tracing traces per call trace per process. - Add hashes to support the extra dimension. - Teach trace_info/2 to handle the extra information dimension.
2010-06-03Call time breakpoint tracing frameworkBjörn-Egil Dahlberg
Initial commit with a new breakpoint instruction and PSD areas for temporary time storage during tracing.
2010-03-22Merge branch 'pan/otp_8332_halfword' into devErlang/OTP
* pan/otp_8332_halfword: Teach testcase in driver_suite the new prototype for driver_async wx: Correct usage of driver callbacks from wx thread Adopt the new (R13B04) Nif functionality to the halfword codebase Support monitoring and demonitoring from driver threads Fix further test-suite problems Correct the VM to work for more test suites Teach {wordsize,internal|external} to system_info/1 Make tracing and distribution work Turn on instruction packing in the loader and virtual machine Add the BeamInstr data type for loaded BEAM code Fix the BEAM dissambler for the half-word emulator Store pointers to heap data in 32-bit words Add a custom mmap wrapper to force heaps into the lower address range Fit all heap data into the 32-bit address range
2010-03-10Add the BeamInstr data type for loaded BEAM codePatrik Nyblom
For cleanliness, use BeamInstr instead of the UWord data type to any machine-sized words that are used for BEAM instructions. Only use UWord for untyped words in general.
2010-03-10Store pointers to heap data in 32-bit wordsPatrik Nyblom
Store Erlang terms in 32-bit entities on the heap, expanding the pointers to 64-bit when needed. This works because all terms are stored on addresses in the 32-bit address range (the 32 most significant bits of pointers to term data are always 0). Introduce a new datatype called UWord (along with its companion SWord), which is an integer having the exact same size as the machine word (a void *), but might be larger than Eterm/Uint. Store code as machine words, as the instructions are pointers to executable code which might reside outside the 32-bit address range. Continuation pointers are stored on the 32-bit stack and hence must point to addresses in the low range, which means that loaded beam code much be placed in the low 32-bit address range (but, as said earlier, the instructions themselves are full words). No Erlang term data can be stored on C stacks (enforced by an earlier commit). This version gives a prompt, but test cases still fail (and dump core). The loader (and emulator loop) has instruction packing disabled. The main issues has been in rewriting loader and actual virtual machine. Subsystems (like distribution) does not work yet.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP