]> git.saurik.com Git - apple/xnu.git/blob - osfmk/man/task_sample.html
xnu-1504.15.3.tar.gz
[apple/xnu.git] / osfmk / man / task_sample.html
1 <h2>task_sample</h2>
2 <hr>
3 <p>
4 <strong>Function</strong> - Sample the target task's thread program counters periodically.
5 <h3>SYNOPSIS</h3>
6 <pre>
7 <strong>kern_return_t task_sample</strong>
8 <strong>(task_t</strong> <var>sample_task</var>,
9 <strong>mach_port_make_send_t</strong> <var>reply_port</var><strong>);</strong>
10 </pre>
11 <h3>PARAMETERS</h3>
12 <dl>
13 <p>
14 <dt> <var>sample_task</var>
15 <dd>
16 [in task send right]
17 Port for the task whose threads' PC are to be
18 sampled.
19 <p>
20 <dt> <var>reply_port</var>
21 <dd>
22 [in sample receive (to be converted to send) right]
23 Port to which PC sample buffers are sent. A value of <strong>MACH_PORT_NULL</strong>
24 stops PC sampling for the task.
25 </dl>
26 <h3>DESCRIPTION</h3>
27 <p>
28 The <strong>task_sample</strong> function causes the program counter (PC) of the
29 specified <var>sample_task</var> (actually, all of the threads within
30 <var>sample_task</var>) to be sampled periodically (whenever one of the threads
31 happens to be running at the time of the kernel's "hardclock" interrupt).
32 The set of PC sample values obtained are saved in buffers which are sent to
33 the specified <var>reply_port</var> in <strong>receive_samples</strong> messages.
34 <h3>RETURN VALUES</h3>
35 <p>
36 Only generic errors apply.
37 <h3>RELATED INFORMATION</h3>
38 <p>
39 Functions:
40 <a href="thread_sample.html"><strong>thread_sample</strong></a>,
41 <a href="receive_samples.html"><strong>receive_samples</strong></a>.