Skip to content

apps/system: Update to print waitsem info in ps#7177

Merged
sunghan-chang merged 2 commits intoSamsung:masterfrom
seokhun-eom24:260304-ps-waitsem
Mar 25, 2026
Merged

apps/system: Update to print waitsem info in ps#7177
sunghan-chang merged 2 commits intoSamsung:masterfrom
seokhun-eom24:260304-ps-waitsem

Conversation

@seokhun-eom24
Copy link
Copy Markdown
Contributor

@seokhun-eom24 seokhun-eom24 commented Mar 4, 2026

1. os/fs/procfs: Include wait info into proc_entry_stat

Include waitsem, msgwaitq, sigwaitmask information into proc_entry_stat.

2. apps/system: Update to print waitsem info in ps

Add PROC_STAT_WAITINFO to get wait sem, mq, signal information from procfs.
Update to print wait information in ps command.
Update README for ps command output format.

[Example]

TASH>>ps

  PID | PRIO | FLAG |  TYPE   | NP |  STATUS  | WAIT INFO  | CPU | IRQCOUNT | NAME
------|------|------|---------|----|----------|------------|-----|----------|-----
mm_get_app_heap_name: address 0x60126400 is not in any app heap region.
    0 |    0 | FIFO | KTHREAD | N  | RUNNING  |          - |   0 |        0 | CPU0 IDLE
mm_get_app_heap_name: address 0x60126000 is not in any app heap region.
    1 |    0 | FIFO | KTHREAD | N  | RUNNING  |          - |   1 |        0 | CPU1 IDLE
mm_get_app_heap_name: address 0x60130c40 is not in any app heap region.
    2 |  201 | RR   | KTHREAD |    | WAITSIG  |   00020000 |   1 |        2 | hpwork
mm_get_app_heap_name: address 0x60132380 is not in any app heap region.
    3 |   50 | RR   | KTHREAD |    | WAITSIG  |   00020000 |   1 |        2 | lpwork
mm_get_app_heap_name: address 0x60136200 is not in any app heap region.
    5 |  200 | RR   | KTHREAD |    | MQNEMPTY | 0x60136aa0 |   1 |        1 | km4_log_task
mm_get_app_heap_name: address 0x601b7b80 is not in any app heap region.
    6 |  204 | RR   | KTHREAD |    | WAITSEM  | 0x60191418 |   1 |        1 | LCD Frame flusing
mm_get_app_heap_name: address 0x601bb310 is not in any app heap region.
    7 |  107 | RR   | KTHREAD |    | WAITSEM  | 0x601ba3a0 |   1 |        1 | inic_msg_q_task
mm_get_app_heap_name: address 0x601bd2d0 is not in any app heap region.
    8 |  104 | RR   | KTHREAD |    | WAITSEM  | 0x601bc320 |   1 |        1 | inic_host_rx_tasklet
mm_get_app_heap_name: address 0x601bf2b0 is not in any app heap region.
    9 |  103 | RR   | KTHREAD |    | WAITSEM  | 0x601be2e0 |   1 |        1 | inic_ipc_api_host_task
mm_get_app_heap_name: address 0x601c24d0 is not in any app heap region.
   11 |  100 | RR   | KTHREAD |    | WAITSIG  |   00000000 |   1 |        2 | NDP_health_check
mm_get_app_heap_name: address 0x601d4da0 is not in any app heap region.
   12 |  105 | RR   | KTHREAD |    | WAITSEM  | 0x6011880c |   0 |        2 | LWIP_TCP/IP
mm_get_app_heap_name: address 0x601d6ce0 is not in any app heap region.
   13 |  100 | RR   | KTHREAD |    | WAITSEM  | 0x60117c74 |   0 |        1 | netmgr_event_handler
mm_get_app_heap_name: address 0x601d84c0 is not in any app heap region.
   14 |  200 | RR   | KTHREAD |    | MQNEMPTY | 0x601db910 |   1 |        1 | log_dump
