1 .\"
2 .\" Mach Operating System
3 .\" Copyright (c) 1991,1990 Carnegie Mellon University
4 .\" All Rights Reserved.
5 .\"
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
11 .\"
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 .\"
16 .\" Carnegie Mellon requests users of this software to return to
17 .\"
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
22 .\"
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"
26 .\"
27 .\" HISTORY
28 .\" $Log: task_enable_pc_sampling.man,v $
29 .\" Revision 2.3 93/08/10 15:32:20 mrt
30 .\" Fixed the SEE ALSO reference
31 .\"
32 .\" Revision 2.2 93/08/10 15:18:23 mrt
33 .\" First checkin
34 .\"
35 .\"
36 .\" Created.
37 .\"
38 .TH task_enable_pc_sampling 2 8/8/93
39 .CM 4
40 .SH NAME
41 .nf
42 task_enable_pc_sampling \- enable PC sampling for task
43 task_disable_pc_sampling \- disable PC sampling for task
44 task_get_sampled_pcs \- extract PC samples for task
45 thread_enable_pc_sampling \- enable PC sampling for thread
46 thread_disable_pc_sampling \- disable PC sampling for thread
47 thread_get_sampled_pcs \- extract PC samples for thread
48
49 .SH SYNOPSIS
50 .nf
51 .ft B
52 #include <mach.h>
53 #include <mach/pc_sample.h>
54
55 .nf
56 .ft B
57 kern_return_t
58 task_enable_pc_sampling(task_t task;
59 int *ticks;
60 sampled_pc_flavor_t flavor)
61 .fi
62 .ft P
63
64 .nf
65 .ft B
66 kern_return_t
67 task_disable_pc_sampling(task_t task;
68 int *sample_cnt);
69
70 .fi
71 .ft P
72
73 .nf
74 .ft B
75 kern_return_t
76 task_get_sampled_pcs(task_t task;
77 unsigned *seqno;
78 sampled_pc_t sampled_pcs[]
79 int *sample_cnt);
80 .fi
81 .ft P
82
83 .nf
84 .ft B
85 kern_return_t
86 thread_enable_pc_sampling(thread_t thread;
87 int *ticks;
88 sampled_pc_flavor_t flavor)
89 .fi
90 .ft P
91 .nf
92 .ft B
93 kern_return_t
94 thread_disable_pc_sampling(thread_t thread;
95 int *sample_cnt);
96
97 .fi
98 .ft P
99 .nf
100 .ft B
101 kern_return_t
102 task_get_sampled_pcs(task_t task;
103 unsigned *seqno;
104 sampled_pc_t sampled_pcs[]
105 int *sample_cnt);
106 .fi
107 .ft P
108 .SH ARGUMENTS
109 .TP 15
110 .B
111 task_t
112 The task on which the operation should be applied.
113 .TP 15
114 .B
115 thread_t
116 The thread on which the operation should be applied.
117 .TP 15
118 .B
119 ticks
120 The kernel's idea of clock granularity (ticks per second). Don't trust
121 this.
122
123 .TP 15
124 .B
125 flavor
126 The sampling flavor, which could be any of the flavors defined in
127 pc_sample.h.
128
129 .TP 15
130 .B
131 seqno
132 The sequence number of the sampled PCs. This is useful for
133 determining when a collector thread has missed a sample.
134
135 .TP 15
136 .B
137 sampled_pcs
138 The sampled PCs for the argument task or thread. A sample contains
139 three fields: a thread-specific unique identifier, a pc value, and the
140 type of the sample as per flavor.
141
142 .TP 15
143 .B
144 sample_cnt
145 The number of sample elements in the kernel for the named task or thread.
146
147
148 .SH DESCRIPTION
149 These routines control the kernel's PC sampling policy for the named
150 task or thread.
151 .SH DIAGNOSTICS
152 .TP 25
153 KERN_SUCCESS
154 Operation completed successfully
155 .TP 25
156 KERN_INVALID_ARGUMENT
157 .B task or thread
158 is not a valid task or thread.
159 .TP 25
160 KERN_FAILURE
161 .B task or thread
162 is not being sampled.
163
164
165 .SH BUGS
166 Periodic sampling makes only moderate amounts of sense with very fast
167 processors.
168
169 You can't mix periodic and non-periodic samples easily.
170
171 .SH SEE ALSO
172 mach3_profiling(1)
173
174
175
Cache object: ecded2cdae173028bf5385fc87e0c5b4
|