ps状态代码中小写t的含义是什么

时间:2016-03-09 15:31:56

标签: linux ps

当我运行ps xaf时,我有以下输出:

ps xaf result

所以我的应用程序有州代码t+。但我无法找到它意味着什么。在man ps中没有这样的州代码:

man ps

它是否等于大写T州代码?如果是,为什么我在T时始终只获取kill -SIGSTOP <pid>州代码?

2 个答案:

答案 0 :(得分:4)

并非所有版本的Linux都了解t代码。它在2.6.33中作为跟踪停止引入,与T指示的信号停止不同。在最新版本的proc(5)(2014-07-10或更高版本)中,您会找到以下内容:

                    T  Stopped (on a signal) or (before Linux 2.6.33)
                       trace stopped
                    t  Tracing stop (Linux 2.6.33 onward)
                    W  Paging (only before Linux 2.6.0)
                    X  Dead (from Linux 2.6.0 onward)
                    x  Dead (Linux 2.6.33 to 3.13 only)
                    K  Wakekill (Linux 2.6.33 to 3.13 only)
                    W  Waking (Linux 2.6.33 to 3.13 only)
                    P  Parked (Linux 3.9 to 3.13 only)

除了通常的R,S,D,Z,T,W状态代码外。

查看Michael Kerrisk page上的最新版本。

答案 1 :(得分:4)

来自内核来源的task_state_array[]&#39;&#39;翻译成&#34;追踪停止&#34;同时&#39; T&#39;只是&#34;停止&#34;。

/*
 * The task state array is a strange "bitmap" of
 * reasons to sleep. Thus "running" is zero, and
 * you can test for combinations of others with
 * simple bit tests.
 */
static const char * const task_state_array[] = {
    "R (running)",      /*   0 */
    "S (sleeping)",     /*   1 */
    "D (disk sleep)",   /*   2 */
    "T (stopped)",      /*   4 */
    "t (tracing stop)", /*   8 */
    "X (dead)",     /*  16 */
    "Z (zombie)",       /*  32 */
};