]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/task_info.h
xnu-123.5.tar.gz
[apple/xnu.git] / osfmk / mach / task_info.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * @OSF_COPYRIGHT@
24 */
25/*
26 * HISTORY
27 *
28 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
29 * Import of Mac OS X kernel (~semeria)
30 *
31 * Revision 1.2 1998/04/29 17:36:54 mburg
32 * MK7.3 merger
33 *
34 * Revision 1.2.31.1 1998/02/03 09:33:56 gdt
35 * Merge up to MK7.3
36 * [1998/02/03 09:17:49 gdt]
37 *
38 * Revision 1.2.29.1 1997/06/17 03:01:26 devrcs
39 * Added `TASK_SCHED_INFO.'
40 * [1996/03/18 15:24:59 rkc]
41 *
42 * Revision 1.2.21.3 1995/01/06 19:51:51 devrcs
43 * mk6 CR668 - 1.3b26 merge
44 * 64bit cleanup, ledgers, security, flavors.
45 * [1994/10/14 03:43:10 dwm]
46 *
47 * Revision 1.2.21.2 1994/09/23 02:42:46 ezf
48 * change marker to not FREE
49 * [1994/09/22 21:42:56 ezf]
50 *
51 * Revision 1.2.21.1 1994/08/07 20:50:07 bolinger
52 * Merge up to colo_b7.
53 * [1994/08/01 21:02:06 bolinger]
54 *
55 * Revision 1.2.17.4 1994/06/25 03:47:20 dwm
56 * mk6 CR98 - add flavor interface typedefs (task_flavor_t).
57 * [1994/06/24 21:54:58 dwm]
58 *
59 * Revision 1.2.17.3 1994/05/02 21:36:04 dwm
60 * Remove nmk15_compat support.
61 * [1994/05/02 21:09:10 dwm]
62 *
63 * Revision 1.2.17.2 1994/01/14 18:42:23 bolinger
64 * Add TASK_USER_DATA flavor of task_info() (and task_set_info()).
65 * [1994/01/14 18:20:52 bolinger]
66 *
67 * Revision 1.2.17.1 1994/01/12 17:57:26 dwm
68 * Fix "ifdef" NMK15_COMPAT to "if"
69 * [1994/01/12 17:31:13 dwm]
70 *
71 * Revision 1.2.3.5 1993/08/03 18:29:52 gm
72 * CR9596: Change KERNEL to MACH_KERNEL.
73 * [1993/08/02 18:33:57 gm]
74 *
75 * Revision 1.2.3.4 1993/07/08 19:04:52 watkins
76 * New version of task_basic_info structure; old version
77 * is now under nmk15_compat.
78 * [1993/07/07 21:04:11 watkins]
79 *
80 * Revision 1.2.3.3 1993/06/29 21:55:50 watkins
81 * New definitions for scheduling control interfaces.
82 * [1993/06/29 20:50:59 watkins]
83 *
84 * Revision 1.2.3.2 1993/06/09 02:43:32 gm
85 * Added to OSF/1 R1.3 from NMK15.0.
86 * [1993/06/02 21:18:18 jeffc]
87 *
88 * Revision 1.2 1993/04/19 16:39:27 devrcs
89 * ansi C conformance changes
90 * [1993/02/02 18:54:59 david]
91 *
92 * Revision 1.1 1992/09/30 02:32:09 robert
93 * Initial revision
94 *
95 * $EndLog$
96 */
97/* CMU_HIST */
98/*
99 * Revision 2.4 91/05/14 17:00:41 mrt
100 * Correcting copyright
101 *
102 * Revision 2.3 91/02/05 17:36:25 mrt
103 * Changed to new Mach copyright
104 * [91/02/01 17:21:17 mrt]
105 *
106 * Revision 2.2 90/05/03 15:48:36 dbg
107 * Added TASK_THREAD_TIMES_INFO flavor.
108 * [90/04/03 dbg]
109 *
110 * Revision 2.1 89/08/03 16:04:49 rwd
111 * Created.
112 *
113 * Revision 2.3 89/02/25 18:41:06 gm0w
114 * Changes for cleanup.
115 *
116 * 15-Jan-88 David Golub (dbg) at Carnegie-Mellon University
117 * Created, based on old task_statistics.
118 *
119 */
120/* CMU_ENDHIST */
121/*
122 * Mach Operating System
123 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
124 * All Rights Reserved.
125 *
126 * Permission to use, copy, modify and distribute this software and its
127 * documentation is hereby granted, provided that both the copyright
128 * notice and this permission notice appear in all copies of the
129 * software, derivative works or modified versions, and any portions
130 * thereof, and that both notices appear in supporting documentation.
131 *
132 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
133 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
134 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
135 *
136 * Carnegie Mellon requests users of this software to return to
137 *
138 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
139 * School of Computer Science
140 * Carnegie Mellon University
141 * Pittsburgh PA 15213-3890
142 *
143 * any improvements or extensions that they make and grant Carnegie Mellon
144 * the rights to redistribute these changes.
145 */
146/*
147 */
148/*
149 * Machine-independent task information structures and definitions.
150 *
151 * The definitions in this file are exported to the user. The kernel
152 * will translate its internal data structures to these structures
153 * as appropriate.
154 *
155 */
156
157#ifndef TASK_INFO_H_
158#define TASK_INFO_H_
159
160#include <mach/machine/vm_types.h>
161#include <mach/time_value.h>
162#include <mach/policy.h>
163
164/*
165 * Generic information structure to allow for expansion.
166 */
167typedef natural_t task_flavor_t;
168typedef integer_t *task_info_t; /* varying array of int */
169
170#define TASK_INFO_MAX (1024) /* maximum array size */
171typedef integer_t task_info_data_t[TASK_INFO_MAX];
172
173/*
174 * Currently defined information structures.
175 */
176
177#define TASK_BASIC_INFO 4 /* basic information */
178
179struct task_basic_info {
180 integer_t suspend_count; /* suspend count for task */
181 vm_size_t virtual_size; /* number of virtual pages */
182 vm_size_t resident_size; /* number of resident pages */
183 time_value_t user_time; /* total user run time for
184 terminated threads */
185 time_value_t system_time; /* total system run time for
186 terminated threads */
187 policy_t policy; /* default policy for new threads */
188};
189
190typedef struct task_basic_info task_basic_info_data_t;
191typedef struct task_basic_info *task_basic_info_t;
192#define TASK_BASIC_INFO_COUNT \
193 (sizeof(task_basic_info_data_t) / sizeof(natural_t))
194
195
196#define TASK_EVENTS_INFO 2 /* various event counts */
197
198struct task_events_info {
199 integer_t faults; /* number of page faults */
200 integer_t pageins; /* number of actual pageins */
201 integer_t cow_faults; /* number of copy-on-write faults */
202 integer_t messages_sent; /* number of messages sent */
203 integer_t messages_received; /* number of messages received */
204 integer_t syscalls_mach; /* number of mach system calls */
205 integer_t syscalls_unix; /* number of unix system calls */
206 integer_t csw; /* number of context switches */
207};
208typedef struct task_events_info task_events_info_data_t;
209typedef struct task_events_info *task_events_info_t;
210#define TASK_EVENTS_INFO_COUNT \
211 (sizeof(task_events_info_data_t) / sizeof(natural_t))
212
213#define TASK_THREAD_TIMES_INFO 3 /* total times for live threads -
214 only accurate if suspended */
215
216struct task_thread_times_info {
217 time_value_t user_time; /* total user run time for
218 live threads */
219 time_value_t system_time; /* total system run time for
220 live threads */
221};
222
223typedef struct task_thread_times_info task_thread_times_info_data_t;
224typedef struct task_thread_times_info *task_thread_times_info_t;
225#define TASK_THREAD_TIMES_INFO_COUNT \
226 (sizeof(task_thread_times_info_data_t) / sizeof(natural_t))
227
228#define TASK_SCHED_TIMESHARE_INFO 10
229#define TASK_SCHED_RR_INFO 11
230#define TASK_SCHED_FIFO_INFO 12
231
232#define TASK_SECURITY_TOKEN 13
233#define TASK_SECURITY_TOKEN_COUNT \
234 (sizeof(security_token_t) / sizeof(natural_t))
235
236#define TASK_SCHED_INFO 14
237
238#endif /* TASK_INFO_H_ */