mm_get_app_heap_name: address 0x601decd0 is not in any app heap region.
   15 |  203 | RR   | KTHREAD |    | MQNEMPTY | 0x601333d0 |   0 |        1 | binary_manager
   18 |  180 | RR   | TASK    |    | WAITSIG  |   00000000 |   0 |        2 | app1
   19 |  100 | RR   | TASK    |    | WAITSIG  |   00020000 |   0 |        1 | uwork
   20 |  125 | RR   | TASK    |    | WAITSEM  |          0 |   0 |        1 | tash
   21 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f82580 |   0 |        1 | PlayerWorker
   22 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f82694 |   0 |        1 | RecorderWorker
   23 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f8260c |   0 |        1 | PlayerObserverWorker
   24 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f82714 |   0 |        1 | RecorderObserverWorker
   25 |  199 | RR   | PTHREAD |    | WAITSEM  | 0x63f82508 |   0 |        1 | FocusManagerWorker
   26 |  100 | RR   | TASK    |    | WAITSEM  | 0x63a9008c |   0 |        1 | wifi msg handler
   27 |  100 | RR   | TASK    |    | WAITSEM  | 0x63a917ac |   0 |        1 | ble msg handler

Copy link
Copy Markdown
Member

@pcs1265 pcs1265 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about separate commits to os/ modification and apps/ modification?
It will be convinient to bring this change to internal code base.

@seokhun-eom24
Copy link
Copy Markdown
Contributor Author

seokhun-eom24 commented Mar 10, 2026

How about separate commits to os/ modification and apps/ modification? It will be convinient to bring this change to internal code base.

Thank you for the suggestion, I've split the commit.

@sunghan-chang
Copy link
Copy Markdown
Contributor

@seokhun-eom24 You added a new row for waitsem. But there are other waits like mq and signal.
Let's add them all there.

  1. we can change the title from waitsem to wait info?
  2. show mq information for mqempty or full, signal masking for sigwait

Include waitsem, msgwaitq, sigwaitmask information into proc_entry_stat.

Signed-off-by: seokhun-eom <seokhun.eom@samsung.com>
@seokhun-eom24
Copy link
Copy Markdown
Contributor Author

@seokhun-eom24 You added a new row for waitsem. But there are other waits like mq and signal. Let's add them all there.

  1. we can change the title from waitsem to wait info?
  2. show mq information for mqempty or full, signal masking for sigwait

Thank you for suggest.
I updated to print all waiting information about sem, mq and signal.

Add PROC_STAT_WAITINFO to get wait sem, mq, signal information from procfs.
Update to print wait information in ps command.
Update README for ps command output format.

