TASK_RUNNING task (process) currently running
TASK_INTERRUPTABLE process is sleeping but can be woken up (interrupted)
TASK_UNINTERRUPTABLE process is sleeping but can not be woken up (interrupted)
TASK_ZOMBIE process terminated but its status was not collected (it was not waited for)
TASK_STOPPED process stopped by a debugger or job control
TASK_SWAPPING (removed in 2.3.x kernel)
The Life Cycle of Processes
"The /proc/pid/sched file contains a metric ton of scheduling data.I suggest reading through the /proc/*/sched files looking for se.statistics.nr_wakeups or se.statistics.wait_count lines that don't change for an hour. I don't know off-hand which one would give you 'better' results, but try both :) and see which one gives you answers like you expect." ref.
and another link:
Get Process Status
[UPDATED]
Running :
if you read through the
/proc/*/sched
files looking for
se.statistics.nr_wakeups
or
se.statistics.wait_count
lines that changes shortly that means its running.
Sleeping:
if you read through the
/proc/*/sched
files looking for
se.statistics.nr_wakeups
or
se.statistics.wait_count
lines that don't change for an hour that means its sleeping.