diff options
author | Björn-Egil Dahlberg <[email protected]> | 2012-04-13 15:22:18 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2012-04-13 15:22:18 +0200 |
commit | 861454268770e05bd72312c1a46560ed29a42500 (patch) | |
tree | c7b25f94799b72e908ce90cffbcfac7465de6752 /erts/emulator/beam/erl_process_lock.c | |
parent | b94070e8e7648273f097cb036764dba2fe51ddf7 (diff) | |
parent | efefd4bfda3156c6c19a61d7aa3d2f50a026d0e5 (diff) | |
download | otp-861454268770e05bd72312c1a46560ed29a42500.tar.gz otp-861454268770e05bd72312c1a46560ed29a42500.tar.bz2 otp-861454268770e05bd72312c1a46560ed29a42500.zip |
Merge branch 'rr/wa-lcnt/OTP-10051' into maint
* rr/wa-lcnt/OTP-10051:
lcnt: Let runq locks reflect actual call location
lcnt: Enhancement fixups
erts: Add lcnt port and suspend options
Increase ethr event and lock counting constants to allow at least +A 1024.
Diffstat (limited to 'erts/emulator/beam/erl_process_lock.c')
-rw-r--r-- | erts/emulator/beam/erl_process_lock.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_process_lock.c b/erts/emulator/beam/erl_process_lock.c index a5a753b798..b3b4601a31 100644 --- a/erts/emulator/beam/erl_process_lock.c +++ b/erts/emulator/beam/erl_process_lock.c @@ -1002,7 +1002,7 @@ erts_proc_lock_init(Process *p) #ifdef ERTS_ENABLE_LOCK_COUNT void erts_lcnt_proc_lock_init(Process *p) { - + if (erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK) { if (p->id != ERTS_INVALID_PID) { erts_lcnt_init_lock_x(&(p->lock.lcnt_main), "proc_main", ERTS_LCNT_LT_PROCLOCK, p->id); erts_lcnt_init_lock_x(&(p->lock.lcnt_msgq), "proc_msgq", ERTS_LCNT_LT_PROCLOCK, p->id); @@ -1014,6 +1014,12 @@ void erts_lcnt_proc_lock_init(Process *p) { erts_lcnt_init_lock(&(p->lock.lcnt_link), "proc_link", ERTS_LCNT_LT_PROCLOCK); erts_lcnt_init_lock(&(p->lock.lcnt_status), "proc_status", ERTS_LCNT_LT_PROCLOCK); } + } else { + sys_memzero(&(p->lock.lcnt_main), sizeof(p->lock.lcnt_main)); + sys_memzero(&(p->lock.lcnt_msgq), sizeof(p->lock.lcnt_msgq)); + sys_memzero(&(p->lock.lcnt_link), sizeof(p->lock.lcnt_link)); + sys_memzero(&(p->lock.lcnt_status), sizeof(p->lock.lcnt_status)); + } } @@ -1108,6 +1114,26 @@ void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res } } + +void erts_lcnt_enable_proc_lock_count(int enable) { + int i; + + for (i = 0; i < erts_max_processes; ++i) { + Process* p = process_tab[i]; + if (p) { + if (enable) { + if (!ERTS_LCNT_LOCK_TYPE(&(p->lock.lcnt_main))) { + erts_lcnt_proc_lock_init(p); + } + } else { + if (ERTS_LCNT_LOCK_TYPE(&(p->lock.lcnt_main))) { + erts_lcnt_proc_lock_destroy(p); + } + } + } + } +} + #endif /* ifdef ERTS_ENABLE_LOCK_COUNT */ |