diff options
Diffstat (limited to 'lib/observer')
30 files changed, 66 insertions, 481 deletions
diff --git a/lib/observer/doc/src/Makefile b/lib/observer/doc/src/Makefile index 0f564d3299..b43aeccd73 100644 --- a/lib/observer/doc/src/Makefile +++ b/lib/observer/doc/src/Makefile @@ -68,10 +68,6 @@ ONLY_HTML_FILE = \ GIF_FILES = \ et_processes.gif \ et_modsprocs.gif \ - etop_main.gif \ - etop_5.gif \ - etop_lines.gif \ - etop_opt.gif \ note.gif # ---------------------------------------------------- diff --git a/lib/observer/doc/src/book.xml b/lib/observer/doc/src/book.xml index 7ecb153b2f..c47852e697 100644 --- a/lib/observer/doc/src/book.xml +++ b/lib/observer/doc/src/book.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE book SYSTEM "book.dtd"> <book xmlns:xi="http://www.w3.org/2001/XInclude"> <header titlestyle="normal"> <copyright> - <year>2002</year><year>2009</year> + <year>2002</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/crashdump.xml b/lib/observer/doc/src/crashdump.xml index b6056c2ed1..5b58a52739 100644 --- a/lib/observer/doc/src/crashdump.xml +++ b/lib/observer/doc/src/crashdump.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE erlref SYSTEM "erlref.dtd"> <erlref> <header> <copyright> <year>2003</year> - <year>2011</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/crashdump_ug.xml b/lib/observer/doc/src/crashdump_ug.xml index 8aef1ffdf0..fd4405df09 100644 --- a/lib/observer/doc/src/crashdump_ug.xml +++ b/lib/observer/doc/src/crashdump_ug.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> diff --git a/lib/observer/doc/src/etop.xml b/lib/observer/doc/src/etop.xml index af6bb2442b..9f3cdd6de8 100644 --- a/lib/observer/doc/src/etop.xml +++ b/lib/observer/doc/src/etop.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE erlref SYSTEM "erlref.dtd"> <erlref> <header> <copyright> <year>2002</year> - <year>2012</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> @@ -38,21 +38,19 @@ <description> <p><c>etop</c> should be started with the provided scripts - <c>etop</c> and <c>getop</c> for text based and graphical - presentation respectively. This will start a hidden erlang node + <c>etop</c>. This will start a hidden erlang node which connects to the node to be measured. The measured node is given with the <c>-node</c> option. If the measured node has a different cookie than the default cookie for the user who invokes the script, the cookie must be explicitly given witht the <c>-setcookie</c> option.</p> - <p>Under Windows the batch files <c>etop.bat</c> and - <c>getop.bat</c> can be used.</p> + <p>Under Windows the batch file <c>etop.bat</c> can be used.</p> <p>The following configuration parameters exist for the - <c>etop</c> tool. When executing the <c>etop</c> or <c>getop</c> - scripts, these parameters can be given as command line options, - e.g. <c>getop -node testnode@myhost -setcookie MyCookie</c>.</p> + <c>etop</c> tool. When executing the <c>etop</c> script, + these parameters can be given as command line options, + e.g. <c>etop -node testnode@myhost -setcookie MyCookie</c>.</p> <taglist> <tag>node</tag> <item>The measured node. @@ -103,11 +101,6 @@ Value: <c>on | off</c> <br></br> Default: <c>on</c></item> </taglist> - <p>All interaction with <c>etop</c> when running the graphical - presentation should happen via the menus. For the text based - presentation the functions described below can be used. - </p> - <p>See the <seealso marker="etop_ug">user's guide</seealso> for more information about the <c>etop</c> tool.</p> @@ -118,7 +111,7 @@ Default: <c>on</c></item> <fsummary>Start etop</fsummary> <desc> <p>This function starts <c>etop</c>. - Note that etop is preferably started with the etop and getop scripts</p> + Note that etop is preferably started with the etop script.</p> </desc> </func> <func> diff --git a/lib/observer/doc/src/etop_5.gif b/lib/observer/doc/src/etop_5.gif Binary files differdeleted file mode 100644 index 9650176366..0000000000 --- a/lib/observer/doc/src/etop_5.gif +++ /dev/null diff --git a/lib/observer/doc/src/etop_lines.gif b/lib/observer/doc/src/etop_lines.gif Binary files differdeleted file mode 100644 index 10620a1155..0000000000 --- a/lib/observer/doc/src/etop_lines.gif +++ /dev/null diff --git a/lib/observer/doc/src/etop_main.gif b/lib/observer/doc/src/etop_main.gif Binary files differdeleted file mode 100644 index 699cb986c8..0000000000 --- a/lib/observer/doc/src/etop_main.gif +++ /dev/null diff --git a/lib/observer/doc/src/etop_opt.gif b/lib/observer/doc/src/etop_opt.gif Binary files differdeleted file mode 100644 index e420bff7f6..0000000000 --- a/lib/observer/doc/src/etop_opt.gif +++ /dev/null diff --git a/lib/observer/doc/src/etop_ug.xml b/lib/observer/doc/src/etop_ug.xml index ccbb626465..c57df1d324 100644 --- a/lib/observer/doc/src/etop_ug.xml +++ b/lib/observer/doc/src/etop_ug.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> <header> <copyright> - <year>2002</year><year>2009</year> + <year>2002</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -39,9 +39,7 @@ <section> <title>Output</title> - <p>The output from <c>etop</c> can be graphical or text based. - </p> - <p>Text based it looks like this:</p> + <p>The output from <c>etop</c> looks like this:</p> <code type="none"><![CDATA[ ======================================================================================== tiger@durin 13:40:32 @@ -63,10 +61,6 @@ Pid Name or Initial Func Time Reds Memory MsgQ Current Func <127.137.0> net_kernel:do_spawn_ 0 553 5840 0 dbg:do_relay_1/1 ======================================================================================== ]]></code> - <p>And graphically it looks like this:</p> - <image file="etop_main.gif"> - <icaption>Graphical presentation of etop</icaption> - </image> <p>The header includes some system information: </p> <taglist> @@ -102,9 +96,7 @@ Pid Name or Initial Func Time Reds Memory MsgQ Current Func <section> <title>Start</title> - <p>To start etop with the graphical presentation, use the script - <c>getop</c> or the batch file <c>getop.bat</c>, e.g. <c>getop -node tiger@durin</c></p> - <p>To start etop with the text based presentation use the script + <p>To start etop use the script <c>etop</c> or the batch file <c>etop.bat</c>, e.g. <c>etop -node tiger@durin</c>, </p> </section> @@ -115,30 +107,12 @@ Pid Name or Initial Func Time Reds Memory MsgQ Current Func <c>-OptName Value</c> to the command line, e.g. <c>etop -node tiger@durin -setcookie mycookie -lines 15</c>. </p> <p>The parameters <c>lines</c>, <c>interval</c>, <c>accumulate</c> - and <c>sort</c> can be changed during runtime. Use the - <em>Options</em> menu with the graphical presentation or the - function <c>etop:config/2</c> with the text based presentation. + and <c>sort</c> can be changed during runtime by the + function <c>etop:config/2</c>. </p> <p>A list of all valid configuration parameters can be found in the reference manual for <c>etop</c>. </p> - <p>Note that it is even possible to change which information to - sort by by clicking the header line of the table in the graphical - presentation. - </p> - - <section> - <title>Example: Change configuration with graphical presentation</title> - <image file="etop_opt.gif"> - <icaption>Select the option to change from the Options menu.</icaption> - </image> - <image file="etop_lines.gif"> - <icaption>Enter the new value in the popup window and click "Ok"</icaption> - </image> - <image file="etop_5.gif"> - <icaption>The interface is updated with the new configuration</icaption> - </image> - </section> <section> <title>Example: Change configuration with text based presentation</title> @@ -187,18 +161,14 @@ Pid Name or Initial Func Time Reds Memory MsgQ Current Func <section> <title>Print to file</title> <p>At any time, the current <c>etop</c> display can be dumped to a - text file. Use <em>Dump to file</em> on the <em>File</em> menu - with the graphical presentation or the function <c>etop:dump/1</c> - with the text based presentation. + text file with the function <c>etop:dump/1</c>. </p> </section> <section> <title>Stop</title> - <p>To stop <c>etop</c>, use <em>Exit</em> on the <em>File</em> - menu for the graphical presentation, or the function - <c>etop:stop/0</c> with the text based presentation. - </p> + <p>Use the function <c>etop:stop/0</c> to stop <c>etop</c>. + </p> </section> </chapter> diff --git a/lib/observer/doc/src/fascicules.xml b/lib/observer/doc/src/fascicules.xml index 0678195e07..37feca543f 100644 --- a/lib/observer/doc/src/fascicules.xml +++ b/lib/observer/doc/src/fascicules.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE fascicules SYSTEM "fascicules.dtd"> <fascicules> diff --git a/lib/observer/doc/src/notes_history.xml b/lib/observer/doc/src/notes_history.xml index 2300983131..55e965022c 100644 --- a/lib/observer/doc/src/notes_history.xml +++ b/lib/observer/doc/src/notes_history.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> <header> <copyright> <year>2006</year> - <year>2011</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/observer.xml b/lib/observer/doc/src/observer.xml index 03830f2b1c..315301e2c8 100644 --- a/lib/observer/doc/src/observer.xml +++ b/lib/observer/doc/src/observer.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE erlref SYSTEM "erlref.dtd"> <erlref> <header> <copyright> - <year>2011</year> + <year>2011</year><year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/observer_app.xml b/lib/observer/doc/src/observer_app.xml index e643568a39..e4790ce98c 100644 --- a/lib/observer/doc/src/observer_app.xml +++ b/lib/observer/doc/src/observer_app.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE appref SYSTEM "appref.dtd"> <appref> <header> <copyright> <year>2002</year> - <year>2011</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/observer_ug.xml b/lib/observer/doc/src/observer_ug.xml index 569d72e71e..3aeaf1997a 100644 --- a/lib/observer/doc/src/observer_ug.xml +++ b/lib/observer/doc/src/observer_ug.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> <header> <copyright> - <year>2011</year> + <year>2011</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/part.xml b/lib/observer/doc/src/part.xml index 0d6aad09f2..c05f9bdf9c 100644 --- a/lib/observer/doc/src/part.xml +++ b/lib/observer/doc/src/part.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE part SYSTEM "part.dtd"> <part xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2002</year><year>2011</year> + <year>2002</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/part_notes.xml b/lib/observer/doc/src/part_notes.xml index cd659395af..a900779e2f 100644 --- a/lib/observer/doc/src/part_notes.xml +++ b/lib/observer/doc/src/part_notes.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE part SYSTEM "part.dtd"> <part xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2004</year><year>2009</year> + <year>2004</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/part_notes_history.xml b/lib/observer/doc/src/part_notes_history.xml index 1ba0875fec..8f13861bb9 100644 --- a/lib/observer/doc/src/part_notes_history.xml +++ b/lib/observer/doc/src/part_notes_history.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE part SYSTEM "part.dtd"> <part> <header> <copyright> <year>2006</year> - <year>2011</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/ref_man.xml b/lib/observer/doc/src/ref_man.xml index c33ce74141..3230a1c9d3 100644 --- a/lib/observer/doc/src/ref_man.xml +++ b/lib/observer/doc/src/ref_man.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE application SYSTEM "application.dtd"> <application xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2002</year><year>2011</year> + <year>2002</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/ttb.xml b/lib/observer/doc/src/ttb.xml index 1453bbdf10..6e60a9cb3b 100644 --- a/lib/observer/doc/src/ttb.xml +++ b/lib/observer/doc/src/ttb.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE erlref SYSTEM "erlref.dtd"> <erlref> <header> <copyright> <year>2002</year> - <year>2011</year> + <year>2013</year> <holder>Ericsson AB, All Rights Reserved</holder> </copyright> <legalnotice> diff --git a/lib/observer/doc/src/ttb_ug.xml b/lib/observer/doc/src/ttb_ug.xml index 402d079c2c..a1740b618e 100644 --- a/lib/observer/doc/src/ttb_ug.xml +++ b/lib/observer/doc/src/ttb_ug.xml @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="latin1" ?> +<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE chapter SYSTEM "chapter.dtd"> <chapter> <header> <copyright> - <year>2002</year><year>2011</year> + <year>2002</year><year>2013</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> diff --git a/lib/observer/priv/bin/getop b/lib/observer/priv/bin/getop deleted file mode 100755 index 5cd9bf3d76..0000000000 --- a/lib/observer/priv/bin/getop +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -NAME="etop" -erl -sname $NAME -noinput -hidden -s etop -s erlang halt $@ diff --git a/lib/observer/priv/bin/getop.bat b/lib/observer/priv/bin/getop.bat deleted file mode 100644 index 8b6f108f06..0000000000 --- a/lib/observer/priv/bin/getop.bat +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -CALL werl -sname etop -noinput -hidden -s etop -s erlang halt %* diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index 42f5c19935..646892663f 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -38,7 +38,6 @@ MODULES= \ crashdump_viewer \ crashdump_viewer_html \ etop \ - etop_gui \ etop_tr \ etop_txt \ observer \ @@ -72,13 +71,12 @@ PRIVDIR= ../priv WEBTOOLFILES= $(PRIVDIR)/crashdump_viewer.tool $(PRIVDIR)/erlang_observer.png BINDIR= $(PRIVDIR)/bin ifeq ($(findstring win32,$(TARGET)),win32) -WIN32_EXECUTABLES= $(BINDIR)/etop.bat $(BINDIR)/getop.bat $(BINDIR)/cdv.bat +WIN32_EXECUTABLES= $(BINDIR)/etop.bat $(BINDIR)/cdv.bat else WIN32_EXECUTABLES= endif EXECUTABLES= \ $(BINDIR)/etop \ - $(BINDIR)/getop \ $(BINDIR)/cdv \ $(WIN32_EXECUTABLES) CDVDIR= $(PRIVDIR)/crashdump_viewer diff --git a/lib/observer/src/etop.erl b/lib/observer/src/etop.erl index 2610060eae..96a18cf450 100644 --- a/lib/observer/src/etop.erl +++ b/lib/observer/src/etop.erl @@ -44,9 +44,6 @@ help() -> " sort runtime | reductions | memory | msg_q~n" " What information to sort by~n" " Default: runtime (reductions if tracing=off)~n" - " output graphical | text~n" - " How to present results~n" - " Default: graphical~n" " tracing on | off etop uses the erlang trace facility, and thus~n" " no other tracing is possible on the node while~n" " etop is running, unless this option is set to~n" @@ -317,7 +314,7 @@ handle_args([_| R], C) -> handle_args([], C) -> C. -output(graphical) -> etop_gui; +output(graphical) -> exit({deprecated, "Use observer instead"}); output(text) -> etop_txt. diff --git a/lib/observer/src/etop_defs.hrl b/lib/observer/src/etop_defs.hrl index 664de61973..720fb50b5a 100644 --- a/lib/observer/src/etop_defs.hrl +++ b/lib/observer/src/etop_defs.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. 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 @@ -22,8 +22,8 @@ " procs~8w processes~8w code ~8w~n" " runq ~8w atom ~8w ets ~8w~n"). --record(opts, {node=node(), port = 8415, accum = false, intv = 5000, lines = 10, +-record(opts, {node=node(), port = 8415, accum = false, intv = 5000, lines = 10, width = 700, height = 340, sort = runtime, tracing = on, %% Other state information - out_mod=etop_gui, out_proc, server, host, tracer, store, + out_mod=etop_txt, out_proc, server, host, tracer, store, accum_tab, remote}). diff --git a/lib/observer/src/etop_gui.erl b/lib/observer/src/etop_gui.erl deleted file mode 100644 index 3971646abc..0000000000 --- a/lib/observer/src/etop_gui.erl +++ /dev/null @@ -1,374 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% 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 -%% compliance with the License. You should have received a copy of the -%% Erlang Public License along with this software. If not, it can be -%% retrieved online at http://www.erlang.org/. -%% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% %CopyrightEnd% -%% --module(etop_gui). --compile([{nowarn_deprecated_function,{gs,config,2}}, - {nowarn_deprecated_function,{gs,create,3}}, - {nowarn_deprecated_function,{gs,create,4}}, - {nowarn_deprecated_function,{gs,destroy,1}}, - {nowarn_deprecated_function,{gs,read,2}}, - {nowarn_deprecated_function,{gs,start,0}}]). - --author('[email protected]'). - --export([init/1,stop/1]). --export([formatmfa/1,to_list/1]).% For etop_txt - --include("etop.hrl"). --include("etop_defs.hrl"). - --import(etop, [loadinfo/1, meminfo/2, getopt/2]). - -%% Heights --define(BarH, 28). % height of menubar --define(LabelH, 90). % height of label with system info --define(GridLineH, 21). % height of one line in the table (grid) - -%% Column numbers for grid - click to sort --define(TimeCol, 3). --define(RedsCol, 4). --define(MemCol, 5). --define(MsgQCol, 6). - -%% Font --define(Normal, {screen,12}). --define(Bold, {screen,bold,12}). - - -%% ----------------------------------------------------------------------------- -stop(_) -> ok. - -init(Config) -> - S = gs:start(), - Width = getopt(width, Config), - TotLines = getopt(lines,Config)+1, - - %% Max number of processes shown in window at startup is 10 - %% If less than 10 lines is specified, window size fits number of lines - WinH = if TotLines > 11 -> 11*?GridLineH + ?BarH + ?LabelH; - true -> TotLines*?GridLineH + ?BarH + ?LabelH - end, - Win = gs:create(window, S, - [{title, "Erlang Top"}, - {map, true}, %% While debugging - {configure, true}, - {width, Width}, {height, WinH}]), - Bar = gs:create(menubar, Win, []), - - FileButt = gs:create(menubutton, Bar, [{label,{text, " File "}}]), - OptionsButt = gs:create(menubutton, Bar, [{label,{text, " Options "}}]), - File = gs:create(menu, FileButt, []), - Options = gs:create(menu, OptionsButt, []), - gse:named_menuitem(refresh, File, - [{label,{text," Refresh "}}]), - gse:named_menuitem(dump, File, - [{label,{text," Dump to file "}}]), - gse:named_menuitem(exit, File, - [{label,{text," Exit "}}]), - - gse:named_menuitem(accum, Options, - [{label,{text, " Accumulate "}}, - {itemtype, check}]), - gse:named_menuitem(intv, Options, - [{label,{text, " Update Interval "}}]), - gse:named_menuitem(lines, Options, - [{label,{text, " Number of Lines "}}]), - Sort = gse:named_menuitem(sort, Options, - [{label,{text, " Sort "}}, - {itemtype,cascade}]), - SortMenu = gse:create(menu, Sort, []), - gse:named_menuitem(runtime, SortMenu, - [{label,{text, " Time "}}, - {itemtype,radio},{group,gr1}]), - gse:named_menuitem(memory, SortMenu, - [{label,{text, " Memory "}}, - {itemtype,radio},{group,gr1}]), - gse:named_menuitem(reductions, SortMenu, - [{label,{text, " Reductions "}}, - {itemtype,radio},{group,gr1}]), - gse:named_menuitem(msg_q, SortMenu, - [{label,{text, " Message Queue "}}, - {itemtype,radio},{group,gr1}]), - - SysInfo = gs:create(label,Win,[{x, 0}, {y, ?BarH},{align,sw}, - {width, Width},{height,?LabelH}]), - - {GridH,VScroll} = calc_grid_h(WinH,TotLines), - Grid = gse:grid(Win, - [{x, 0}, {y, ?BarH+?LabelH}, - {width, Width}, - {height, GridH}, - {hscroll, false}, - {vscroll, VScroll}, - {columnwidths, calc_column_w(Width)}, - {rows, {1, TotLines}}, - {font,?Normal}]), - - %% Header line - GL1 = gse:gridline(Grid, [{{text, 1}, "PID"}, - {{text, 2}, "Name or Initial Function"}, - {{text, ?TimeCol}, "Time(us)"}, - {{text, ?RedsCol}, "Reds"}, - {{text, ?MemCol}, "Memory"}, - {{text, ?MsgQCol}, "MsgQ"}, - {{text, 7}, "Current Function"}, - {bg, lightblue}, - {row, 1}, - {click, true}]), - - config_sort(GL1,getopt(sort,Config)), - Info = do_update(Grid, SysInfo, Config), - - get_event(Info, Win, Grid, GL1, SysInfo, Config). - -calc_column_w(W) -> - %% W = [2x, 3x, 1x, 1x, 1x, 1x, 3x] = 12x - RW = W-9, % just to make nice small margins on each side of grid - X = RW div 12, - [2*X, 3*X, X, X, X, X, 3*X + (RW - 12*X)]. - -config_sort(GL1,Sort) -> - gs:config(Sort,[{select,true}]), - lists:foreach(fun(S) -> - gs:config(GL1,[{{font,S},?Normal}]) - end, - [?TimeCol,?MemCol,?RedsCol,?MsgQCol]), - case Sort of - runtime -> gs:config(GL1,{{font,?TimeCol},?Bold}); - memory -> gs:config(GL1,{{font,?MemCol},?Bold}); - reductions -> gs:config(GL1,{{font,?RedsCol},?Bold}); - msg_q -> gs:config(GL1,{{font,?MsgQCol},?Bold}) - end. - -config_lines(Win,Grid,TotLines) -> - OldGridH = gs:read(Grid,height), - NewLinesH = TotLines*?GridLineH, - if NewLinesH =< OldGridH -> - gs:config(Win,[{height,NewLinesH+?BarH+?LabelH}]), - gs:config(Grid,[{rows,{1,TotLines}}, - {height,NewLinesH}, - {vscroll,false}]); - true -> - gs:config(Grid,[{rows,{1,TotLines}},{vscroll,right}]) - end. - -calc_grid_h(WinH,TotLines) -> - LeftInWin = WinH - ?BarH - ?LabelH, - TotGrid = TotLines * ?GridLineH, - if LeftInWin >= TotGrid -> - {TotGrid,false}; - true -> - {LeftInWin,right} - end. - -set_win_h(Win,OrigH,TotLines) -> - TotH = TotLines*?GridLineH + ?BarH + ?LabelH, - if TotH >= OrigH -> OrigH; - true -> gs:config(Win,[{height,TotH}]), - TotH - end. - -get_event(Info, Win, Grid, GL1, SysInfo, Config) -> - receive - {gs, Win, configure,[],[W,H,_,_]} -> - TotLines = getopt(lines,Config)+1, - %% Will not make window higher than total number of lines - RealWinH = set_win_h(Win,H,TotLines), - {GridH,VScroll} = calc_grid_h(RealWinH,TotLines), - gs:config(Grid, [{width, W}, - {columnwidths, calc_column_w(W)}, - {height,GridH}, {vscroll,VScroll}]), - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {gs, refresh, _, _, _} -> - Info1 = do_update(Grid, SysInfo, Config), - get_event(Info1, Win, Grid, GL1, SysInfo, Config); - {gs, dump, _, _, _} -> - case pop(Win,dump) of - {ok,File} -> etop:dump(File); - {error,cancel} -> ok - end, - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {gs, Win, destroy, _, _} -> - normal; - {gs, exit, _, _, _} -> - ok; - {gs, accum, _, _, _} -> - Old = getopt(accum,Config), - etop:config(accumulate,not Old), - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {gs,intv,_,_,_} -> - case pop(Win,interval) of - {ok,Intv} -> etop:config(interval,list_to_integer(Intv)); - {error,cancel} -> ok - end, - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {gs,lines,_,_,_} -> - case pop(Win,lines) of - {ok,Lines} -> etop:config(lines,list_to_integer(Lines)); - {error,cancel} -> ok - end, - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {gs,Sort,_,_,_} when Sort=:=runtime; - Sort=:=memory; - Sort=:=reductions; - Sort=:=msg_q -> - etop:config(sort,Sort), - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {gs,GL1,click,_,[Col,1,_]} -> - case Col of - ?TimeCol -> etop:config(sort, runtime); - ?MemCol -> etop:config(sort, memory); - ?RedsCol -> etop:config(sort, reductions); - ?MsgQCol -> etop:config(sort, msg_q); - _other -> ignore - end, - get_event(Info, Win, Grid, GL1, SysInfo, Config); - {config,{Key,Value},Config1} -> - case Key of - lines -> config_lines(Win,Grid,Value+1); - sort -> config_sort(GL1,Value); - accumulate -> gs:config(accum,[{select,Value}]); - _ -> ok - end, - Info1 = do_update(Grid, SysInfo, Config1), - get_event(Info1, Win, Grid, GL1, SysInfo, Config1); - {dump,Fd} -> - etop_txt:do_update(Fd,Info,Config), - get_event(Info, Win, Grid, GL1, SysInfo, Config); - Msg -> - io:format("~p got unexpected msg ~p~n", [?MODULE, Msg]), - get_event(Info, Win, Grid, GL1, SysInfo, Config) - after getopt(intv,Config) -> - Info1 = do_update(Grid, SysInfo, Config), - get_event(Info1, Win, Grid, GL1, SysInfo, Config) - end. - -do_update(Grid, SysInfo, Config) -> - Info = etop:update(Config), - Lines = makegridlines(Info#etop_info.procinfo, Grid, 2), - clear_lines(Lines, getopt(lines,Config) + 1, Grid), - makesysinfo(getopt(node,Config),Info,SysInfo), - Info. - -%clear_lines(From, To, _Grid) when From > To -> ok; -clear_lines(From, To, Grid) -> - case gs:read(Grid, {obj_at_row, From}) of - undefined -> - ok; - GridLine -> - gs:destroy(GridLine), - clear_lines(From + 1, To, Grid) - end. - -formatmfa({M, F, A}) -> - io_lib:format("~w:~w/~w",[M, F, A]); -formatmfa(Other) -> - %% E.g. when running hipe - the current_function for some - %% processes will be 'undefined' - io_lib:format("~w",[Other]). - - -makegridlines([#etop_proc_info{pid=Pid, - mem=Mem, - reds=Reds, - name=Name, - runtime=Time, - cf=MFA, - mq=MQ} - |T], Grid, Count) -> - update_gl(Grid, Count, [{{text, 1}, pid_to_list(Pid)}, - {{text, 2}, to_list(Name)}, - {{text, ?TimeCol}, - if is_integer(Time)->integer_to_list(Time); - true -> Time - end}, - {{text, ?RedsCol}, integer_to_list(Reds)}, - {{text, ?MemCol}, integer_to_list(Mem)}, - {{text, ?MsgQCol}, integer_to_list(MQ)}, - {{text, 7}, formatmfa(MFA)}, - {row, Count}, {click, false}]), - makegridlines(T, Grid, Count + 1); -makegridlines([],_Grid,Count) -> - Count. - -update_gl(Grid, Row, GL) -> - case gs:read(Grid, {obj_at_row, Row}) of - undefined -> - gse:gridline(Grid,[{row, Row}|GL]); - GridLine -> - gs:config(GridLine,GL) - end. - -to_list(Name) when is_atom(Name) -> atom_to_list(Name); -to_list({_M,_F,_A}=MFA) -> formatmfa(MFA). - - -makesysinfo(Node,Info,SysInfo) -> - {Cpu,NProcs,RQ,Clock} = loadinfo(Info), - case Info#etop_info.memi of - undefined -> - Str = "No memory information is available."; - Memi -> - [Tot,Procs,Atom,Bin,Code,Ets] = - meminfo(Memi, [total,processes,atom,binary,code,ets]), - Str = io_lib:fwrite(?SYSFORM, - [Node,Clock, - Cpu,Tot,Bin, - NProcs,Procs,Code, - RQ,Atom,Ets]) - end, - gs:config(SysInfo,[{label,{text,Str}},{font,?Normal}]). - - -pop(Win,Key) -> - Pop = gs:create(window,Win,[{title,"Config"}, - {width,160},{height,100}]), - gs:create(label,Pop,[{label,{text,txt(Key)}}, - {width,160}]), - gs:create(entry,entry,Pop,[{x,10},{y,30},{width,130}, - {keypress,true}]), - gs:create(button,ok,Pop,[{width,45},{y,60},{x,10}, - {label,{text,"Ok"}}]), - gs:create(button,cancel,Pop,[{width,60},{y,60},{x,80}, - {label,{text,"Cancel"}}]), - gs:config(Pop,{map,true}), - pop_loop(Pop). - -pop_loop(Pop) -> - receive - {gs,entry,keypress,_,['Return'|_]} -> - Str = gs:read(entry,text), - gs:destroy(Pop), - {ok,Str}; - {gs,entry,keypress,_,_} -> % all other keypresses - pop_loop(Pop); - {gs,ok,click,_,_} -> - Str = gs:read(entry,text), - gs:destroy(Pop), - {ok,Str}; - {gs,cancel,click,_,_} -> - gs:destroy(Pop), - {error,cancel}; - X -> - io:format("Got X=~w~n",[X]), - pop_loop(Pop) - end. - -txt(interval) -> "Enter new interval:"; -txt(lines) -> "Enter number of lines:"; -txt(dump) -> "Enter file name:". diff --git a/lib/observer/src/etop_txt.erl b/lib/observer/src/etop_txt.erl index d0612f15b4..f048ff17ca 100644 --- a/lib/observer/src/etop_txt.erl +++ b/lib/observer/src/etop_txt.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. 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 @@ -27,7 +27,6 @@ -include("etop_defs.hrl"). -import(etop,[loadinfo/1,meminfo/2]). --import(etop_gui,[formatmfa/1,to_list/1]). -define(PROCFORM,"~-15w~-20s~8w~8w~8w~8w ~-20s~n"). @@ -99,3 +98,13 @@ writepinfo(Fd,[#etop_proc_info{pid=Pid, writepinfo(_Fd,[]) -> ok. + +formatmfa({M, F, A}) -> + io_lib:format("~w:~w/~w",[M, F, A]); +formatmfa(Other) -> + %% E.g. when running hipe - the current_function for some + %% processes will be 'undefined' + io_lib:format("~w",[Other]). + +to_list(Name) when is_atom(Name) -> atom_to_list(Name); +to_list({_M,_F,_A}=MFA) -> formatmfa(MFA). diff --git a/lib/observer/src/observer.app.src b/lib/observer/src/observer.app.src index e881cb3c97..6d5259624c 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 @@ -22,7 +22,6 @@ {modules, [crashdump_viewer, crashdump_viewer_html, etop, - etop_gui, etop_tr, etop_txt, observer, diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl index 4c04126d4f..28c7853eaf 100644 --- a/lib/observer/test/crashdump_viewer_SUITE.erl +++ b/lib/observer/test/crashdump_viewer_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2012. All Rights Reserved. +%% Copyright Ericsson AB 2003-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 @@ -81,7 +81,7 @@ init_per_suite(Config) when is_list(Config) -> application:start(inets), % will be using the http client later httpc:set_options([{ipfamily,inet6fb4}]), DataDir = ?config(data_dir,Config), - Rels = [R || R <- [r14b,r15b], ?t:is_release_available(R)] ++ [current], + Rels = [R || R <- [r15b,r16b], ?t:is_release_available(R)] ++ [current], io:format("Creating crash dumps for the following releases: ~p", [Rels]), AllDumps = create_dumps(DataDir,Rels), ?t:timetrap_cancel(Dog), @@ -800,6 +800,7 @@ rel_opt(Rel) -> r13b -> [{erl,[{release,"r13b_patched"}]}]; r14b -> [{erl,[{release,"r14b_latest"}]}]; %naming convention changed r15b -> [{erl,[{release,"r15b_latest"}]}]; + r16b -> [{erl,[{release,"r16b_latest"}]}]; current -> [] end. @@ -813,7 +814,8 @@ dump_prefix(Rel) -> r13b -> "r13b_dump."; r14b -> "r14b_dump."; r15b -> "r15b_dump."; - current -> "r16b_dump." + r16b -> "r16b_dump."; + current -> "r17b_dump." end. compat_rel(Rel) -> @@ -826,5 +828,6 @@ compat_rel(Rel) -> r13b -> "+R13 "; r14b -> "+R14 "; r15b -> "+R15 "; + r16b -> "+R16 "; current -> "" end. |