2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
31 * All Rights Reserved.
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
43 * Carnegie Mellon requests users of this software to return to
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
56 * Machine-independent task information structures and definitions.
58 * The definitions in this file are exported to the user. The kernel
59 * will translate its internal data structures to these structures
67 #include <mach/machine/vm_types.h>
68 #include <mach/time_value.h>
69 #include <mach/policy.h>
71 #include <sys/appleapiopts.h>
74 * Generic information structure to allow for expansion.
76 typedef natural_t task_flavor_t
;
77 typedef integer_t
*task_info_t
; /* varying array of int */
79 #define TASK_INFO_MAX (1024) /* maximum array size */
80 typedef integer_t task_info_data_t
[TASK_INFO_MAX
];
83 * Currently defined information structures.
86 #define TASK_BASIC_INFO 4 /* basic information */
88 struct task_basic_info
{
89 integer_t suspend_count
; /* suspend count for task */
90 vm_size_t virtual_size
; /* number of virtual pages */
91 vm_size_t resident_size
; /* number of resident pages */
92 time_value_t user_time
; /* total user run time for
94 time_value_t system_time
; /* total system run time for
96 policy_t policy
; /* default policy for new threads */
99 typedef struct task_basic_info task_basic_info_data_t
;
100 typedef struct task_basic_info
*task_basic_info_t
;
101 #define TASK_BASIC_INFO_COUNT \
102 (sizeof(task_basic_info_data_t) / sizeof(natural_t))
105 #define TASK_EVENTS_INFO 2 /* various event counts */
107 struct task_events_info
{
108 integer_t faults
; /* number of page faults */
109 integer_t pageins
; /* number of actual pageins */
110 integer_t cow_faults
; /* number of copy-on-write faults */
111 integer_t messages_sent
; /* number of messages sent */
112 integer_t messages_received
; /* number of messages received */
113 integer_t syscalls_mach
; /* number of mach system calls */
114 integer_t syscalls_unix
; /* number of unix system calls */
115 integer_t csw
; /* number of context switches */
117 typedef struct task_events_info task_events_info_data_t
;
118 typedef struct task_events_info
*task_events_info_t
;
119 #define TASK_EVENTS_INFO_COUNT \
120 (sizeof(task_events_info_data_t) / sizeof(natural_t))
122 #define TASK_THREAD_TIMES_INFO 3 /* total times for live threads -
123 only accurate if suspended */
125 struct task_thread_times_info
{
126 time_value_t user_time
; /* total user run time for
128 time_value_t system_time
; /* total system run time for
132 typedef struct task_thread_times_info task_thread_times_info_data_t
;
133 typedef struct task_thread_times_info
*task_thread_times_info_t
;
134 #define TASK_THREAD_TIMES_INFO_COUNT \
135 (sizeof(task_thread_times_info_data_t) / sizeof(natural_t))
137 #ifdef __APPLE_API_UNSTABLE
139 #define TASK_SCHED_TIMESHARE_INFO 10
140 #define TASK_SCHED_RR_INFO 11
141 #define TASK_SCHED_FIFO_INFO 12
143 #define TASK_SCHED_INFO 14
145 #endif /* __APPLE_API_UNSTABLE */
147 #define TASK_SECURITY_TOKEN 13
148 #define TASK_SECURITY_TOKEN_COUNT \
149 (sizeof(security_token_t) / sizeof(natural_t))
151 #define TASK_AUDIT_TOKEN 15
152 #define TASK_AUDIT_TOKEN_COUNT \
153 (sizeof(audit_token_t) / sizeof(natural_t))
155 #endif /* TASK_INFO_H_ */