diff options
Diffstat (limited to 'lib/observer/src')
-rw-r--r-- | lib/observer/src/Makefile | 46 | ||||
-rw-r--r-- | lib/observer/src/cdv_atom_cb.erl (renamed from lib/observer/src/cdv_atom_wx.erl) | 4 | ||||
-rw-r--r-- | lib/observer/src/cdv_bin_cb.erl (renamed from lib/observer/src/cdv_bin_wx.erl) | 26 | ||||
-rw-r--r-- | lib/observer/src/cdv_detail_wx.erl (renamed from lib/observer/src/cdv_detail_win.erl) | 2 | ||||
-rw-r--r-- | lib/observer/src/cdv_dist_cb.erl (renamed from lib/observer/src/cdv_dist_wx.erl) | 8 | ||||
-rw-r--r-- | lib/observer/src/cdv_ets_cb.erl (renamed from lib/observer/src/cdv_ets_wx.erl) | 4 | ||||
-rw-r--r-- | lib/observer/src/cdv_fun_cb.erl (renamed from lib/observer/src/cdv_fun_wx.erl) | 4 | ||||
-rw-r--r-- | lib/observer/src/cdv_gen_cb.erl (renamed from lib/observer/src/cdv_gen_wx.erl) | 2 | ||||
-rw-r--r-- | lib/observer/src/cdv_html_wx.erl (renamed from lib/observer/src/cdv_html_page.erl) | 12 | ||||
-rw-r--r-- | lib/observer/src/cdv_info_wx.erl (renamed from lib/observer/src/cdv_info_page.erl) | 6 | ||||
-rw-r--r-- | lib/observer/src/cdv_int_tab_cb.erl (renamed from lib/observer/src/cdv_int_tab_wx.erl) | 8 | ||||
-rw-r--r-- | lib/observer/src/cdv_mem_cb.erl (renamed from lib/observer/src/cdv_mem_wx.erl) | 8 | ||||
-rw-r--r-- | lib/observer/src/cdv_mod_cb.erl (renamed from lib/observer/src/cdv_mod_wx.erl) | 10 | ||||
-rw-r--r-- | lib/observer/src/cdv_multi_wx.erl (renamed from lib/observer/src/cdv_multi_panel.erl) | 2 | ||||
-rw-r--r-- | lib/observer/src/cdv_port_cb.erl (renamed from lib/observer/src/cdv_port_wx.erl) | 11 | ||||
-rw-r--r-- | lib/observer/src/cdv_proc_cb.erl (renamed from lib/observer/src/cdv_proc_wx.erl) | 23 | ||||
-rw-r--r-- | lib/observer/src/cdv_table_wx.erl (renamed from lib/observer/src/cdv_table_page.erl) | 4 | ||||
-rw-r--r-- | lib/observer/src/cdv_term_cb.erl (renamed from lib/observer/src/cdv_term_wx.erl) | 20 | ||||
-rw-r--r-- | lib/observer/src/cdv_timer_cb.erl (renamed from lib/observer/src/cdv_timer_wx.erl) | 4 | ||||
-rw-r--r-- | lib/observer/src/cdv_virtual_list_wx.erl (renamed from lib/observer/src/cdv_virtual_list.erl) | 14 | ||||
-rw-r--r-- | lib/observer/src/cdv_wx.erl (renamed from lib/observer/src/crashdump_viewer_wx.erl) | 24 | ||||
-rw-r--r-- | lib/observer/src/crashdump_viewer.erl | 10 | ||||
-rw-r--r-- | lib/observer/src/observer.app.src | 24 | ||||
-rw-r--r-- | lib/observer/src/observer_html_lib.erl (renamed from lib/observer/src/crashdump_viewer_html.erl) | 2 | ||||
-rw-r--r-- | lib/observer/src/observer_procinfo.erl | 12 |
25 files changed, 155 insertions, 135 deletions
diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index 0b1813db0a..fc6f51c617 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -36,36 +36,34 @@ RELSYSDIR = $(RELEASE_PATH)/lib/observer-$(VSN) MODULES= \ crashdump_viewer \ - crashdump_viewer_html \ - crashdump_viewer_wx \ - cdv_info_page \ - cdv_virtual_list \ - cdv_detail_win \ - cdv_table_page \ - cdv_multi_panel \ - cdv_html_page \ - cdv_gen_wx \ - cdv_proc_wx \ - cdv_port_wx \ - cdv_ets_multi_wx \ - cdv_ets_wx \ - cdv_timer_wx \ - cdv_fun_wx \ - cdv_atom_wx \ - cdv_dist_wx \ - cdv_mod_wx \ - cdv_mem_wx \ - cdv_int_tab_wx \ - cdv_bin_wx \ - cdv_term_wx \ + cdv_atom_cb \ + cdv_bin_cb \ + cdv_detail_wx \ + cdv_dist_cb \ + cdv_ets_cb \ + cdv_fun_cb \ + cdv_gen_cb \ + cdv_html_wx \ + cdv_info_wx \ + cdv_int_tab_cb \ + cdv_mem_cb \ + cdv_mod_cb \ + cdv_multi_wx \ + cdv_port_cb \ + cdv_proc_cb \ + cdv_table_wx \ + cdv_term_cb \ + cdv_timer_cb \ + cdv_virtual_list_wx \ + cdv_wx \ etop \ etop_gui \ etop_tr \ etop_txt \ observer \ observer_app_wx \ + observer_html_lib \ observer_lib \ - observer_wx \ observer_perf_wx \ observer_pro_wx \ observer_procinfo \ @@ -74,7 +72,7 @@ MODULES= \ observer_traceoptions_wx \ observer_tv_table \ observer_tv_wx \ - observer_term_wx \ + observer_wx \ ttb \ ttb_et diff --git a/lib/observer/src/cdv_atom_wx.erl b/lib/observer/src/cdv_atom_cb.erl index 372badc944..46fce81b52 100644 --- a/lib/observer/src/cdv_atom_wx.erl +++ b/lib/observer/src/cdv_atom_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_atom_wx). +-module(cdv_atom_cb). -export([col_to_elem/1, col_spec/0, @@ -28,7 +28,7 @@ -define(COL_ID, 0). -define(COL_ATOM, ?COL_ID+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_ID); col_to_elem(Id) -> Id+1. diff --git a/lib/observer/src/cdv_bin_wx.erl b/lib/observer/src/cdv_bin_cb.erl index 6cf344f945..0266047ee3 100644 --- a/lib/observer/src/cdv_bin_wx.erl +++ b/lib/observer/src/cdv_bin_cb.erl @@ -15,12 +15,12 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_bin_wx). +-module(cdv_bin_cb). -export([get_details/1, detail_pages/0]). -%% Callbacks for cdv_detail_win +%% Callbacks for cdv_detail_wx get_details({_, {T,Key}}) -> [{Key,Term}] = ets:lookup(T,Key), {ok,{"Expanded Binary", Term, []}}; @@ -32,15 +32,15 @@ detail_pages() -> [{"Binary", fun init_bin_page/2}]. init_bin_page(Parent,Bin) -> - cdv_multi_panel:start_link( + cdv_multi_wx:start_link( Parent, - [{"Format \~p",cdv_html_page,format_bin_fun("~p",Bin)}, - {"Format \~tp",cdv_html_page,format_bin_fun("~tp",Bin)}, - {"Format \~w",cdv_html_page,format_bin_fun("~w",Bin)}, - {"Format \~s",cdv_html_page,format_bin_fun("~s",Bin)}, - {"Format \~ts",cdv_html_page,format_bin_fun("~ts",Bin)}, - {"Hex",cdv_html_page,hex_binary_fun(Bin)}, - {"Term",cdv_html_page, binary_to_term_fun(Bin)}]). + [{"Format \~p",cdv_html_wx,format_bin_fun("~p",Bin)}, + {"Format \~tp",cdv_html_wx,format_bin_fun("~tp",Bin)}, + {"Format \~w",cdv_html_wx,format_bin_fun("~w",Bin)}, + {"Format \~s",cdv_html_wx,format_bin_fun("~s",Bin)}, + {"Format \~ts",cdv_html_wx,format_bin_fun("~ts",Bin)}, + {"Hex",cdv_html_wx,hex_binary_fun(Bin)}, + {"Term",cdv_html_wx,binary_to_term_fun(Bin)}]). format_bin_fun(Format,Bin) -> fun() -> @@ -48,7 +48,7 @@ format_bin_fun(Format,Bin) -> Str -> plain_html(lists:flatten(Str)) catch error:badarg -> Warning = "This binary can not be formatted with " ++ Format, - crashdump_viewer_html:warning(Warning) + observer_html_lib:warning(Warning) end end. @@ -58,7 +58,7 @@ binary_to_term_fun(Bin) -> Term -> plain_html(io_lib:format("~p",[Term])) catch error:badarg -> Warning = "This binary can not be coverted to an Erlang term", - crashdump_viewer_html:warning(Warning) + observer_html_lib:warning(Warning) end end. @@ -79,4 +79,4 @@ format_hex(<<B1:4,B2:4,Bin/binary>>,N) -> | format_hex(Bin,N-1)]. plain_html(Text) -> - crashdump_viewer_html:plain_page(Text). + observer_html_lib:plain_page(Text). diff --git a/lib/observer/src/cdv_detail_win.erl b/lib/observer/src/cdv_detail_wx.erl index 4445169379..dc93507a36 100644 --- a/lib/observer/src/cdv_detail_win.erl +++ b/lib/observer/src/cdv_detail_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_detail_win). +-module(cdv_detail_wx). -behaviour(wx_object). diff --git a/lib/observer/src/cdv_dist_wx.erl b/lib/observer/src/cdv_dist_cb.erl index 3910f4fac5..3860324d6f 100644 --- a/lib/observer/src/cdv_dist_wx.erl +++ b/lib/observer/src/cdv_dist_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_dist_wx). +-module(cdv_dist_cb). -export([col_to_elem/1, col_spec/0, @@ -34,7 +34,7 @@ -define(COL_CH, ?COL_CTRL+1). -define(COL_CRE, ?COL_CH+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_CH); col_to_elem(?COL_NAME) -> #nod.name; col_to_elem(?COL_CH) -> #nod.channel; @@ -56,7 +56,7 @@ get_info(_) -> get_detail_cols(_) -> {[?COL_CH,?COL_CTRL],true}. -%% Callbacks for cdv_detail_win +%% Callbacks for cdv_detail_wx get_details(Id) -> case crashdump_viewer:node_info(Id) of {ok,Info,TW} -> @@ -73,7 +73,7 @@ detail_pages() -> init_gen_page(Parent, Info) -> Fields = info_fields(), - cdv_info_page:start_link(Parent,{Fields,Info,[]}). + cdv_info_wx:start_link(Parent,{Fields,Info,[]}). %%%----------------------------------------------------------------- %%% Internal diff --git a/lib/observer/src/cdv_ets_wx.erl b/lib/observer/src/cdv_ets_cb.erl index ac45aa297e..2a5c170e58 100644 --- a/lib/observer/src/cdv_ets_wx.erl +++ b/lib/observer/src/cdv_ets_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_ets_wx). +-module(cdv_ets_cb). -export([col_to_elem/1, col_spec/0, @@ -35,7 +35,7 @@ -define(COL_MEM, ?COL_OBJ+1). -define(COL_TYPE, ?COL_MEM+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_ID); col_to_elem(?COL_ID) -> #ets_table.id; col_to_elem(?COL_NAME) -> #ets_table.name; diff --git a/lib/observer/src/cdv_fun_wx.erl b/lib/observer/src/cdv_fun_cb.erl index 296abd2719..689ef0e3bb 100644 --- a/lib/observer/src/cdv_fun_wx.erl +++ b/lib/observer/src/cdv_fun_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_fun_wx). +-module(cdv_fun_cb). -export([col_to_elem/1, col_spec/0, @@ -33,7 +33,7 @@ -define(COL_NADDR, ?COL_ADDR+1). -define(COL_REFC, ?COL_NADDR+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_MOD); col_to_elem(?COL_MOD) -> #fu.module; col_to_elem(?COL_UNIQ) -> #fu.uniq; diff --git a/lib/observer/src/cdv_gen_wx.erl b/lib/observer/src/cdv_gen_cb.erl index 92759aaa6d..6be717d76d 100644 --- a/lib/observer/src/cdv_gen_wx.erl +++ b/lib/observer/src/cdv_gen_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_gen_wx). +-module(cdv_gen_cb). -export([get_info/0]). diff --git a/lib/observer/src/cdv_html_page.erl b/lib/observer/src/cdv_html_wx.erl index 0208d1d67a..fe77a41f59 100644 --- a/lib/observer/src/cdv_html_page.erl +++ b/lib/observer/src/cdv_html_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_html_page). +-module(cdv_html_wx). -behaviour(wx_object). @@ -87,23 +87,23 @@ handle_event(#wx{event=#wxHtmlLink{type=command_html_link_clicked, Id = {cdv, {list_to_integer(Off), list_to_integer(Size), list_to_integer(Pos)}}, - expand(Id,cdv_bin_wx,State); + expand(Id,cdv_bin_cb,State); "#OBSBinary?" ++ BinSpec -> [{"key1",Preview},{"key2",Size},{"key3",Hash}] = httpd:parse_query(BinSpec), Id = {obs, {Tab, {list_to_integer(Preview), list_to_integer(Size), list_to_integer(Hash)}}}, - expand(Id,cdv_bin_wx,State); + expand(Id,cdv_bin_cb,State); "#Term?" ++ TermKeys -> [{"key1",Key1},{"key2",Key2},{"key3",Key3}] = httpd:parse_query(TermKeys), Id = {cdv, {Tab,{list_to_integer(Key1), list_to_integer(Key2), list_to_integer(Key3)}}}, - expand(Id,cdv_term_wx,State); + expand(Id,cdv_term_cb,State); _ -> - cdv_virtual_list:start_detail_win(Target), + cdv_virtual_list_wx:start_detail_win(Target), State end, {noreply, NewState}; @@ -118,7 +118,7 @@ expand(Id,Callback,#state{expand_wins=Opened0}=State) -> Opened = case lists:keyfind(Id,1,Opened0) of false -> - EW = cdv_detail_win:start_link(Id,State#state.panel,Callback), + EW = cdv_detail_wx:start_link(Id,State#state.panel,Callback), wx_object:get_pid(EW) ! active, [{Id,EW}|Opened0]; {_,EW} -> diff --git a/lib/observer/src/cdv_info_page.erl b/lib/observer/src/cdv_info_wx.erl index 27eb71225d..59ce0cabb1 100644 --- a/lib/observer/src/cdv_info_page.erl +++ b/lib/observer/src/cdv_info_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_info_page). +-module(cdv_info_wx). -behaviour(wx_object). @@ -60,7 +60,7 @@ init([ParentWin, {InfoFields,Info,TW}]) -> %%%%%%%%%%%%%%%%%%%%%%% Callbacks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% handle_info(active, State) -> - crashdump_viewer_wx:set_status(State#state.trunc_warn), + cdv_wx:set_status(State#state.trunc_warn), {noreply, State}; handle_info(Info, State) -> @@ -95,7 +95,7 @@ handle_cast(Msg, State) -> {noreply, State}. handle_event(#wx{event=#wxMouse{type=left_down},userData=Target}, State) -> - cdv_virtual_list:start_detail_win(Target), + cdv_virtual_list_wx:start_detail_win(Target), {noreply, State}; handle_event(#wx{obj=Obj,event=#wxMouse{type=enter_window}},State) -> diff --git a/lib/observer/src/cdv_int_tab_wx.erl b/lib/observer/src/cdv_int_tab_cb.erl index b4fa6ca889..31727391fe 100644 --- a/lib/observer/src/cdv_int_tab_wx.erl +++ b/lib/observer/src/cdv_int_tab_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_int_tab_wx). +-module(cdv_int_tab_cb). -export([get_info/0]). @@ -30,9 +30,9 @@ get_info() -> observer_lib:report_progress({ok,66}), IntEtsInfo = get_internal_ets_info(), observer_lib:report_progress({ok,100}), - [{"Hash Tables",cdv_table_page,HashInfo}, - {"Index Tables",cdv_table_page,IndexInfo}, - {"Internal ETS Tables",cdv_table_page,IntEtsInfo}]. + [{"Hash Tables",cdv_table_wx,HashInfo}, + {"Index Tables",cdv_table_wx,IndexInfo}, + {"Internal ETS Tables",cdv_table_wx,IntEtsInfo}]. %%%----------------------------------------------------------------- %%% Hash tables diff --git a/lib/observer/src/cdv_mem_wx.erl b/lib/observer/src/cdv_mem_cb.erl index 673795f39d..2b0809df13 100644 --- a/lib/observer/src/cdv_mem_wx.erl +++ b/lib/observer/src/cdv_mem_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_mem_wx). +-module(cdv_mem_cb). -export([get_info/0]). @@ -30,10 +30,10 @@ get_info() -> observer_lib:report_progress({ok,66}), AreaInfo = get_area_info(), observer_lib:report_progress({ok,100}), - [{"Memory",cdv_info_page,MemInfo} - | [{Title,cdv_table_page,{Cols,Data,AllocTW}} || + [{"Memory",cdv_info_wx,MemInfo} + | [{Title,cdv_table_wx,{Cols,Data,AllocTW}} || {Title,Cols,Data} <- AllocInfo]] ++ - [{"Allocated Areas",cdv_table_page,AreaInfo}]. + [{"Allocated Areas",cdv_table_wx,AreaInfo}]. %%%----------------------------------------------------------------- diff --git a/lib/observer/src/cdv_mod_wx.erl b/lib/observer/src/cdv_mod_cb.erl index 8751651fec..e829ff4fca 100644 --- a/lib/observer/src/cdv_mod_wx.erl +++ b/lib/observer/src/cdv_mod_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_mod_wx). +-module(cdv_mod_cb). -export([col_to_elem/1, col_spec/0, @@ -33,7 +33,7 @@ -define(COL_CUR, ?COL_ID+1). -define(COL_OLD, ?COL_CUR+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_ID); col_to_elem(?COL_ID) -> #loaded_mod.mod; col_to_elem(?COL_CUR) -> #loaded_mod.current_size; @@ -51,7 +51,7 @@ get_info(_) -> get_detail_cols(_) -> {[?COL_ID],true}. -%% Callbacks for cdv_detail_win +%% Callbacks for cdv_detail_wx get_details(Id) -> {ok,Info,TW} = crashdump_viewer:loaded_mod_details(Id), Proplist = crashdump_viewer:to_proplist(record_info(fields,loaded_mod),Info), @@ -67,7 +67,7 @@ detail_pages() -> init_gen_page(Parent, Info) -> Fields = info_fields(), - cdv_info_page:start_link(Parent,{Fields,Info,[]}). + cdv_info_wx:start_link(Parent,{Fields,Info,[]}). init_curr_attr_page(Parent, Info) -> init_info_page(Parent, proplists:get_value(current_attrib,Info)). @@ -84,7 +84,7 @@ init_old_comp_page(Parent, Info) -> init_info_page(Parent, undefined) -> init_info_page(Parent, ""); init_info_page(Parent, String) -> - cdv_html_page:start_link(Parent,crashdump_viewer_html:plain_page(String)). + cdv_html_wx:start_link(Parent,observer_html_lib:plain_page(String)). format({Bin,q}) when is_binary(Bin) -> [$'|binary_to_list(Bin)]; diff --git a/lib/observer/src/cdv_multi_panel.erl b/lib/observer/src/cdv_multi_wx.erl index 8218824ff2..75c7f48fc2 100644 --- a/lib/observer/src/cdv_multi_panel.erl +++ b/lib/observer/src/cdv_multi_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_multi_panel). +-module(cdv_multi_wx). -behaviour(wx_object). diff --git a/lib/observer/src/cdv_port_wx.erl b/lib/observer/src/cdv_port_cb.erl index e34198ea0b..08488d3e34 100644 --- a/lib/observer/src/cdv_port_wx.erl +++ b/lib/observer/src/cdv_port_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_port_wx). +-module(cdv_port_cb). -export([col_to_elem/1, col_spec/0, @@ -37,7 +37,7 @@ -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_ID); col_to_elem(?COL_ID) -> #port.id; col_to_elem(?COL_CONN) -> #port.connected; @@ -59,7 +59,7 @@ get_info(_) -> get_detail_cols(_) -> {[?COL_ID,?COL_CONN],true}. -%% Callbacks for cdv_detail_win +%% Callbacks for cdv_detail_wx get_details(Id) -> case crashdump_viewer:port(Id) of {ok,Info,TW} -> @@ -70,7 +70,8 @@ get_details(Id) -> Info = "The port you are searching for was residing on " "a remote node. No port information is available. " "Show information about the remote node?", - {yes_no, Info, fun()->cdv_virtual_list:start_detail_win(NodeId) end}; + Fun = fun() -> cdv_virtual_list_wx:start_detail_win(NodeId) end, + {yes_no, Info, Fun}; {error,not_found} -> Info = "The port you are searching for could not be found.", {info,Info} @@ -81,7 +82,7 @@ detail_pages() -> init_gen_page(Parent, Info) -> Fields = info_fields(), - cdv_info_page:start_link(Parent,{Fields,Info,[]}). + cdv_info_wx:start_link(Parent,{Fields,Info,[]}). format({I1,I2}) -> "#Port<"++integer_to_list(I1) ++ "." ++ integer_to_list(I2) ++ ">"; diff --git a/lib/observer/src/cdv_proc_wx.erl b/lib/observer/src/cdv_proc_cb.erl index 6a8fa0b9be..dfc2df9c4c 100644 --- a/lib/observer/src/cdv_proc_wx.erl +++ b/lib/observer/src/cdv_proc_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_proc_wx). +-module(cdv_proc_cb). -export([col_to_elem/1, col_spec/0, @@ -35,7 +35,7 @@ -define(COL_MEM, ?COL_REDS+1). -define(COL_MSG, ?COL_MEM+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_ID); col_to_elem(?COL_ID) -> #proc.pid; col_to_elem(?COL_NAME) -> #proc.name; @@ -59,13 +59,13 @@ get_info(_) -> get_detail_cols(_) -> {[?COL_ID],true}. -%% Callbacks for cdv_detail_win +%% Callbacks for cdv_detail_wx get_details(Id) -> case crashdump_viewer:proc_details(Id) of {ok,Info,TW} -> - %% The following table is used by crashdump_viewer_html + %% The following table is used by observer_html_lib %% for storing expanded terms and it is read by - %% cdv_html_page when a link to an expandable term is clicked. + %% cdv_html_wx when a link to an expandable term is clicked. Tab = ets:new(cdv_expand,[set,public]), Proplist0 = crashdump_viewer:to_proplist(record_info(fields,proc),Info), @@ -76,7 +76,8 @@ get_details(Id) -> Info = "The process you are searching for was residing on " "a remote node. No process information is available. " "Show information about the remote node?", - {yes_no, Info, fun()->cdv_virtual_list:start_detail_win(NodeId) end}; + Fun = fun() -> cdv_virtual_list_wx:start_detail_win(NodeId) end, + {yes_no, Info, Fun}; {error,not_found} -> Info = "The process you are searching for could not be found.", {info,Info} @@ -92,7 +93,7 @@ detail_pages() -> init_gen_page(Parent, Info) -> Fields = info_fields(), - cdv_info_page:start_link(Parent,{Fields,Info,[]}). + cdv_info_wx:start_link(Parent,{Fields,Info,[]}). init_message_page(Parent, Info) -> init_memory_page(Parent, Info, msg_q, "MsgQueue"). @@ -106,16 +107,16 @@ init_stack_page(Parent, Info) -> init_memory_page(Parent, Info0, Tag, Heading) -> Info = proplists:get_value(Tag,Info0), Tab = proplists:get_value(expand_table,Info0), - Html = crashdump_viewer_html:expandable_term(Heading,Info,Tab), - cdv_html_page:start_link(Parent,{expand,Html,Tab}). + Html = observer_html_lib:expandable_term(Heading,Info,Tab), + cdv_html_wx:start_link(Parent,{expand,Html,Tab}). init_ets_page(Parent, Info) -> Pid = proplists:get_value(pid,Info), - cdv_virtual_list:start_link(Parent, cdv_ets_wx, Pid). + cdv_virtual_list_wx:start_link(Parent, cdv_ets_cb, Pid). init_timer_page(Parent, Info) -> Pid = proplists:get_value(pid,Info), - cdv_virtual_list:start_link(Parent, cdv_timer_wx, Pid). + cdv_virtual_list_wx:start_link(Parent, cdv_timer_cb, Pid). %%%----------------------------------------------------------------- %%% Internal diff --git a/lib/observer/src/cdv_table_page.erl b/lib/observer/src/cdv_table_wx.erl index 71ec7686ce..f8943db17d 100644 --- a/lib/observer/src/cdv_table_page.erl +++ b/lib/observer/src/cdv_table_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_table_page). +-module(cdv_table_wx). -behaviour(wx_object). @@ -69,7 +69,7 @@ init([ParentWin, {ColumnSpec,Info,TW}]) -> %%%%%%%%%%%%%%%%%%%%%%% Callbacks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% handle_info(active, State) -> - crashdump_viewer_wx:set_status(State#state.trunc_warn), + cdv_wx:set_status(State#state.trunc_warn), {noreply, State}; handle_info(Info, State) -> diff --git a/lib/observer/src/cdv_term_wx.erl b/lib/observer/src/cdv_term_cb.erl index 9b83249eae..6426cc0803 100644 --- a/lib/observer/src/cdv_term_wx.erl +++ b/lib/observer/src/cdv_term_cb.erl @@ -15,12 +15,12 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_term_wx). +-module(cdv_term_cb). -export([get_details/1, detail_pages/0]). -%% Callbacks for cdv_detail_win +%% Callbacks for cdv_detail_wx get_details({_, {T,Key}}) -> [{Key,Term}] = ets:lookup(T,Key), {ok,{"Expanded Term", [Term, T], []}}. @@ -31,13 +31,13 @@ detail_pages() -> init_term_page(ParentWin, [Term, Tab]) -> Expanded = expand(Term, true), BinSaved = expand(Term, Tab), - cdv_multi_panel:start_link( + cdv_multi_wx:start_link( ParentWin, - [{"Format \~p",cdv_html_page,format_term_fun("~p",BinSaved,Tab)}, - {"Format \~tp",cdv_html_page,format_term_fun("~tp",BinSaved,Tab)}, - {"Format \~w",cdv_html_page,format_term_fun("~w",BinSaved,Tab)}, - {"Format \~s",cdv_html_page,format_term_fun("~s",Expanded,Tab)}, - {"Format \~ts",cdv_html_page,format_term_fun("~ts",Expanded,Tab)}]). + [{"Format \~p",cdv_html_wx,format_term_fun("~p",BinSaved,Tab)}, + {"Format \~tp",cdv_html_wx,format_term_fun("~tp",BinSaved,Tab)}, + {"Format \~w",cdv_html_wx,format_term_fun("~w",BinSaved,Tab)}, + {"Format \~s",cdv_html_wx,format_term_fun("~s",Expanded,Tab)}, + {"Format \~ts",cdv_html_wx,format_term_fun("~ts",Expanded,Tab)}]). format_term_fun(Format,Term,Tab) -> fun() -> @@ -45,12 +45,12 @@ format_term_fun(Format,Term,Tab) -> Str -> {expand, plain_html(Str), Tab} catch error:badarg -> Warning = "This term can not be formatted with " ++ Format, - crashdump_viewer_html:warning(Warning) + observer_html_lib:warning(Warning) end end. plain_html(Text) -> - crashdump_viewer_html:plain_page(Text). + observer_html_lib:plain_page(Text). expand(['#CDVBin',Offset,Size,Pos], true) -> {ok,Bin} = crashdump_viewer:expand_binary({Offset,Size,Pos}), diff --git a/lib/observer/src/cdv_timer_wx.erl b/lib/observer/src/cdv_timer_cb.erl index 2bd250a46c..9cdbfa05a9 100644 --- a/lib/observer/src/cdv_timer_wx.erl +++ b/lib/observer/src/cdv_timer_cb.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_timer_wx). +-module(cdv_timer_cb). -export([col_to_elem/1, col_spec/0, @@ -30,7 +30,7 @@ -define(COL_MSG, ?COL_OWNER+1). -define(COL_TIME, ?COL_MSG+1). -%% Callbacks for cdv_virtual_list +%% Callbacks for cdv_virtual_list_wx col_to_elem(id) -> col_to_elem(?COL_OWNER); col_to_elem(?COL_OWNER) -> #timer.pid; col_to_elem(?COL_MSG) -> #timer.msg; diff --git a/lib/observer/src/cdv_virtual_list.erl b/lib/observer/src/cdv_virtual_list_wx.erl index 5897b9d02a..c5a7d9a2e5 100644 --- a/lib/observer/src/cdv_virtual_list.erl +++ b/lib/observer/src/cdv_virtual_list_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(cdv_virtual_list). +-module(cdv_virtual_list_wx). -behaviour(wx_object). @@ -68,15 +68,15 @@ start_detail_win(Id) -> Callback = case Id of "<"++_ -> - cdv_proc_wx; + cdv_proc_cb; "#Port"++_ -> - cdv_port_wx; + cdv_port_cb; _ -> case catch list_to_integer(Id) of NodeId when is_integer(NodeId) -> - cdv_dist_wx; + cdv_dist_cb; _ -> - cdv_mod_wx + cdv_mod_cb end end, start_detail_win(Callback,Id). @@ -162,7 +162,7 @@ do_start_detail_win(Id, #state{panel=Panel,detail_wins=Opened, NewOpened = case lists:keyfind(Id, 1, Opened) of false -> - case cdv_detail_win:start_link(Id, Panel, Callback) of + case cdv_detail_wx:start_link(Id, Panel, Callback) of {error, _} -> Opened; IW -> @@ -200,7 +200,7 @@ handle_info({holder_updated, Count}, State=#state{grid=Grid}) -> {noreply, State}; handle_info(active, State) -> - crashdump_viewer_wx:set_status(State#state.trunc_warn), + cdv_wx:set_status(State#state.trunc_warn), {noreply, State}; handle_info(Info, State) -> diff --git a/lib/observer/src/crashdump_viewer_wx.erl b/lib/observer/src/cdv_wx.erl index 3464dfafae..26df60b0a6 100644 --- a/lib/observer/src/crashdump_viewer_wx.erl +++ b/lib/observer/src/cdv_wx.erl @@ -15,7 +15,7 @@ %% under the License. %% %% %CopyrightEnd% --module(crashdump_viewer_wx). +-module(cdv_wx). -compile(export_all). -behaviour(wx_object). @@ -157,37 +157,37 @@ setup(#state{frame=Frame, notebook=Notebook}=State) -> wxFrame:setMenuBar(Frame, MenuBar), %% General information Panel - GenPanel = add_page(Notebook, ?GEN_STR, cdv_info_page, cdv_gen_wx), + GenPanel = add_page(Notebook, ?GEN_STR, cdv_info_wx, cdv_gen_cb), %% Process Panel - ProPanel = add_page(Notebook, ?PRO_STR, cdv_virtual_list, cdv_proc_wx), + ProPanel = add_page(Notebook, ?PRO_STR, cdv_virtual_list_wx, cdv_proc_cb), %% Port Panel - PortPanel = add_page(Notebook, ?PORT_STR, cdv_virtual_list, cdv_port_wx), + PortPanel = add_page(Notebook, ?PORT_STR, cdv_virtual_list_wx, cdv_port_cb), %% Table Panel - EtsPanel = add_page(Notebook, ?ETS_STR, cdv_virtual_list, cdv_ets_wx), + EtsPanel = add_page(Notebook, ?ETS_STR, cdv_virtual_list_wx, cdv_ets_cb), %% Timer Panel - TimerPanel = add_page(Notebook, ?TIMER_STR, cdv_virtual_list, cdv_timer_wx), + TimerPanel = add_page(Notebook, ?TIMER_STR, cdv_virtual_list_wx,cdv_timer_cb), %% Fun Panel - FunPanel = add_page(Notebook, ?FUN_STR, cdv_virtual_list, cdv_fun_wx), + FunPanel = add_page(Notebook, ?FUN_STR, cdv_virtual_list_wx, cdv_fun_cb), %% Atom Panel - AtomPanel = add_page(Notebook, ?ATOM_STR, cdv_virtual_list, cdv_atom_wx), + AtomPanel = add_page(Notebook, ?ATOM_STR, cdv_virtual_list_wx, cdv_atom_cb), %% Distribution Panel - DistPanel = add_page(Notebook, ?DIST_STR, cdv_virtual_list, cdv_dist_wx), + DistPanel = add_page(Notebook, ?DIST_STR, cdv_virtual_list_wx, cdv_dist_cb), %% Loaded Modules Panel - ModPanel = add_page(Notebook, ?MOD_STR, cdv_virtual_list, cdv_mod_wx), + ModPanel = add_page(Notebook, ?MOD_STR, cdv_virtual_list_wx, cdv_mod_cb), %% Memory Panel - MemPanel = add_page(Notebook, ?MEM_STR, cdv_multi_panel, cdv_mem_wx), + MemPanel = add_page(Notebook, ?MEM_STR, cdv_multi_wx, cdv_mem_cb), %% Memory Panel - IntPanel = add_page(Notebook, ?INT_STR, cdv_multi_panel, cdv_int_tab_wx), + IntPanel = add_page(Notebook, ?INT_STR, cdv_multi_wx, cdv_int_tab_cb), %% Show the window wxFrame:show(Frame), diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl index 53e0241711..a17efbccb0 100644 --- a/lib/observer/src/crashdump_viewer.erl +++ b/lib/observer/src/crashdump_viewer.erl @@ -153,7 +153,7 @@ stop_debug() -> start() -> start(undefined). start(File) -> - crashdump_viewer_wx:start(File). + cdv_wx:start(File). stop() -> case whereis(?SERVER) of @@ -216,7 +216,7 @@ usage() -> %% External functions %%==================================================================== %%%-------------------------------------------------------------------- -%%% Start the server - called by crashdump_viewer_wx +%%% Start the server - called by cdv_wx start_link() -> case whereis(?SERVER) of undefined -> @@ -226,7 +226,7 @@ start_link() -> end. %%%----------------------------------------------------------------- -%%% Called by crashdump_viewer_wx +%%% Called by cdv_wx read_file(File) -> cast({read_file,File}). @@ -1378,7 +1378,7 @@ get_ports(File) -> lookup_and_parse_index(File,?port,ParseFun,"ports"). %% Converting port string to tuple to secure correct sorting. This is -%% converted back in cdv_port_wx:format/1. +%% converted back in cdv_port_cb:format/1. port_to_tuple("#Port<"++Port) -> [I1,I2] = string:tokens(Port,".>"), {list_to_integer(I1),list_to_integer(I2)}. @@ -1790,7 +1790,7 @@ get_atoms1(Fd,[Bin|Bins],N,Atoms) -> %% This ensures sorting according to first actual letter in the atom, %% disregarding possible single quote. It is formatted back to correct -%% syntax in cdv_atom_wx:format/1 +%% syntax in cdv_atom_cb:format/1 get_atom(<<"\'",Atom/binary>>) -> {Atom,q}; % quoted get_atom(Atom) when is_binary(Atom) -> diff --git a/lib/observer/src/observer.app.src b/lib/observer/src/observer.app.src index e881cb3c97..ef979681ac 100644 --- a/lib/observer/src/observer.app.src +++ b/lib/observer/src/observer.app.src @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2012. All Rights Reserved. +%% Copyright Ericsson AB 2002-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -20,13 +20,33 @@ [{description, "OBSERVER version 1"}, {vsn, "%VSN%"}, {modules, [crashdump_viewer, - crashdump_viewer_html, + cdv_atom_cb, + cdv_bin_cb, + cdv_detail_wx, + cdv_dist_cb, + cdv_ets_cb, + cdv_fun_cb, + cdv_gen_cb, + cdv_html_wx, + cdv_info_wx, + cdv_int_tab_cb, + cdv_mem_cb, + cdv_mod_cb, + cdv_multi_wx, + cdv_port_cb, + cdv_proc_cb, + cdv_table_wx, + cdv_term_cb, + cdv_timer_cb, + cdv_virtual_list_wx, + cdv_wx, etop, etop_gui, etop_tr, etop_txt, observer, observer_app_wx, + observer_html_lib, observer_lib, observer_perf_wx, observer_pro_wx, diff --git a/lib/observer/src/crashdump_viewer_html.erl b/lib/observer/src/observer_html_lib.erl index 4b7caaf41e..9f77891426 100644 --- a/lib/observer/src/crashdump_viewer_html.erl +++ b/lib/observer/src/observer_html_lib.erl @@ -16,7 +16,7 @@ %% %% %CopyrightEnd% %% --module(crashdump_viewer_html). +-module(observer_html_lib). %% %% This module implements the HTML generation for the crashdump diff --git a/lib/observer/src/observer_procinfo.erl b/lib/observer/src/observer_procinfo.erl index af2b8dda2e..988e04993c 100644 --- a/lib/observer/src/observer_procinfo.erl +++ b/lib/observer/src/observer_procinfo.erl @@ -126,8 +126,8 @@ handle_event(#wx{obj=Obj, event=#wxMouse{type=leave_window}}, State) -> handle_event(#wx{event=#wxHtmlLink{linkInfo=#wxHtmlLinkInfo{href=Href}}}, #state{frame=Frame,expand_table=T,expand_wins=Opened0}=State) -> {Type, Rest} = case Href of - "#Term?"++Keys -> {cdv_term_wx, Keys}; - "#OBSBinary?"++Keys -> {cdv_bin_wx, Keys}; + "#Term?"++Keys -> {cdv_term_cb, Keys}; + "#OBSBinary?"++Keys -> {cdv_bin_cb, Keys}; _ -> {other, Href} end, case Type of @@ -142,7 +142,7 @@ handle_event(#wx{event=#wxHtmlLink{linkInfo=#wxHtmlLinkInfo{href=Href}}}, Opened = case lists:keyfind(Id,1,Opened0) of false -> - Win = cdv_detail_win:start_link(Id,Frame,Callback), + Win = cdv_detail_wx:start_link(Id,Frame,Callback), [{Id,Win}|Opened0]; {_,Win} -> wxFrame:raise(Win), @@ -201,7 +201,7 @@ init_message_page(Parent, Pid, Table) -> [Pid, messages]) of {messages, Messages} -> - Html = crashdump_viewer_html:expandable_term("Message Queue", Messages, Table), + Html = observer_html_lib:expandable_term("Message Queue", Messages, Table), wxHtmlWindow:setPage(Win, Html); _ -> throw(process_undefined) @@ -216,7 +216,7 @@ init_dict_page(Parent, Pid, Table) -> case observer_wx:try_rpc(node(Pid), erlang, process_info, [Pid, dictionary]) of {dictionary,Dict} -> - Html = crashdump_viewer_html:expandable_term("Dictionary", Dict, Table), + Html = observer_html_lib:expandable_term("Dictionary", Dict, Table), wxHtmlWindow:setPage(Win, Html); _ -> throw(process_undefined) @@ -273,7 +273,7 @@ init_state_page(Parent, Pid, Table) -> Win = observer_lib:html_window(Parent), Update = fun() -> StateInfo = fetch_state_info(Pid), - Html = crashdump_viewer_html:expandable_term("ProcState", StateInfo, Table), + Html = observer_html_lib:expandable_term("ProcState", StateInfo, Table), wxHtmlWindow:setPage(Win, Html) end, Update(), |