diff options
Diffstat (limited to 'lib/observer')
-rw-r--r-- | lib/observer/src/Makefile | 7 | ||||
-rw-r--r-- | lib/observer/src/observer_pro_wx.erl | 16 | ||||
-rw-r--r-- | lib/observer/src/observer_tv_wx.erl | 42 |
3 files changed, 36 insertions, 29 deletions
diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index f2f3f68115..19702d6d89 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -105,10 +105,7 @@ ERL_COMPILE_FLAGS += \ # ---------------------------------------------------- # Targets # ---------------------------------------------------- - -$(TARGET_FILES): $(INTERNAL_HRL_FILES) - -debug opt: $(TARGET_FILES) +opt debug: $(TARGET_FILES) clean: rm -f $(TARGET_FILES) @@ -120,6 +117,8 @@ $(APP_TARGET): $(APP_SRC) ../vsn.mk $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk sed -e 's;%VSN%;$(VSN);' $< > $@ +$(TARGET_FILES): $(INTERNAL_HRL_FILES) + docs: # ---------------------------------------------------- diff --git a/lib/observer/src/observer_pro_wx.erl b/lib/observer/src/observer_pro_wx.erl index e14cdc070c..85f84aa640 100644 --- a/lib/observer/src/observer_pro_wx.erl +++ b/lib/observer/src/observer_pro_wx.erl @@ -32,12 +32,12 @@ %% Defines -define(COL_PID, 0). --define(COL_NAME, 1). --define(COL_TIME, 2). --define(COL_REDS, 3). --define(COL_MEM, 4). --define(COL_MSG, 5). --define(COL_FUN, 6). +-define(COL_NAME, ?COL_PID+1). +%%-define(COL_TIME, 2). +-define(COL_REDS, ?COL_NAME+1). +-define(COL_MEM, ?COL_REDS+1). +-define(COL_MSG, ?COL_MEM+1). +-define(COL_FUN, ?COL_MSG+1). -define(ID_KILL, 201). -define(ID_PROC, 202). @@ -158,7 +158,7 @@ create_list_box(Panel, Holder) -> end, ListItems = [{"Pid", ?wxLIST_FORMAT_CENTRE, 120}, {"Name or Initial Func", ?wxLIST_FORMAT_LEFT, 200}, - {"Time", ?wxLIST_FORMAT_CENTRE, 50}, +%% {"Time", ?wxLIST_FORMAT_CENTRE, 50}, {"Reds", ?wxLIST_FORMAT_RIGHT, 100}, {"Memory", ?wxLIST_FORMAT_RIGHT, 100}, {"MsgQ", ?wxLIST_FORMAT_RIGHT, 50}, @@ -544,7 +544,7 @@ get_procinfo_data(Col, Info) -> col_to_element(?COL_PID) -> #etop_proc_info.pid; col_to_element(?COL_NAME) -> #etop_proc_info.name; col_to_element(?COL_MEM) -> #etop_proc_info.mem; -col_to_element(?COL_TIME) -> #etop_proc_info.runtime; +%%col_to_element(?COL_TIME) -> #etop_proc_info.runtime; col_to_element(?COL_REDS) -> #etop_proc_info.reds; col_to_element(?COL_FUN) -> #etop_proc_info.cf; col_to_element(?COL_MSG) -> #etop_proc_info.mq. diff --git a/lib/observer/src/observer_tv_wx.erl b/lib/observer/src/observer_tv_wx.erl index d0b07d5018..c25b395fda 100644 --- a/lib/observer/src/observer_tv_wx.erl +++ b/lib/observer/src/observer_tv_wx.erl @@ -121,10 +121,15 @@ handle_event(#wx{id=Id}, State = #state{node=Node, grid=Grid, opt=Opt0}) ?ID_UNREADABLE -> Opt0#opt{unread_hidden= not Opt0#opt.unread_hidden}; ?ID_SYSTEM_TABLES -> Opt0#opt{sys_hidden= not Opt0#opt.sys_hidden} end, - Tables = get_tables(Node, Opt), - Tabs = update_grid(Grid, Opt, Tables), - wxWindow:setFocus(Grid), - {noreply, State#state{opt=Opt, tabs=Tabs}}; + case get_tables2(Node, Opt) of + Error = {error, _} -> + self() ! Error, + {noreply, State}; + Tables -> + Tabs = update_grid(Grid, Opt, Tables), + wxWindow:setFocus(Grid), + {noreply, State#state{opt=Opt, tabs=Tabs}} + end; handle_event(#wx{event=#wxSize{size={W,_}}}, State=#state{grid=Grid}) -> observer_lib:set_listctrl_col_size(Grid, W), @@ -162,18 +167,17 @@ handle_event(#wx{id=?ID_REFRESH_INTERVAL}, Timer = observer_lib:interval_dialog(Grid, Timer0, 10, 5*60), {noreply, State#state{timer=Timer}}; -handle_event(Event, State) -> - io:format("~p:~p, handle event ~p\n", [?MODULE, ?LINE, Event]), - {noreply, State}. +handle_event(Event, _State) -> + error({unhandled_event, Event}). handle_sync_event(_Event, _Obj, _State) -> ok. -handle_call(_Event, _From, State) -> - {noreply, State}. +handle_call(Event, From, _State) -> + error({unhandled_call, Event, From}). -handle_cast(_Event, State) -> - {noreply, State}. +handle_cast(Event, _State) -> + error({unhandled_cast, Event}). handle_info(refresh_interval, State = #state{node=Node, grid=Grid, opt=Opt}) -> Tables = get_tables(Node, Opt), @@ -233,14 +237,18 @@ create_menus(Parent, #opt{sys_hidden=Sys, unread_hidden=UnR, type=Type}) -> ]}], observer_wx:create_menus(Parent, MenuEntries). -get_tables(Node, Opt) -> +get_tables(Node, Opts) -> + case get_tables2(Node, Opts) of + Error = {error, _} -> + self() ! Error, + []; + Res -> + Res + end. +get_tables2(Node, Opt) -> case rpc:call(Node, ?MODULE, get_table_list, [Opt]) of {badrpc, Error} -> - self() ! {error, Error}, - []; - {error, Error} -> - self() ! {error, Error}, - []; + {error, Error}; Result -> Result end. |