annotate scripts/profiler/profexplore.m @ 27923:bd51beb6205e

update formatting of copyright notices * Use <https://octave.org/copyright/> instead of <https://octave.org/COPYRIGHT.html/>. * For consistency with other comments in the Octave sources, use C++-style comments for copyright blocks in C and C++ files. * Use delimiters above and below copyright blocks that are appropriate for the language used in the file. * Eliminate extra spacing inside copyright blocks. * lex.ll (looks_like_copyright): Also allow newlines and carriage returns before the word "Copyright". * scripts/mk-doc.pl (gethelp): Also skip empty comment lines. * bp-table.cc, type.m: Adjust tests.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Jan 2020 11:59:41 -0500
parents 1891570abac8
children a4268efb7334
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 ##
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
3 ## Copyright (C) 2012-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
7 ##
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
8 ## This file is part of Octave.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
9 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
11 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
13 ## (at your option) any later version.
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
14 ##
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
18 ## GNU General Public License for more details.
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
19 ##
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
20 ## You should have received a copy of the GNU General Public License
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
22 ## <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 ##
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ########################################################################
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
25
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
26 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20231
diff changeset
27 ## @deftypefn {} {} profexplore ()
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20231
diff changeset
28 ## @deftypefnx {} {} profexplore (@var{data})
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
29 ## Interactively explore hierarchical profiler output.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
30 ##
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
31 ## Assuming @var{data} is the structure with profile data returned by
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17202
diff changeset
32 ## @code{profile (@qcode{"info"})}, this command opens an interactive prompt
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
33 ## that can be used to explore the call-tree. Type @kbd{help} to get a list
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17202
diff changeset
34 ## of possible commands. If @var{data} is omitted, @code{profile ("info")}
17202
9e613baf431e profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents: 14359
diff changeset
35 ## is called and used in its place.
13191
c5ddb99ff5de Put @seealso in profiler functions' docstrings.
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13189
diff changeset
36 ## @seealso{profile, profshow}
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
37 ## @end deftypefn
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
38
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
39 ## Built-in profiler.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
40 ## Author: Daniel Kraft <d@domob.eu>
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
41
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
42 function profexplore (data)
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
43
17202
9e613baf431e profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents: 14359
diff changeset
44 if (nargin == 0)
9e613baf431e profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents: 14359
diff changeset
45 data = profile ("info");
9e613baf431e profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents: 14359
diff changeset
46 elseif (nargin != 1)
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
47 print_usage ();
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
48 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
49
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
50 ## The actual work is done by a recursive worker function, since that
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
51 ## is an easy way to traverse the tree datastructure. Here, we just check
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
52 ## the arguments (already done) and give over to it.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
53
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
54 __profexplore_worker (data.FunctionTable, data.Hierarchical, "Top\n", " ");
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
55
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
56 endfunction
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
57
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
58 ## This is the worker function. tree is the current subtree we want to
14359
7277fe922e99 doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents: 14222
diff changeset
59 ## display / explore. parents is a string containing the already "rendered"
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
60 ## data for the parents which is displayed on top of the list of current
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
61 ## children. prefix is the prefix to add to each line rendered; this
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
62 ## is just a string of spaces to get indentation right.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
63 ##
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
64 ## Returning 0 indicates that the user requested to totally exit the
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
65 ## explorer, thus also all higher levels should exit immediately. An integer
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
66 ## greater zero indicates to exit that many levels since the user wants to go
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
67 ## up (but not necessarily quit).
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
68
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
69 function rv = __profexplore_worker (fcn_table, tree, parents, prefix)
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
70
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
71 ## Sort children by total time.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
72 times = -[ tree.TotalTime ];
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
73 [~, p] = sort (times);
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
74 tree = tree(p);
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
75
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
76 while (true)
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
77
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
78 printf ("\n%s", parents);
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
79 strings = cell (length (tree), 1);
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
80 for i = 1 : length (tree)
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
81 strings{i} = sprintf ("%s: %d calls, %.3f total, %.3f self", ...
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
82 fcn_table(tree(i).Index).FunctionName, ...
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
83 tree(i).NumCalls, ...
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
84 tree(i).TotalTime, tree(i).SelfTime);
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
85 printf ("%s%d) %s\n", prefix, i, strings{i});
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
86 endfor
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
87 printf ("\n");
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
88
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
89 cmd = input ("profexplore> ", "s");
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
90 option = fix (str2double (cmd));
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
91
17202
9e613baf431e profexplore.m: Allow calling with no args, add "quit" as alias to "exit".
Philipp Kutin <philipp.kutin@gmail.com>
parents: 14359
diff changeset
92 if (strcmp (cmd, "exit") || strcmp (cmd, "quit"))
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
93 rv = 0;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
94 return;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
95 elseif (strcmp (cmd, "help"))
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
96 printf ("\nCommands for profile explorer:\n\n");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
97 printf ("exit Return to Octave prompt.\n");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
98 printf ("quit Return to Octave prompt.\n");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
99 printf ("help Display this help message.\n");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
100 printf ("up [N] Go up N levels, where N is an integer. Default is 1.\n");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
101 printf ("N Go down a level into option N.\n");
14222
190952239c2c Use '!' for not operation in preference to '~'.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
102 elseif (! isnan (option))
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
103 if (option < 1 || option > length (tree))
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
104 printf ("The chosen option is out of range!\n");
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
105 else
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
106 newParents = sprintf ("%s%s%s\n", parents, prefix, strings{option});
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
107 newPrefix = sprintf ("%s ", prefix);
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
108
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
109 rv = __profexplore_worker (fcn_table, tree(option).Children, ...
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
110 newParents, newPrefix);
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
111
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
112 if (rv == 0)
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
113 return;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
114 elseif (rv > 1)
20231
83792dd9bcc1 Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents: 19697
diff changeset
115 rv -= 1;
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
116 return;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
117 else
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
118 assert (rv == 1);
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
119 ## It was requested to return to this level, so just stay.
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
120 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
121 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
122 elseif (length (cmd) >= 2 && strcmp (substr (cmd, 1, 2), "up"))
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
123 if (length (cmd) == 2)
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
124 rv = 1;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
125 return;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
126 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
127
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
128 if (length (cmd) > 3 && cmd(3) == ' ')
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
129 opt = fix (str2double (substr (cmd, 3)));
14222
190952239c2c Use '!' for not operation in preference to '~'.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
130 if (! isnan (opt) && opt > 0)
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
131 rv = opt;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
132 return;
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
133 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
134 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
135
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
136 printf ("Invalid 'up' command. Type 'help' for further");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
137 printf (" information.\n");
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
138 else
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
139 printf ("Unrecognized input. Type 'help' to get a list of possible");
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
140 printf (" commands.\n");
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
141 endif
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
142
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
143 endwhile
21758
ffad2baa90f7 maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents: 21634
diff changeset
144
13189
c5a8b23db680 New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff changeset
145 endfunction