aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_port_task.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-06-05 15:30:22 +0200
committerPatrik Nyblom <[email protected]>2013-06-05 15:30:22 +0200
commiteedd89fcb0b892117b798b8b097cf63b9ab59db7 (patch)
treef9dfcca0ea758fca35f6f94b98c4b013ac255103 /erts/emulator/beam/erl_port_task.c
parent620b7e879c9943e1e79990ed0a825228f7b18b04 (diff)
parenteb4d4c133a8c2ad00807888289cb99d67f70896f (diff)
downloadotp-eedd89fcb0b892117b798b8b097cf63b9ab59db7.tar.gz
otp-eedd89fcb0b892117b798b8b097cf63b9ab59db7.tar.bz2
otp-eedd89fcb0b892117b798b8b097cf63b9ab59db7.zip
Merge branch 'pan/r16b01/system_monitor_long_schedule/OTP-11067' into maint
* pan/r16b01/system_monitor_long_schedule/OTP-11067: Minor spelling correction Add system_monitor of long_schedule
Diffstat (limited to 'erts/emulator/beam/erl_port_task.c')
-rw-r--r--erts/emulator/beam/erl_port_task.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c
index f753de8f52..7d53ce7152 100644
--- a/erts/emulator/beam/erl_port_task.c
+++ b/erts/emulator/beam/erl_port_task.c
@@ -1594,6 +1594,7 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
int fpe_was_unmasked;
erts_aint32_t state;
int active;
+ Uint64 start_time = 0;
ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
@@ -1655,6 +1656,10 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
reset_handle(ptp);
+ if (erts_system_monitor_long_schedule != 0) {
+ start_time = erts_timestamp_millis();
+ }
+
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(pp));
ERTS_SMP_CHK_NO_PROC_LOCKS;
ASSERT(pp->drv_ptr);
@@ -1723,6 +1728,14 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
reds += erts_port_driver_callback_epilogue(pp, &state);
+ if (start_time != 0) {
+ Sint64 diff = erts_timestamp_millis() - start_time;
+ if (diff > 0 && (Uint) diff > erts_system_monitor_long_schedule) {
+ monitor_long_schedule_port(pp,ptp->type,(Uint) diff);
+ }
+ }
+ start_time = 0;
+
aborted_port_task:
schedule_port_task_free(ptp);