public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/2] doc: Document process_state
Date: Tue, 6 Jan 2026 13:47:44 +0100	[thread overview]
Message-ID: <aV0EcJ7TjsgULZKl@yuki.lan> (raw)
In-Reply-To: <20251216112709.GC307257@pevik>

Hi!
> > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > ---
> >  doc/developers/api_c_tests.rst |  5 ++++
> >  include/tst_process_state.h    | 55 +++++++++++++++++++++-------------
> >  2 files changed, 40 insertions(+), 20 deletions(-)
> 
> > New in v2.
> 
> > diff --git a/doc/developers/api_c_tests.rst b/doc/developers/api_c_tests.rst
> > index 2ca0f0464..13fc8651b 100644
> > --- a/doc/developers/api_c_tests.rst
> > +++ b/doc/developers/api_c_tests.rst
> > @@ -43,6 +43,11 @@ Kernel
> >  .. kernel-doc:: ../../include/tst_kernel.h
> >  .. kernel-doc:: ../../include/tst_kvercmp.h
> 
> > +Process state
> > +-------------
> > +
> > +.. kernel-doc:: ../../include/tst_process_state.h
> > +
> >  NUMA
> >  ----
> >  .. kernel-doc:: ../../include/tst_numa.h
> > diff --git a/include/tst_process_state.h b/include/tst_process_state.h
> > index b1d83e109..3691bba7a 100644
> > --- a/include/tst_process_state.h
> > +++ b/include/tst_process_state.h
> > @@ -15,39 +15,54 @@
> 
> >  #ifdef TST_TEST_H__
> 
> > -/*
> > - * Waits for process state change.
> > +/**
> > + * TST_PROCESS_STATE_WAIT() - Waits for a process state change.
> > + *
> > + * Polls `/proc/$PID/state` for a process state changes.
> >   *
> > - * The state is one of the following:
> > + * @pid: A process pid.
> > + * @state: A state to wait for.
> > + * @msec_timeout: A timeout for the wait.
> >   *
> > - * R - process is running
> > - * S - process is sleeping
> > - * D - process sleeping uninterruptibly
> > - * Z - zombie process
> > - * T - process is traced
> > + * Possible process states:
> Maybe: use link to https://man7.org/linux/man-pages/man1/ps.1.html ?
> 
> -* Possible process states:
> +* Possible process states (see :man1:`ps`):

1. We do not have man1 defined in exlinks in conf.py

2. Even if added there exlinks does not seem work from documentation
   generated from headers

> > + *
> > + * - **R** Process is running.
> > + * - **S** Process is sleeping.
> > + * - **D** Process sleeping uninterruptibly.
> > + * - **Z** Zombie process.
> > + * - **T** Process is traced.
> > + * - **t** Tracing stopped.
> > + * - **X** Process id dead.
> 
> Process state is outdated, man ps(1) lists:
> 
>                D    uninterruptible sleep (usually I/O)
>                I    idle kernel thread
>                R    running or runnable (on run queue)
>                S    interruptible sleep (waiting for an
>                     event to complete)
>                T    stopped by job control signal
>                t    stopped by debugger during the tracing
>                W    paging (not valid since Linux 2.6)
>                X    dead (should never be seen)
>                Z    defunct (“zombie”) process, terminated
>                     but not reaped by its parent
> 
> We miss:
> * I (from kernel 4.2, maybe not relevant when we use it for a child which
> is userspace)
> * W (irrelevant as it is not valid)

Indeed these are not relevent for us.

> * Z

Zombie process is described in the list.

> Also, do we want specify the process states in both TST_PROCESS_STATE_WAIT() and
> TST_THREAD_STATE_WAIT(), or just specify it in one and mention in the other that
> they specify it? (via :ref: or c:func:).

Again, none of the :ref: or c:func: is working in docs generate from
headers.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-01-06 12:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 12:44 [LTP] [PATCH v2 1/2] doc: Document process_state Cyril Hrubis
2025-12-15 12:44 ` [LTP] [PATCH v2 2/2] doc: Add ground rules page Cyril Hrubis
2025-12-15 13:32   ` Li Wang via ltp
2025-12-15 14:03     ` Li Wang via ltp
2025-12-15 14:25       ` Anrea Cervesato via ltp
2025-12-15 14:30       ` Petr Vorel
2025-12-15 15:00         ` Andrea Cervesato via ltp
2025-12-16  7:07           ` Li Wang via ltp
2025-12-16  7:27         ` Li Wang via ltp
2025-12-16 10:11           ` Petr Vorel
2025-12-16 10:42             ` Li Wang via ltp
2025-12-16 11:08               ` Andrea Cervesato via ltp
2025-12-16 11:23                 ` Li Wang via ltp
2025-12-16 11:23     ` Cyril Hrubis
2025-12-16 11:24       ` Li Wang via ltp
2025-12-21 10:30     ` Petr Vorel
2025-12-15 14:52   ` Andrea Cervesato via ltp
2025-12-16 10:54   ` Petr Vorel
2025-12-16 11:01   ` Petr Vorel
2025-12-16 11:27 ` [LTP] [PATCH v2 1/2] doc: Document process_state Petr Vorel
2026-01-06 12:47   ` Cyril Hrubis [this message]
2026-01-06 13:21     ` Cyril Hrubis
2026-01-06 13:56       ` Petr Vorel
2026-01-06 15:15         ` Cyril Hrubis
2026-01-07  7:46           ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aV0EcJ7TjsgULZKl@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox