]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/task_sample.html
xnu-2422.1.72.tar.gz
[apple/xnu.git] / osfmk / man / task_sample.html
CommitLineData
13fec989
A
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]
17Port for the task whose threads' PC are to be
18sampled.
19<p>
20<dt> <var>reply_port</var>
21<dd>
22[in sample receive (to be converted to send) right]
23Port to which PC sample buffers are sent. A value of <strong>MACH_PORT_NULL</strong>
24stops PC sampling for the task.
25</dl>
26<h3>DESCRIPTION</h3>
27<p>
28The <strong>task_sample</strong> function causes the program counter (PC) of the
29specified <var>sample_task</var> (actually, all of the threads within
30<var>sample_task</var>) to be sampled periodically (whenever one of the threads
31happens to be running at the time of the kernel's "hardclock" interrupt).
32The set of PC sample values obtained are saved in buffers which are sent to
33the specified <var>reply_port</var> in <strong>receive_samples</strong> messages.
34<h3>RETURN VALUES</h3>
35<p>
36Only generic errors apply.
37<h3>RELATED INFORMATION</h3>
38<p>
39Functions:
40<a href="thread_sample.html"><strong>thread_sample</strong></a>,
41<a href="receive_samples.html"><strong>receive_samples</strong></a>.