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