Mercurial > octave
annotate libinterp/corefcn/getrusage.cc @ 31706:597f3ee61a48 stable
update Octave Project Developers copyright for the new year
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 06 Jan 2023 13:11:27 -0500 |
parents | e88a07dec498 |
children | 2e484f9f1f18 |
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 // |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31605
diff
changeset
|
3 // Copyright (C) 1996-2023 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
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/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
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 //////////////////////////////////////////////////////////////////////// |
2928 | 25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21580
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21200
diff
changeset
|
27 # include "config.h" |
2928 | 28 #endif |
29 | |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
30 #include "oct-time.h" |
10240
fa7b5751730c
use gnulib time, sys_time, and sys_times modules
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
31 |
15039
e753177cde93
maint: Move non-dynamically linked functions from DLD-FUNCTIONS/ to corefcn/ directory
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
32 #include "defun.h" |
10240
fa7b5751730c
use gnulib time, sys_time, and sys_times modules
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
33 #include "oct-map.h" |
fa7b5751730c
use gnulib time, sys_time, and sys_times modules
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
34 #include "ov.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20876
diff
changeset
|
35 #include "ovl.h" |
2928 | 36 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30888
diff
changeset
|
37 OCTAVE_BEGIN_NAMESPACE(octave) |
29958
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
38 |
15039
e753177cde93
maint: Move non-dynamically linked functions from DLD-FUNCTIONS/ to corefcn/ directory
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
39 DEFUN (getrusage, , , |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
40 doc: /* -*- texinfo -*- |
30888
32d2b6604a9f
doc: Ensure documentation lists output argument when it exists for functions in libinterp/
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
41 @deftypefn {} {@var{procstats} =} getrusage () |
21966
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
42 Return a structure containing a number of statistics about the current |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
43 Octave process. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
44 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
45 Not all fields are available on all systems. If it is not possible to get |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
46 CPU time statistics, the CPU time slots are set to zero. Other missing data |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
47 are replaced by NaN@. The list of possible fields is: |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
48 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
49 @table @code |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
50 @item idrss |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
51 Unshared data size. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
52 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
53 @item inblock |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
54 Number of block input operations. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
55 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
56 @item isrss |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
57 Unshared stack size. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
58 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
59 @item ixrss |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
60 Shared memory size. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
61 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
62 @item majflt |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
63 Number of major page faults. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
64 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
65 @item maxrss |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
66 Maximum data size. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
67 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
68 @item minflt |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
69 Number of minor page faults. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
70 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
71 @item msgrcv |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
72 Number of messages received. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
73 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
74 @item msgsnd |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
75 Number of messages sent. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
76 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
77 @item nivcsw |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
78 Number of involuntary context switches. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
79 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
80 @item nsignals |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
81 Number of signals received. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
82 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
83 @item nswap |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
84 Number of swaps. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
85 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
86 @item nvcsw |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
87 Number of voluntary context switches. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
88 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
89 @item oublock |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
90 Number of block output operations. |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
91 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
92 @item stime |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
93 A structure containing the system CPU time used. The structure has the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
94 elements @code{sec} (seconds) @code{usec} (microseconds). |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
95 |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
96 @item utime |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
97 A structure containing the user CPU time used. The structure has the |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
98 elements @code{sec} (seconds) @code{usec} (microseconds). |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
99 @end table |
112b20240c87
move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents:
21930
diff
changeset
|
100 @end deftypefn */) |
2928 | 101 { |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
102 octave_scalar_map ru_map; |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
103 octave_scalar_map tv_map; |
2928 | 104 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
105 sys::resource_usage rusage; |
2928 | 106 |
29961
7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents:
29958
diff
changeset
|
107 sys::cpu_time cpu = rusage.cpu (); |
2928 | 108 |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
109 tv_map.assign ("sec", cpu.user_sec ()); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
110 tv_map.assign ("usec", cpu.user_usec ()); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
111 ru_map.assign ("utime", octave_value (tv_map)); |
2928 | 112 |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
113 tv_map.assign ("sec", cpu.system_sec ()); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
114 tv_map.assign ("usec", cpu.system_usec ()); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
115 ru_map.assign ("stime", octave_value (tv_map)); |
2928 | 116 |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
117 ru_map.assign ("maxrss", static_cast<double> (rusage.maxrss ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
118 ru_map.assign ("ixrss", static_cast<double> (rusage.ixrss ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
119 ru_map.assign ("idrss", static_cast<double> (rusage.idrss ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
120 ru_map.assign ("isrss", static_cast<double> (rusage.isrss ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
121 ru_map.assign ("minflt", static_cast<double> (rusage.minflt ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
122 ru_map.assign ("majflt", static_cast<double> (rusage.majflt ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
123 ru_map.assign ("nswap", static_cast<double> (rusage.nswap ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
124 ru_map.assign ("inblock", static_cast<double> (rusage.inblock ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
125 ru_map.assign ("oublock", static_cast<double> (rusage.oublock ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
126 ru_map.assign ("msgsnd", static_cast<double> (rusage.msgsnd ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
127 ru_map.assign ("msgrcv", static_cast<double> (rusage.msgrcv ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
128 ru_map.assign ("nsignals", static_cast<double> (rusage.nsignals ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
129 ru_map.assign ("nvcsw", static_cast<double> (rusage.nvcsw ())); |
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
130 ru_map.assign ("nivcsw", static_cast<double> (rusage.nivcsw ())); |
2928 | 131 |
21930
f0c5dd1ea2b9
hide sys/time.h, sys/times.h, and sys/resource.h headers
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
132 return ovl (ru_map); |
2928 | 133 } |
20876
ec8c8977b0be
2015 Code Sprint: add BIST tests for getrusage()
Mike Miller <mtmiller@octave.org>
parents:
20853
diff
changeset
|
134 |
ec8c8977b0be
2015 Code Sprint: add BIST tests for getrusage()
Mike Miller <mtmiller@octave.org>
parents:
20853
diff
changeset
|
135 /* |
ec8c8977b0be
2015 Code Sprint: add BIST tests for getrusage()
Mike Miller <mtmiller@octave.org>
parents:
20853
diff
changeset
|
136 %!test |
ec8c8977b0be
2015 Code Sprint: add BIST tests for getrusage()
Mike Miller <mtmiller@octave.org>
parents:
20853
diff
changeset
|
137 %! r = getrusage (); |
ec8c8977b0be
2015 Code Sprint: add BIST tests for getrusage()
Mike Miller <mtmiller@octave.org>
parents:
20853
diff
changeset
|
138 %! assert (isstruct (r)); |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
139 %! assert (isfield (r, "idrss")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
140 %! assert (isfield (r, "inblock")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
141 %! assert (isfield (r, "isrss")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
142 %! assert (isfield (r, "ixrss")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
143 %! assert (isfield (r, "majflt")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
144 %! assert (isfield (r, "maxrss")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
145 %! assert (isfield (r, "minflt")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
146 %! assert (isfield (r, "msgrcv")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
147 %! assert (isfield (r, "msgsnd")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
148 %! assert (isfield (r, "nivcsw")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
149 %! assert (isfield (r, "nsignals")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
150 %! assert (isfield (r, "nswap")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
151 %! assert (isfield (r, "nvcsw")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
152 %! assert (isfield (r, "oublock")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
153 %! assert (isfield (r, "stime")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
154 %! assert (isfield (r, "utime")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
155 %! assert (isfield (r.stime, "sec")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
156 %! assert (isfield (r.stime, "usec")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
157 %! assert (isfield (r.utime, "sec")); |
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
158 %! assert (isfield (r.utime, "usec")); |
20876
ec8c8977b0be
2015 Code Sprint: add BIST tests for getrusage()
Mike Miller <mtmiller@octave.org>
parents:
20853
diff
changeset
|
159 */ |
29958
32c3a5805893
move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
160 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
30888
diff
changeset
|
161 OCTAVE_END_NAMESPACE(octave) |