Skip to content

Commit

Permalink
erts: Add sessions for system_monitor
Browse files Browse the repository at this point in the history
How should the API look like?
Part of module trace? I have already reused the trace sessions.

Make it more like the trace functions that enable and disable
individual options. Old system_module API set the entire
state with each call.
  • Loading branch information
sverker committed Jul 11, 2024
1 parent 09f4612 commit 6b21389
Show file tree
Hide file tree
Showing 19 changed files with 879 additions and 239 deletions.
11 changes: 7 additions & 4 deletions erts/emulator/beam/bif.tab
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ bif erlang:make_tuple/3

bif erlang:system_flag/2
bif erlang:system_info/1
# New in R9C
bif erlang:system_monitor/0
bif erlang:system_monitor/1
bif erlang:system_monitor/2
# Added 2006-11-07
bif erlang:system_profile/2
# End Added 2006-11-07
Expand Down Expand Up @@ -805,3 +801,10 @@ bif erts_internal:trace_pattern/4
bif erts_internal:trace_info/3
bif erts_trace_cleaner:check/0
bif erts_trace_cleaner:send_trace_clean_signal/1

#
# New in 28
#
bif erts_internal:system_monitor/1
bif erts_internal:system_monitor/2
bif erts_internal:system_monitor/3
9 changes: 5 additions & 4 deletions erts/emulator/beam/dist.c
Original file line number Diff line number Diff line change
Expand Up @@ -3608,8 +3608,8 @@ erts_dsig_send(ErtsDSigSendContext *ctx)
if (ctx->fragments) {
ctx->c_p->flags |= F_FRAGMENTED_SEND;
retval = ERTS_DSIG_SEND_CONTINUE;
if (!resume && erts_system_monitor_flags.busy_dist_port)
monitor_generic(ctx->c_p, am_busy_dist_port, cid);
if (!resume && erts_system_monitor_busy_dist_port_cnt)
monitor_busy_dist_port(ctx->c_p, cid);
goto done;
}
}
Expand All @@ -3633,8 +3633,9 @@ erts_dsig_send(ErtsDSigSendContext *ctx)
port_str, remote_str, pid_str);
}
#endif
if (!resume && erts_system_monitor_flags.busy_dist_port)
monitor_generic(ctx->c_p, am_busy_dist_port, cid);
if (!resume && erts_system_monitor_busy_dist_port_cnt) {
monitor_busy_dist_port(ctx->c_p, cid);
}
retval = ERTS_DSIG_SEND_YIELD;
} else {
retval = ERTS_DSIG_SEND_OK;
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/beam/emu/beam_emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void process_main(ErtsSchedulerData *esdp)

ERTS_MSACC_UPDATE_CACHE_X();

if (erts_system_monitor_long_schedule != 0) {
if (erts_system_monitor_long_schedule_cnt != 0) {
start_time = erts_timestamp_millis();
start_time_i = c_p->i;
}
Expand Down
Loading

0 comments on commit 6b21389

Please sign in to comment.