aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-04-10 17:01:41 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-04-10 17:12:18 +0200
commit769333459717d16dc6896b86b444205701e821e4 (patch)
tree2116deba1105d1325f341fd46720f80fb45237d4
parentdaf8f46c46745ebb6fcdfb226252c7823264a410 (diff)
downloadotp-769333459717d16dc6896b86b444205701e821e4.tar.gz
otp-769333459717d16dc6896b86b444205701e821e4.tar.bz2
otp-769333459717d16dc6896b86b444205701e821e4.zip
lcnt: Enhancement fixups
-rw-r--r--erts/emulator/beam/erl_bif_info.c11
-rw-r--r--erts/emulator/beam/erl_process_lock.c5
-rw-r--r--erts/emulator/beam/erl_process_lock.h2
-rw-r--r--erts/emulator/beam/global.h4
-rw-r--r--erts/emulator/beam/io.c8
5 files changed, 13 insertions, 17 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 02a463002c..060a52d220 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -4051,11 +4051,6 @@ static Eterm lcnt_build_result_term(Eterm **hpp, Uint *szp, erts_lcnt_data_t *da
}
#endif
-#ifdef ERTS_ENABLE_LOCK_COUNT
-void enable_io_lock_count(int enable);
-void enable_proc_lock_count(int enable);
-#endif
-
BIF_RETTYPE erts_debug_lock_counters_1(BIF_ALIST_1)
{
#ifdef ERTS_ENABLE_LOCK_COUNT
@@ -4147,13 +4142,15 @@ BIF_RETTYPE erts_debug_lock_counters_1(BIF_ALIST_1)
} else {
res = erts_lcnt_clear_rt_opt(opt) ? am_true : am_false;
}
+#ifdef ERTS_SMP
if (res != tp[2]) {
if (opt == ERTS_LCNT_OPT_PORTLOCK) {
- enable_io_lock_count(val);
+ erts_lcnt_enable_io_lock_count(val);
} else if (opt == ERTS_LCNT_OPT_PROCLOCK) {
- enable_proc_lock_count(val);
+ erts_lcnt_enable_proc_lock_count(val);
}
}
+#endif
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
BIF_RET(res);
diff --git a/erts/emulator/beam/erl_process_lock.c b/erts/emulator/beam/erl_process_lock.c
index 4437d46ff9..b3b4601a31 100644
--- a/erts/emulator/beam/erl_process_lock.c
+++ b/erts/emulator/beam/erl_process_lock.c
@@ -1114,11 +1114,8 @@ void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res
}
}
-void enable_proc_lock_count (int enable);
-void
-enable_proc_lock_count (int enable)
-{
+void erts_lcnt_enable_proc_lock_count(int enable) {
int i;
for (i = 0; i < erts_max_processes; ++i) {
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h
index 8dbdaccc68..413c45480c 100644
--- a/erts/emulator/beam/erl_process_lock.h
+++ b/erts/emulator/beam/erl_process_lock.h
@@ -215,6 +215,8 @@ void erts_lcnt_proc_lock_unaquire(erts_proc_lock_t *lock, ErtsProcLocks locks);
void erts_lcnt_proc_unlock(erts_proc_lock_t *lock, ErtsProcLocks locks);
void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res);
+void erts_lcnt_enable_proc_lock_count(int enable);
+
#endif /* ERTS_ENABLE_LOCK_COUNT*/
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index b000e2c5d4..fc4c0ba121 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1187,6 +1187,10 @@ void erts_fire_port_monitor(Port *prt, Eterm ref);
void erts_smp_xports_unlock(Port *);
#endif
+#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_COUNT)
+void erts_lcnt_enable_io_lock_count(int enable);
+#endif
+
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
int erts_lc_is_port_locked(Port *);
#endif
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index e8f04ef68a..53a25f5136 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -1396,12 +1396,8 @@ void init_io(void)
erts_smp_mtx_unlock(&erts_driver_list_lock);
}
-#ifdef ERTS_ENABLE_LOCK_COUNT
-void enable_io_lock_count (int enable);
-
-void
-enable_io_lock_count (int enable)
-{
+#if defined(ERTS_ENABLE_LOCK_COUNT) && defined(ERTS_SMP)
+void erts_lcnt_enable_io_lock_count(int enable) {
int i;
for (i = 0; i < erts_max_ports; i++) {