diff options
Diffstat (limited to 'lib/observer/src')
-rw-r--r-- | lib/observer/src/cdv_dist_cb.erl | 12 | ||||
-rw-r--r-- | lib/observer/src/crashdump_viewer.erl | 14 | ||||
-rw-r--r-- | lib/observer/src/observer.app.src | 5 | ||||
-rw-r--r-- | lib/observer/src/observer.erl | 7 | ||||
-rw-r--r-- | lib/observer/src/observer_lib.erl | 2 | ||||
-rw-r--r-- | lib/observer/src/observer_procinfo.erl | 5 | ||||
-rw-r--r-- | lib/observer/src/observer_tv_wx.erl | 6 | ||||
-rw-r--r-- | lib/observer/src/observer_wx.erl | 13 |
8 files changed, 50 insertions, 14 deletions
diff --git a/lib/observer/src/cdv_dist_cb.erl b/lib/observer/src/cdv_dist_cb.erl index 3860324d6f..f7e6c9aded 100644 --- a/lib/observer/src/cdv_dist_cb.erl +++ b/lib/observer/src/cdv_dist_cb.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2013. All Rights Reserved. +%% Copyright Ericsson AB 2013-2014. 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 @@ -22,7 +22,8 @@ get_info/1, get_detail_cols/1, get_details/1, - detail_pages/0]). + detail_pages/0, + format/1]). -include_lib("wx/include/wx.hrl"). -include("crashdump_viewer.hrl"). @@ -75,6 +76,11 @@ init_gen_page(Parent, Info) -> Fields = info_fields(), cdv_info_wx:start_link(Parent,{Fields,Info,[]}). +format({creations,Creations}) -> + string:join([integer_to_list(C) || C <- Creations],","); +format(D) -> + D. + %%%----------------------------------------------------------------- %%% Internal info_fields() -> @@ -83,7 +89,7 @@ info_fields() -> {"Type", conn_type}, {"Channel", channel}, {"Controller", {click,controller}}, - {"Creation", creation}, + {"Creation", {{format,fun format/1},creation}}, {"Extra Info", error}]}, {scroll_boxes, [{"Remote Links",1,{click,remote_links}}, diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl index a17efbccb0..a08d27d070 100644 --- a/lib/observer/src/crashdump_viewer.erl +++ b/lib/observer/src/crashdump_viewer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2013. All Rights Reserved. +%% Copyright Ericsson AB 2003-2014. 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 @@ -1576,7 +1576,13 @@ get_nodeinfo(Fd,Nod) -> "Controller" -> get_nodeinfo(Fd,Nod#nod{controller=val(Fd)}); "Creation" -> - get_nodeinfo(Fd,Nod#nod{creation=list_to_integer(val(Fd))}); + %% Throwing away elements like "(refc=1)", which might be + %% printed from a debug compiled emulator. + Creations = lists:flatmap(fun(C) -> try [list_to_integer(C)] + catch error:badarg -> [] + end + end, string:tokens(val(Fd)," ")), + get_nodeinfo(Fd,Nod#nod{creation={creations,Creations}}); "Remote link" -> Procs = val(Fd), % e.g. "<0.31.0> <4322.54.0>" {Local,Remote} = split(Procs), @@ -2559,11 +2565,11 @@ progress_pmap(Report,File,Fun,List) -> {L1,L2} = if length(L)>=NPerProc -> lists:split(NPerProc,L); true -> {L,[]} % last chunk end, - P = spawn( + {P,_Ref} = + spawn_monitor( fun() -> progress_map(Collector,ReportInterval,File,Fun,L1) end), - erlang:monitor(process,P), {L2,[P|Ps]} end, {List,[]}, diff --git a/lib/observer/src/observer.app.src b/lib/observer/src/observer.app.src index f14f0ee849..97a54cd6f9 100644 --- a/lib/observer/src/observer.app.src +++ b/lib/observer/src/observer.app.src @@ -60,6 +60,9 @@ ttb_et]}, {registered, []}, {applications, [kernel, stdlib]}, - {env, []}]}. + {env, []}, + {runtime_dependencies, ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14", + "kernel-3.0","inets-5.10","et-1.5", + "erts-6.0"]}]}. diff --git a/lib/observer/src/observer.erl b/lib/observer/src/observer.erl index 098100e8ee..a30ceecc63 100644 --- a/lib/observer/src/observer.erl +++ b/lib/observer/src/observer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2011. All Rights Reserved. +%% Copyright Ericsson AB 2011-2014. 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 @@ -18,8 +18,11 @@ -module(observer). --export([start/0]). +-export([start/0, stop/0]). start() -> observer_wx:start(). + +stop() -> + observer_wx:stop(). diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl index cedaf7d2b8..34c7b127ff 100644 --- a/lib/observer/src/observer_lib.erl +++ b/lib/observer/src/observer_lib.erl @@ -249,6 +249,8 @@ to_str({func, {F,A}}) when is_atom(F), is_integer(A) -> lists:concat([F, "/", A]); to_str({func, {F,'_'}}) when is_atom(F) -> atom_to_list(F); +to_str({{format,Fun},Value}) when is_function(Fun) -> + Fun(Value); to_str({A, B}) when is_atom(A), is_atom(B) -> lists:concat([A, ":", B]); to_str({M,F,A}) when is_atom(M), is_atom(F), is_integer(A) -> diff --git a/lib/observer/src/observer_procinfo.erl b/lib/observer/src/observer_procinfo.erl index 3ffa5fc77d..8e8a37fc93 100644 --- a/lib/observer/src/observer_procinfo.erl +++ b/lib/observer/src/observer_procinfo.erl @@ -34,6 +34,7 @@ -record(state, {parent, frame, + notebook, pid, pages=[], expand_table, @@ -76,6 +77,7 @@ init([Pid, ParentFrame, Parent]) -> {Frame, #state{parent=Parent, pid=Pid, frame=Frame, + notebook=Notebook, pages=[ProcessPage,MessagePage,DictPage,StackPage,StatePage], expand_table=Table }} @@ -158,6 +160,9 @@ handle_event(#wx{event=#wxHtmlLink{linkInfo=#wxHtmlLinkInfo{href=Info}}}, State) handle_event(Event, _State) -> error({unhandled_event, Event}). +handle_info({get_debug_info, From}, State = #state{notebook=Notebook}) -> + From ! {procinfo_debug, Notebook}, + {noreply, State}; handle_info(_Info, State) -> %% io:format("~p: ~p, Handle info: ~p~n", [?MODULE, ?LINE, Info]), {noreply, State}. diff --git a/lib/observer/src/observer_tv_wx.erl b/lib/observer/src/observer_tv_wx.erl index b276965f83..da4cb8e041 100644 --- a/lib/observer/src/observer_tv_wx.erl +++ b/lib/observer/src/observer_tv_wx.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2011-2012. All Rights Reserved. +%% Copyright Ericsson AB 2011-2014. 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 @@ -132,8 +132,8 @@ handle_event(#wx{event=#wxSize{size={W,_}}}, State=#state{grid=Grid}) -> observer_lib:set_listctrl_col_size(Grid, W), {noreply, State}; -handle_event(#wx{obj=Grid, event=#wxList{type=command_list_item_activated, - itemIndex=Index}}, +handle_event(#wx{event=#wxList{type=command_list_item_activated, + itemIndex=Index}}, State=#state{grid=Grid, node=Node, opt=#opt{type=Type}, tabs=Tabs}) -> Table = lists:nth(Index+1, Tabs), case Table#tab.protection of diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl index ecb8e132fe..ced26f7119 100644 --- a/lib/observer/src/observer_wx.erl +++ b/lib/observer/src/observer_wx.erl @@ -19,7 +19,7 @@ -behaviour(wx_object). --export([start/0]). +-export([start/0, stop/0]). -export([create_menus/2, get_attrib/1, get_tracer/0, set_status/1, create_txt_dialog/4, try_rpc/4, return_to_localnode/2]). @@ -69,6 +69,9 @@ start() -> _Obj -> ok end. +stop() -> + wx_object:call(observer, stop). + create_menus(Object, Menus) when is_list(Menus) -> wx_object:call(Object, {create_menus, Menus}). @@ -331,6 +334,10 @@ handle_call({get_attrib, Attrib}, _From, State) -> handle_call(get_tracer, _From, State=#state{trace_panel=TraceP}) -> {reply, TraceP, State}; +handle_call(stop, _, State = #state{frame = Frame}) -> + wxFrame:destroy(Frame), + {stop, normal, ok, State}; + handle_call(_Msg, _From, State) -> {reply, ok, State}. @@ -367,6 +374,10 @@ handle_info({open_link, Pid0}, State = #state{pro_panel=ProcViewer, frame=Frame} end, {noreply, State}; +handle_info({get_debug_info, From}, State = #state{notebook=Notebook, active_tab=Pid}) -> + From ! {observer_debug, wx:get_env(), Notebook, Pid}, + {noreply, State}; + handle_info({'EXIT', Pid, _Reason}, State) -> io:format("Child (~s) crashed exiting: ~p ~p~n", [pid2panel(Pid, State), Pid,_Reason]), |