diff options
author | Patrik Nyblom <[email protected]> | 2013-05-02 18:49:45 +0200 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2013-05-02 18:49:45 +0200 |
commit | 0c1ceeb0a30609a105dd69e000d1c391e2d2927e (patch) | |
tree | 71e3b189b1326b59d2564ea7769f6d30acc6327b /erts/emulator/beam/erl_port_task.c | |
parent | e086819ca3238e7b47e9e417e981cbba8fc3fbc1 (diff) | |
download | otp-0c1ceeb0a30609a105dd69e000d1c391e2d2927e.tar.gz otp-0c1ceeb0a30609a105dd69e000d1c391e2d2927e.tar.bz2 otp-0c1ceeb0a30609a105dd69e000d1c391e2d2927e.zip |
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.c | 13 |
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 0ed08bee01..9ba7704106 100644 --- a/erts/emulator/beam/erl_port_task.c +++ b/erts/emulator/beam/erl_port_task.c @@ -1578,6 +1578,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)); @@ -1639,6 +1640,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); @@ -1707,6 +1712,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); |