Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0346-observer-What-to-do-with-bad-options.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0346-observer-What-to-do-with-bad-options.patch of Package erlang
From 90ba37e1086a0299ac7acb759c0af220a84d3c2a Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Thu, 31 Mar 2022 18:52:58 +0200 Subject: [PATCH 4/5] [observer] What to do with "bad" options Include "bad" options in the list, but not with a "value" (since we did not get any). Instead with something that will explain "something": A string; either "-", "Not Supported" or "error: ..." We can see what is missing and why (its better then nothing). Also, this is approx like what is done for socket. OTP-18012 --- lib/runtime_tools/src/observer_backend.erl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl index d4245d172c..5af565394c 100644 --- a/lib/runtime_tools/src/observer_backend.erl +++ b/lib/runtime_tools/src/observer_backend.erl @@ -63,7 +63,7 @@ vsn() -> socket_info() -> Info0 = socket:info(), {Counters, Info1} = maps:take(counters, Info0), - IovMax = maps:get(iov_max , Info1), + IovMax = maps:get(iov_max, Info1), NumMons = socket:number_of_monitors(), [{iov_max, IovMax}, {num_monitors, NumMons} | maps:to_list(Counters)]. @@ -240,14 +240,19 @@ get_sock_opts(Port, [Opt|Opts], Acc) -> {ok, [Res]} -> get_sock_opts(Port, Opts, [Res|Acc]); {ok, []} -> % No value? - get_sock_opts(Port, Opts, Acc); + Res = {Opt, "-"}, + get_sock_opts(Port, Opts, [Res|Acc]); {error, einval} -> - get_sock_opts(Port, Opts, Acc); + Res = {Opt, "Not Supported"}, + get_sock_opts(Port, Opts, [Res|Acc]); %% If the option is "invalid", the reason would be 'einval', - %% so this error must be something else => fail - {error, _} = ERROR -> - ERROR + %% so this error must be something else. + %% But if the option just vanish, we don't know what is + %% going on. So, do something similar to socket (see below). + {error, Reason} -> + Res = {Opt, f("error:~p", [Reason])}, + get_sock_opts(Port, Opts, [Res|Acc]) end. -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor