4

When I run ps xaf I have a following output:

ps xaf result

So my application has state code t+. But I can't find what it means. In man ps where is no such state code:

man ps

Does it equal to uppercase T state code? If it is, why do I always only get T state code when I do kill -SIGSTOP <pid>?

PepeHands
  • 1,368
  • 5
  • 20
  • 36

2 Answers2

4

Not all versions of Linux know about the t code. It was introduced in 2.6.33 as tracing stop that is different from signal stop indicated by T. In the latest versions of proc(5) (2014-07-10 or later) you will find the following:

                    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)

In addition to the usual R,S,D,Z,T,W status codes.

See the latest version on Michael Kerrisk page.

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
4

According to task_state_array[] from kernel sources 't' translates into "tracing stop", while 'T' is just "stopped".

/*
 * 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 */
};
molivier
  • 2,146
  • 1
  • 18
  • 20
  • Have a look to: https://github.com/torvalds/linux/blob/eae21770b4fed5597623aad0d618190fa60426ff/fs/proc/array.c#L120 – molivier Mar 09 '16 at 16:00