Mercurial > octave
annotate scripts/profiler/profexplore.m @ 27918:b442ec6dda5c
use centralized file for copyright info for individual contributors
* COPYRIGHT.md: New file.
* In most other files, use "Copyright (C) YYYY-YYYY The Octave Project
Developers" instead of tracking individual names in separate source
files. The motivation is to reduce the effort required to update the
notices each year.
Until now, the Octave source files contained copyright notices that
list individual contributors. I adopted these file-scope copyright
notices because that is what everyone was doing 30 years ago in the
days before distributed version control systems. But now, with many
contributors and modern version control systems, having these
file-scope copyright notices causes trouble when we update copyright
years or refactor code.
Over time, the file-scope copyright notices may become outdated as new
contributions are made or code is moved from one file to
another. Sometimes people contribute significant patches but do not
add a line claiming copyright. Other times, people add a copyright
notice for their contribution but then a later refactoring moves part
or all of their contribution to another file and the notice is not
moved with the code. As a practical matter, moving such notices is
difficult -- determining what parts are due to a particular
contributor requires a time-consuming search through the project
history. Even managing the yearly update of copyright years is
problematic. We have some contributors who are no longer
living. Should we update the copyright dates for their contributions
when we release new versions? Probably not, but we do still want to
claim copyright for the project as a whole.
To minimize the difficulty of maintaining the copyright notices, I
would like to change Octave's sources to use what is described here:
https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html
in the section "Maintaining centralized copyright notices":
The centralized notice approach consolidates all copyright
notices in a single location, usually a top-level file.
This file should contain all of the copyright notices
provided project contributors, unless the contribution was
clearly insignificant. It may also credit -- without a copyright
notice -- anyone who helped with the project but did not
contribute code or other copyrighted material.
This approach captures less information about contributions
within individual files, recognizing that the DVCS is better
equipped to record those details. As we mentioned before, it
does have one disadvantage as compared to the file-scope
approach: if a single file is separated from the distribution,
the recipient won't see the contributors' copyright notices.
But this can be easily remedied by including a single
copyright notice in each file's header, pointing to the
top-level file:
Copyright YYYY-YYYY The Octave Project Developers
See the COPYRIGHT file at the top-level directory
of this distribution or at https://octave.org/COPYRIGHT.html.
followed by the usual GPL copyright statement.
For more background, see the discussion here:
https://lists.gnu.org/archive/html/octave-maintainers/2020-01/msg00009.html
Most files in the following directories have been skipped intentinally
in this changeset:
doc
libgui/qterminal
liboctave/external
m4
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 15:38:17 -0500 |
parents | 00f796120a6d |
children | 1891570abac8 |
rev | line source |
---|---|
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
1 ## Copyright (C) 2012-2019 The Octave Project Developers |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
2 ## |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
5 ## |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
6 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
7 ## This file is part of Octave. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
8 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
9 ## 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
|
10 ## 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
|
11 ## 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
|
12 ## (at your option) any later version. |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
13 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
14 ## 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
|
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## 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
|
18 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
19 ## 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
|
20 ## 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
|
21 ## <https://www.gnu.org/licenses/>. |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
22 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
23 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20231
diff
changeset
|
24 ## @deftypefn {} {} profexplore () |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20231
diff
changeset
|
25 ## @deftypefnx {} {} profexplore (@var{data}) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
26 ## Interactively explore hierarchical profiler output. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
27 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
28 ## 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
|
29 ## @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
|
30 ## 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
|
31 ## 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
|
32 ## 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
|
33 ## @seealso{profile, profshow} |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
34 ## @end deftypefn |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
35 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
36 ## Built-in profiler. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
37 ## Author: Daniel Kraft <d@domob.eu> |
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 function profexplore (data) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
40 |
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
|
41 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
|
42 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
|
43 elseif (nargin != 1) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
44 print_usage (); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
45 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
46 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
47 ## 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
|
48 ## 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
|
49 ## 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
|
50 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
51 __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
|
52 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
53 endfunction |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
54 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
55 ## 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
|
56 ## 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
|
57 ## 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
|
58 ## 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
|
59 ## 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
|
60 ## |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
61 ## 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
|
62 ## 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
|
63 ## 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
|
64 ## up (but not necessarily quit). |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
65 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
66 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
|
67 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
68 ## Sort children by total time. |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
69 times = -[ tree.TotalTime ]; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
70 [~, p] = sort (times); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
71 tree = tree(p); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
72 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
73 while (true) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
74 |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
75 printf ("\n%s", parents); |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
76 strings = cell (length (tree), 1); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
77 for i = 1 : length (tree) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
78 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
|
79 fcn_table(tree(i).Index).FunctionName, ... |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
80 tree(i).NumCalls, ... |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
81 tree(i).TotalTime, tree(i).SelfTime); |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
82 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
|
83 endfor |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
84 printf ("\n"); |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
85 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
86 cmd = input ("profexplore> ", "s"); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
87 option = fix (str2double (cmd)); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
88 |
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
|
89 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
|
90 rv = 0; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
91 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
92 elseif (strcmp (cmd, "help")) |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
93 printf ("\nCommands for profile explorer:\n\n"); |
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
94 printf ("exit Return to Octave prompt.\n"); |
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
95 printf ("quit Return to Octave prompt.\n"); |
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
96 printf ("help Display this help message.\n"); |
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
97 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
|
98 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
|
99 elseif (! isnan (option)) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
100 if (option < 1 || option > length (tree)) |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
101 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
|
102 else |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
103 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
|
104 newPrefix = sprintf ("%s ", prefix); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
105 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
106 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
|
107 newParents, newPrefix); |
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 if (rv == 0) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
110 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
111 elseif (rv > 1) |
20231
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
112 rv -= 1; |
13189
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 else |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
115 assert (rv == 1); |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
116 ## 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
|
117 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
118 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
119 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
|
120 if (length (cmd) == 2) |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
121 rv = 1; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
122 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
123 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
124 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
125 if (length (cmd) > 3 && cmd(3) == ' ') |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
126 opt = fix (str2double (substr (cmd, 3))); |
14222
190952239c2c
Use '!' for not operation in preference to '~'.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
127 if (! isnan (opt) && opt > 0) |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
128 rv = opt; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
129 return; |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
130 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
131 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
132 |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
133 printf ("Invalid 'up' command. Type 'help' for further"); |
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
134 printf (" information.\n"); |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
135 else |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
136 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
|
137 printf (" commands.\n"); |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
138 endif |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
139 |
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
140 endwhile |
21758
ffad2baa90f7
maint: Use newlines to make code more readable.
Rik <rik@octave.org>
parents:
21634
diff
changeset
|
141 |
13189
c5a8b23db680
New function 'profexplore' for interactive hierarchical profile exploration.
Daniel Kraft <d@domob.eu>
parents:
diff
changeset
|
142 endfunction |