xref: /xnu-8796.121.2/osfmk/man/thread_basic_info.html (revision c54f35ca767986246321eb901baf8f5ff7923f6a) !
1*c54f35caSApple OSS Distributions<h2>thread_basic_info</h2>
2*c54f35caSApple OSS Distributions<hr>
3*c54f35caSApple OSS Distributions<p>
4*c54f35caSApple OSS Distributions<strong>Structure</strong> - Defines basic information for a thread.
5*c54f35caSApple OSS Distributions<h3>SYNOPSIS</h3>
6*c54f35caSApple OSS Distributions<pre>
7*c54f35caSApple OSS Distributions<strong>struct thread_basic_info</strong>
8*c54f35caSApple OSS Distributions<strong>{</strong>
9*c54f35caSApple OSS Distributions       <strong>time_value_t</strong>     <var>user_time</var><strong>;</strong>
10*c54f35caSApple OSS Distributions       <strong>time_value_t</strong>   <var>system_time</var><strong>;</strong>
11*c54f35caSApple OSS Distributions       <strong>integer_t</strong>        <var>cpu_usage</var><strong>;</strong>
12*c54f35caSApple OSS Distributions       <strong>policy_t</strong>            <var>policy</var><strong>;</strong>
13*c54f35caSApple OSS Distributions       <strong>integer_t</strong>        <var>run_state</var><strong>;</strong>
14*c54f35caSApple OSS Distributions       <strong>integer_t</strong>            <var>flags</var><strong>;</strong>
15*c54f35caSApple OSS Distributions       <strong>integer_t</strong>    <var>suspend_count</var><strong>;</strong>
16*c54f35caSApple OSS Distributions       <strong>integer_t</strong>       <var>sleep_time</var><strong>;</strong>
17*c54f35caSApple OSS Distributions<strong>};</strong>
18*c54f35caSApple OSS Distributions
19*c54f35caSApple OSS Distributions<strong>typedef struct thread_basic_info* thread_basic_info_t;</strong>
20*c54f35caSApple OSS Distributions</pre>
21*c54f35caSApple OSS Distributions<h3>FIELDS</h3>
22*c54f35caSApple OSS Distributions<dl>
23*c54f35caSApple OSS Distributions<dt> <var>user_time</var>
24*c54f35caSApple OSS Distributions<dd>
25*c54f35caSApple OSS DistributionsThe total user run time for the thread.
26*c54f35caSApple OSS Distributions     <p>
27*c54f35caSApple OSS Distributions<dt> <var>system_time</var>
28*c54f35caSApple OSS Distributions<dd>
29*c54f35caSApple OSS DistributionsThe total system run time for the thread.
30*c54f35caSApple OSS Distributions          <p>
31*c54f35caSApple OSS Distributions<dt> <var>cpu_usage</var>
32*c54f35caSApple OSS Distributions<dd>
33*c54f35caSApple OSS DistributionsScaled <strong>CPU</strong> usage percentage for the thread.
34*c54f35caSApple OSS Distributions          <p>
35*c54f35caSApple OSS Distributions<dt> <var>policy</var>
36*c54f35caSApple OSS Distributions<dd>
37*c54f35caSApple OSS DistributionsScheduling policy in effect
38*c54f35caSApple OSS Distributions          <p>
39*c54f35caSApple OSS Distributions<dt> <var>run_state</var>
40*c54f35caSApple OSS Distributions<dd>
41*c54f35caSApple OSS DistributionsThe thread's run state.  Possible values are:
42*c54f35caSApple OSS Distributions<dl>
43*c54f35caSApple OSS Distributions       <p>
44*c54f35caSApple OSS Distributions<dt> <strong>TH_STATE_RUNNING</strong>
45*c54f35caSApple OSS Distributions<dd>
46*c54f35caSApple OSS DistributionsThe thread is running normally.
47*c54f35caSApple OSS Distributions          <p>
48*c54f35caSApple OSS Distributions<dt> <strong>TH_STATE_STOPPED</strong>
49*c54f35caSApple OSS Distributions<dd>
50*c54f35caSApple OSS DistributionsThe thread is stopped.
51*c54f35caSApple OSS Distributions          <p>
52*c54f35caSApple OSS Distributions<dt> <strong>TH_STATE_WAITING</strong>
53*c54f35caSApple OSS Distributions<dd>
54*c54f35caSApple OSS DistributionsThe thread is waiting normally.
55*c54f35caSApple OSS Distributions          <p>
56*c54f35caSApple OSS Distributions<dt> <strong>TH_STATE_UNINTERRUPTIBLE</strong>
57*c54f35caSApple OSS Distributions<dd>
58*c54f35caSApple OSS DistributionsThe thread is in an un-interruptible wait state.
59*c54f35caSApple OSS Distributions          <p>
60*c54f35caSApple OSS Distributions<dt> <strong>TH_STATE_HALTED</strong>
61*c54f35caSApple OSS Distributions<dd>
62*c54f35caSApple OSS DistributionsThe thread is halted at a clean point.
63*c54f35caSApple OSS Distributions</dl>
64*c54f35caSApple OSS Distributions     <p>
65*c54f35caSApple OSS Distributions<dt> <var>flags</var>
66*c54f35caSApple OSS Distributions<dd>
67*c54f35caSApple OSS DistributionsSwap/idle flags for the thread.  Possible values are:
68*c54f35caSApple OSS Distributions<dl>
69*c54f35caSApple OSS Distributions       <p>
70*c54f35caSApple OSS Distributions<dt> <strong>TH_FLAGS_SWAPPED</strong>
71*c54f35caSApple OSS Distributions<dd>
72*c54f35caSApple OSS DistributionsThe thread is swapped out.
73*c54f35caSApple OSS Distributions          <p>
74*c54f35caSApple OSS Distributions<dt> <strong>TH_FLAGS_IDLE</strong>
75*c54f35caSApple OSS Distributions<dd>
76*c54f35caSApple OSS DistributionsThe thread is an idle thread.
77*c54f35caSApple OSS Distributions</dl>
78*c54f35caSApple OSS Distributions     <p>
79*c54f35caSApple OSS Distributions<dt> <var>suspend_count</var>
80*c54f35caSApple OSS Distributions<dd>
81*c54f35caSApple OSS DistributionsThe current suspend count for the thread.
82*c54f35caSApple OSS Distributions          <p>
83*c54f35caSApple OSS Distributions<dt> <var>sleep_time</var>
84*c54f35caSApple OSS Distributions<dd>
85*c54f35caSApple OSS DistributionsThe number of seconds that the thread has been sleeping.
86*c54f35caSApple OSS Distributions</dl>
87*c54f35caSApple OSS Distributions<h3>DESCRIPTION</h3>
88*c54f35caSApple OSS Distributions<p>
89*c54f35caSApple OSS DistributionsThe <strong>thread_basic_info</strong> structure defines the basic information
90*c54f35caSApple OSS Distributionsarray for threads.
91*c54f35caSApple OSS DistributionsThe <strong>thread_info</strong> function returns this array for a specified thread.
92*c54f35caSApple OSS Distributions<h3>RELATED INFORMATION</h3>
93*c54f35caSApple OSS Distributions<p>
94*c54f35caSApple OSS DistributionsFunctions:
95*c54f35caSApple OSS Distributions<a href="thread_info.html"><strong>thread_info</strong></a>.
96*c54f35caSApple OSS Distributions<p>
97*c54f35caSApple OSS DistributionsData Structures:
98*c54f35caSApple OSS Distributions<a href="policy_fifo_info.html"><strong>policy_fifo_info</strong></a>,
99*c54f35caSApple OSS Distributions<a href="policy_rr_info.html"><strong>policy_rr_info</strong></a>,
100*c54f35caSApple OSS Distributions<a href="policy_timeshare_info.html"><strong>policy_timeshare_info</strong></a>.
101