[riot-notifications] [RIOT-OS/RIOT] sys/ps: show free stack space in addition to used and total (#11828)

Thomas Stilwell notifications at github.com
Fri Jul 12 07:24:03 CEST 2019


### Contribution description

This adds a new column to `ps` output showing unused stack space.

I find that this makes it easier to notice problems at a glance, as small numbers tend to stand out from everything else. Especially a zero.


### Testing procedure
Before:
```shell
> ps
        pid | name                 | state    Q | pri | stack  ( used) | base addr  | current     
          - | isr_stack            | -        - |   - |   1024 (  464) | 0x1fffc000 | 0x1fffc3b8
          1 | idle                 | pending  Q |  15 |    768 (  156) | 0x1fffcbe8 | 0x1fffce4c 
          2 | main                 | running  Q |   7 |   2560 (  888) | 0x1fffcee8 | 0x1fffd6cc 
          3 | pktdump              | bl rx    _ |   6 |   2560 (  248) | 0x20008aec | 0x200093f4 
          4 | 6lo                  | bl rx    _ |   3 |   1024 (  444) | 0x200094f0 | 0x200097cc 
          5 | ipv6                 | bl rx    _ |   4 |   1024 (  432) | 0x20006658 | 0x2000693c 
          6 | udp                  | bl rx    _ |   5 |   1024 (  280) | 0x20009ccc | 0x20009fb4 
          7 | kw41zrf-lwmac        | bl rx    _ |   2 |   1024 ( 1024) | 0x20005cd4 | 0x200060d4 
            | SUM                  |            |     |  12032 ( 3732)

```
After:
```shell
> ps
        pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
          - | isr_stack            | -        - |   - |   1024 (  464) (  560) | 0x1fffc000 | 0x1fffc3b8
          1 | idle                 | pending  Q |  15 |    768 (  156) (  612) | 0x1fffcbe8 | 0x1fffce4c 
          2 | main                 | running  Q |   7 |   2560 (  896) ( 1664) | 0x1fffcee8 | 0x1fffd6cc 
          3 | pktdump              | bl rx    _ |   6 |   2560 (  248) ( 2312) | 0x20008aec | 0x200093f4 
          4 | 6lo                  | bl rx    _ |   3 |   1024 (  444) (  580) | 0x200094f0 | 0x200097cc 
          5 | ipv6                 | bl rx    _ |   4 |   1024 (  432) (  592) | 0x20006658 | 0x2000693c 
          6 | udp                  | bl rx    _ |   5 |   1024 (  280) (  744) | 0x20009ccc | 0x20009fb4 
          7 | kw41zrf-lwmac        | bl rx    _ |   2 |   1024 ( 1024) (    0) | 0x20005cd4 | 0x200060d4 
            | SUM                  |            |     |  12032 ( 3684) ( 8348)
```

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11828

-- Commit Summary --

  * sys/ps: show free stack space in addition to used and total

-- File Changes --

    M sys/ps/ps.c (18)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11828.patch
https://github.com/RIOT-OS/RIOT/pull/11828.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11828
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190711/689d7d57/attachment-0001.html>


More information about the notifications mailing list