[Example]
```
TASH>>ps

  PID | PRIO | FLAG |  TYPE   | NP |  STATUS  | WAIT INFO  | CPU | IRQCOUNT | NAME
------|------|------|---------|----|----------|------------|-----|----------|-----
mm_get_app_heap_name: address 0x60126400 is not in any app heap region.
    0 |    0 | FIFO | KTHREAD | N  | RUNNING  |          - |   0 |        0 | CPU0 IDLE
mm_get_app_heap_name: address 0x60126000 is not in any app heap region.
    1 |    0 | FIFO | KTHREAD | N  | RUNNING  |          - |   1 |        0 | CPU1 IDLE
mm_get_app_heap_name: address 0x60130c40 is not in any app heap region.
    2 |  201 | RR   | KTHREAD |    | WAITSIG  |   00020000 |   1 |        2 | hpwork
mm_get_app_heap_name: address 0x60132380 is not in any app heap region.
    3 |   50 | RR   | KTHREAD |    | WAITSIG  |   00020000 |   1 |        2 | lpwork
mm_get_app_heap_name: address 0x60136200 is not in any app heap region.
    5 |  200 | RR   | KTHREAD |    | MQNEMPTY | 0x60136aa0 |   1 |        1 | km4_log_task
mm_get_app_heap_name: address 0x601b7b80 is not in any app heap region.
    6 |  204 | RR   | KTHREAD |    | WAITSEM  | 0x60191418 |   1 |        1 | LCD Frame flusing
mm_get_app_heap_name: address 0x601bb310 is not in any app heap region.
    7 |  107 | RR   | KTHREAD |    | WAITSEM  | 0x601ba3a0 |   1 |        1 | inic_msg_q_task
mm_get_app_heap_name: address 0x601bd2d0 is not in any app heap region.
    8 |  104 | RR   | KTHREAD |    | WAITSEM  | 0x601bc320 |   1 |        1 | inic_host_rx_tasklet
mm_get_app_heap_name: address 0x601bf2b0 is not in any app heap region.
    9 |  103 | RR   | KTHREAD |    | WAITSEM  | 0x601be2e0 |   1 |        1 | inic_ipc_api_host_task
mm_get_app_heap_name: address 0x601c24d0 is not in any app heap region.
   11 |  100 | RR   | KTHREAD |    | WAITSIG  |   00000000 |   1 |        2 | NDP_health_check
mm_get_app_heap_name: address 0x601d4da0 is not in any app heap region.
   12 |  105 | RR   | KTHREAD |    | WAITSEM  | 0x6011880c |   0 |        2 | LWIP_TCP/IP
mm_get_app_heap_name: address 0x601d6ce0 is not in any app heap region.
   13 |  100 | RR   | KTHREAD |    | WAITSEM  | 0x60117c74 |   0 |        1 | netmgr_event_handler
mm_get_app_heap_name: address 0x601d84c0 is not in any app heap region.
   14 |  200 | RR   | KTHREAD |    | MQNEMPTY | 0x601db910 |   1 |        1 | log_dump
mm_get_app_heap_name: address 0x601decd0 is not in any app heap region.
   15 |  203 | RR   | KTHREAD |    | MQNEMPTY | 0x601333d0 |   0 |        1 | binary_manager
   18 |  180 | RR   | TASK    |    | WAITSIG  |   00000000 |   0 |        2 | app1
   19 |  100 | RR   | TASK    |    | WAITSIG  |   00020000 |   0 |        1 | uwork
   20 |  125 | RR   | TASK    |    | WAITSEM  |          0 |   0 |        1 | tash
   21 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f82580 |   0 |        1 | PlayerWorker
   22 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f82694 |   0 |        1 | RecorderWorker
   23 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f8260c |   0 |        1 | PlayerObserverWorker
   24 |  100 | RR   | PTHREAD |    | WAITSEM  | 0x63f82714 |   0 |        1 | RecorderObserverWorker
   25 |  199 | RR   | PTHREAD |    | WAITSEM  | 0x63f82508 |   0 |        1 | FocusManagerWorker
   26 |  100 | RR   | TASK    |    | WAITSEM  | 0x63a9008c |   0 |        1 | wifi msg handler
   27 |  100 | RR   | TASK    |    | WAITSEM  | 0x63a917ac |   0 |        1 | ble msg handler
```

Signed-off-by: seokhun-eom <seokhun.eom@samsung.com>
- FLAG : The policy of scheduling for each task/thread.
- TYPE : The type of task/thread. It can be KTHREAD(kernel thread), PTHREAD(user pthread) and TASK.
- NP : The flag of cancelable.
- STATUS : Current state of the task/thread. It can be PENDING, READYTORUN, RUNNING, etc.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amandeep-samsung Regardless of this PR, could you add status description?
for example (need to rewrite it with proper English)
RUNNING : blah blah
MQNEMPTY : waiting status of message queue receiving
MQNFULL : waiting status to wait message queue available memory for sending
WAITSIG : blah blah

@sunghan-chang sunghan-chang merged commit 1916b43 into Samsung:master Mar 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants