From fdfd41eb1a033a5c0b5a9e61f6123d6d849a74f9 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 25 Apr 2013 18:50:23 +0200 Subject: Add documentation for new system_monitor --- erts/doc/src/erlang.xml | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index d85dff2c0c..dba34cc3f2 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -6137,7 +6137,7 @@ ok MonSettings -> {MonitorPid, Options} | undefined  MonitorPid = pid()  Options = [Option] -   Option = {long_gc, Time} | {large_heap, Size} | busy_port | busy_dist_port +   Option = {long_gc, Time} | {long_schedule, Time} | {large_heap, Size} | busy_port | busy_dist_port    Time = Size = integer() @@ -6171,7 +6171,7 @@ ok Set system performance monitoring options MonitorPid = pid() - Option = {long_gc, Time} | {large_heap, Size} | busy_port | busy_dist_port + Option = {long_gc, Time} | {long_schedule, Time} | {large_heap, Size} | busy_port | busy_dist_port  Time = Size = integer() MonSettings = {OldMonitorPid, [Option]}  OldMonitorPid = pid() @@ -6204,6 +6204,49 @@ ok notice.

+ {long_schedule, Time} + +

If a process or port in the system runs uninterrupted + for at least Time wall clock milliseconds, a + message {monitor, PidOrPort, long_schedule, Info} + is sent to MonitorPid. PidOrPort is the + process or port that was running and Info is a + list of two-element tuples describing the event. In case + of a pid(), the tuples {timeout, Millis}, + {in, Location} and {out, Location} will be + present, where Location is either an MFA + ({Module, Function, Arity}) describing the + function where the process was scheduled in/out, or the + atom undefined. In case of a port(), the + tuples {timeout, Millis} and {port_op,Op} + will be present. Op will be one of free, + timeout, input, output, + event or dist_cmd, depending on which + driver callback was executing. free is an + internal operation and should never appear, while the + others represent the corresponding driver callbacks + timeout, ready_input, ready_output, + event and finally outputv (when the port + is used by distribution). The Millis value in + the timeout tuple will tell you the actual + uninterrupted execution time of the process or port, + which will always be >= the Time value + supplied when starting the trace. New tuples may be + added to the Info lists in the future, and the + order of the tuples in the list may be changed at any + time without prior notice. +

+

This can be used to detect problems with NIF's or + drivers that takes too long to execute. Generally, 1 ms + is considered a good maximum time for a driver callback + or a NIF. However, a time sharing system should usually + consider everything below 100 ms as "possible" and + fairly "normal". Schedule times above that might however + indicate swapping or a NIF/driver that is + misbehaving. Misbehaving NIF's and drivers could cause + bad resource utilization and bad overall performance of + the system.

+
{large_heap, Size}

If a garbage collection in the system results in -- cgit v1.2.3