]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/bsdtask_info.h
xnu-1228.0.2.tar.gz
[apple/xnu.git] / bsd / sys / bsdtask_info.h
CommitLineData
0c530ab8
A
1
2/*
3 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
4 *
2d21ac55
A
5 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. The rights granted to you under the License
11 * may not be used to create, or enable the creation or redistribution of,
12 * unlawful or unlicensed copies of an Apple operating system, or to
13 * circumvent, violate, or enable the circumvention or violation of, any
14 * terms of an Apple operating system software license agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 *
19 * The Original Code and all software distributed under the License are
20 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
0c530ab8
A
21 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
22 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
23 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
24 * Please see the License for the specific language governing rights and
25 * limitations under the License.
26 *
27 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
0c530ab8
A
28 */
29
30#ifndef _SYS_BSDTASK_INFO_H
31#define _SYS_BSDTASK_INFO_H
32
33struct proc_taskinfo_internal {
34 uint64_t pti_virtual_size; /* virtual memory size (bytes) */
35 uint64_t pti_resident_size; /* resident memory size (bytes) */
36 uint64_t pti_total_user; /* total time */
37 uint64_t pti_total_system;
38 uint64_t pti_threads_user; /* existing threads only */
39 uint64_t pti_threads_system;
40 int32_t pti_policy; /* default policy for new threads */
41 int32_t pti_faults; /* number of page faults */
42 int32_t pti_pageins; /* number of actual pageins */
43 int32_t pti_cow_faults; /* number of copy-on-write faults */
44 int32_t pti_messages_sent; /* number of messages sent */
45 int32_t pti_messages_received; /* number of messages received */
46 int32_t pti_syscalls_mach; /* number of mach system calls */
47 int32_t pti_syscalls_unix; /* number of unix system calls */
48 int32_t pti_csw; /* number of context switches */
49 int32_t pti_threadnum; /* number of threads in the task */
50 int32_t pti_numrunning; /* number of running threads */
51 int32_t pti_priority; /* task priority*/
52};
53
54
55struct proc_threadinfo_internal {
56 uint64_t pth_user_time; /* user run time */
57 uint64_t pth_system_time; /* system run time */
58 int32_t pth_cpu_usage; /* scaled cpu usage percentage */
59 int32_t pth_policy; /* scheduling policy in effect */
60 int32_t pth_run_state; /* run state (see below) */
61 int32_t pth_flags; /* various flags (see below) */
62 int32_t pth_sleep_time; /* number of seconds that thread */
63 int32_t pth_curpri; /* cur priority*/
64 int32_t pth_priority; /* priority*/
65 int32_t pth_maxpriority; /* max priority*/
2d21ac55 66 char * pth_name[64]; /* thread name, if any */
0c530ab8
A
67};
68
69
70
71struct proc_regioninfo_internal {
72 uint32_t pri_protection;
73 uint32_t pri_max_protection;
74 uint32_t pri_inheritance;
75 uint32_t pri_flags; /* shared, external pager, is submap */
76 uint64_t pri_offset;
77 uint32_t pri_behavior;
78 uint32_t pri_user_wired_count;
79 uint32_t pri_user_tag;
80 uint32_t pri_pages_resident;
81 uint32_t pri_pages_shared_now_private;
82 uint32_t pri_pages_swapped_out;
83 uint32_t pri_pages_dirtied;
84 uint32_t pri_ref_count;
85 uint32_t pri_shadow_depth;
86 uint32_t pri_share_mode;
87 uint32_t pri_private_pages_resident;
88 uint32_t pri_shared_pages_resident;
89 uint32_t pri_obj_id;
2d21ac55 90 uint32_t pri_depth;
0c530ab8
A
91 uint64_t pri_address;
92 uint64_t pri_size;
0c530ab8
A
93};
94
95#ifdef MACH_KERNEL_PRIVATE
96
97#define PROC_REGION_SUBMAP 1
98#define PROC_REGION_SHARED 2
99
100void vm_map_region_top_walk(vm_map_entry_t entry, vm_region_top_info_t top);
101void vm_map_region_walk(vm_map_t map, vm_map_offset_t a, vm_map_entry_t entry, vm_object_offset_t offset, vm_object_size_t range, vm_region_extended_info_t extended);
102kern_return_t vnode_pager_get_object_vnode(memory_object_t mem_obj,uint32_t * vnodeaddr, uint32_t * vid);
103extern uint32_t vnode_vid(void *vp);
104
105#endif /* MACH_KERNEL_PRIVATE */
106
107extern int fill_procregioninfo(task_t t, uint64_t arg, struct proc_regioninfo_internal *pinfo, uint32_t *vp, uint32_t *vid);
108void fill_taskprocinfo(task_t task, struct proc_taskinfo_internal * ptinfo);
2d21ac55 109int fill_taskthreadinfo(task_t task, uint64_t thaddr, struct proc_threadinfo_internal * ptinfo, void *, int *);
0c530ab8
A
110int fill_taskthreadlist(task_t task, void * buffer, int thcount);
111int get_numthreads(task_t);
2d21ac55 112void bsd_threadcdir(void * uth, void *vptr, int *vidp);
0c530ab8
A
113
114#endif /*_SYS_BSDTASK_INFO_H */
115