1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

73 Commits

Author SHA1 Message Date
4b95459483
schedstatistics: Convert to ztimer 2021-12-07 16:31:15 +01:00
f0d8f1295f sys/ps: use getters for thread_t fields 2021-09-15 10:16:45 +02:00
Jan Mohr
435796ccaa sys/ps/ps.c: enabled runtime in usec for schedstatistics 2021-05-28 15:00:46 +02:00
c579dbe953
schedstatistics: Log sleep tick statistics 2021-01-18 11:14:23 +01:00
7e94050bbe sys/ps: make use of thread_is_active() 2020-11-25 20:49:00 +01:00
848a5a4e7a sys/ps: make use of thread_get_status() 2020-11-25 14:39:47 +01:00
5321bcde89 core: thread: move thread_state_to_string() from ps.c 2020-11-25 14:35:00 +01:00
benpicco
b3b07e4e33
Merge pull request #15481 from kaspar030/refactor_thread_defines
core: move scheduler defines
2020-11-23 17:56:09 +01:00
0b801c4de0 all: adapt to moved sched defines 2020-11-23 16:56:34 +01:00
Leandro Lanzieri
9a5ed7c085
sys/ps: add module to Kconfig 2020-11-18 18:38:45 +01:00
Jim O'Brien
bd149e7db9 thread: Add THREAD_NAMES make flag
Separate thread names from DEVELHELP so thread names can be
enabled in non-development/debug builds when required/desired.
THREAD_NAMES will be enabled by default then DEVELHELP is set to 1.
2020-09-10 10:08:27 +02:00
Marian Buschsieweke
3b6fa61829
sys: Cleanup access to internal variables
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:

1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
   functions
2020-08-24 20:28:11 +02:00
Francisco Molina
1a66ce3d23
sys/ps/ps: use same order as tcb for lookup table 2020-07-29 17:13:11 +02:00
Juan Carrano
d167cb3af8
sys/ps: Improve robustness against string table errors.
The mapping from thread state codes to a human readable string in the
PS modules has to be maintained manually. There is a very real possibility
for it to get out of sync with the actual defined states, which would cause
a crash when a lookup with an out of bounds index is performed. Also, because
of the way the array is defined, there could be gaps (which will be filled by
nulls).

This patch replaces the array looukup by a function that checks bounds and
also triggers an assertion so that the issue can be caught during development.
2020-07-29 17:12:40 +02:00
Marian Buschsieweke
d13ea90fa1
Merge pull request #11828 from benemorius/pr/ps-free-mem
sys/ps: show free stack space in addition to used and total
2020-06-26 09:01:29 +02:00
Thomas Stilwell
1af6a30279 sys/ps: show free stack space in addition to used and total 2020-06-25 17:48:25 -05:00
b2278b64a8 sys/ps: ignore IST_STACKSIZE if it is == 0 (undefined) 2020-03-12 13:08:05 +01:00
JulianHolzwarth
c581d2c055 sys/ps/ps.c: ps can now handle zombie state threads 2019-12-11 16:48:31 +01:00
Francisco Molina
1caf6610cb sys: add schedstatistics module 2019-09-13 11:37:44 +02:00
Martine Lenders
db20a057ae core: rename thread_state_t to thread_status_t
This way it can't come to name collisions on `native` with Mac OSX'
threading library [1].

[1]: https://opensource.apple.com/source/xnu/xnu-792/osfmk/mach/thread_status.h.auto.html
2019-05-11 12:25:07 +02:00
Marian Buschsieweke
4c3e92f183
core: Made thread state an enum
- Introduced enum type `thread_state_t` to replace preprocessor macros
- Moved thread states to `sched.h` for two reasons:
  a) Because of the interdependencies of `sched.h` and `thread.h` keeping it in
     `thread.h` would result in ugly code.
  b) Theses thread states are defined from the schedulers point of view, so it
     actually makes senses to have it defined there
2019-02-13 13:31:52 +01:00
Marian Buschsieweke
c700d0439e
sys/ps: Fixed stringification
Added missing string for STATUS_COND_BLOCKED, so that the shell command "ps"
no longer crashes when a thread has this state.
2019-02-07 21:35:48 +01:00
Joakim Nohlgård
1f58c63ea4 sys/ps: Remove unused include xtimer.h 2018-10-26 09:03:46 +02:00
Martine Lenders
91c65e40f8
Merge pull request #9327 from cgundogan/pr/tlsf_total_sizes
tlsf: add custom walker to get total free / used sizes
2018-06-12 10:07:07 +02:00
Cenk Gündoğan
0009213072 tlsf: add custom walker to get total free / used sizes 2018-06-12 09:43:48 +02:00
7d013eb2b6 sys: fix doxygen grouping 2018-06-11 19:12:02 +02:00
Juan Carrano
841c7195ba sys/ps: Use correct define for TLSF information.
The macro MODULE_TLSF_MALLOC indicates if tlsf is being used as the system-wide
allocator. MODULE_TLSF only incates if TLSF is present.
PS should check for MODULE_TLSF_MALLOC to decide if heap information should be
displayed.
2018-05-30 14:13:25 +02:00
Juan Carrano
cf686bde2d pkg/tlsf: Refactor the TLSF package and bring back original TLSF api.
- Cleanup package makefile.
- Download directly from git.
- Remove giant patch.
- Implement malloc function as a contrib package.
- Update ccn example.
- Update ps command.
2018-05-18 15:41:07 +02:00
2a177ea6c8 sys/ps: adapt to COREIF_NG removal 2017-11-16 14:40:16 +01:00
smlng
3ac6d6c80d schedstats: refine ps output
- use unsigned int instead of double
2017-06-09 10:50:07 +02:00
Sebastian Meiling
dd4f8f7704 Merge pull request #6975 from OTAkeys/pr/ps_schedstatistics_fix
ps: fix schedstatistics
2017-05-17 13:50:42 +02:00
Vincent Dupont
6d5b95517d ps: fix schedstatistics
Fix xtimer_now() usage and fix columns alignment in ps command when
module schedstatistics is used.
2017-05-16 10:33:42 +02:00
Hauke Petersen
383d49412e sys/ps: only show isr stack stats if applicable 2017-05-12 18:07:07 +02:00
Martine Lenders
04823b9192 ps: add state name for STATUS_MBOX_BLOCKED 2017-02-14 16:02:27 +01:00
Joakim Nohlgård
b02e0eca47 ps: Add current stack pointer and start of stack to isr_stack ps output (DEVELHELP) 2016-07-12 10:17:49 +02:00
Joakim Nohlgård
44d130f535 sys/ps: Add current stack pointer to ps output (DEVELHELP) 2016-07-12 10:17:48 +02:00
MohmadAyman
8da1eb9f7a ps: provide ISR stackusage information 2016-06-02 09:48:37 +02:00
chrysn
e348a8df80 PS: Display waiting for flags
This adds support for the recently introduced thread flags mechanism to
the `ps` module; while previously it would show a thread in state
"(null)" when it is blocked on thread_flags_wait_any or
thread_flags_wait_all, it now shoes the state "bl anyfl" or "bl allfl",
respectively. The labels are kept that short to not mess with the
fixed-width layout.
2016-05-31 18:27:14 +02:00
Oleg Hahm
1777409472 ps: add heap statistics for TLSF (if enabled) 2016-05-27 13:48:06 +02:00
Yonezawa-T2
60c1322505 ps: fix compile error on clang 7.3.0 2016-03-23 12:25:14 +09:00
2b010b5337 core: rename tcb_t -> thread_t, move into thread.h 2016-03-05 18:20:17 +01:00
844f8a491c sys: ps: adapt to xtimer 2015-09-16 10:58:51 +02:00
Joakim Gebart
13832d8e62 everything: Remove filename from @file Doxygen command 2015-05-22 07:34:41 +02:00
Oleg Hahm
89b32aefe3 ps: thread_print_all() had the wrong module prefix 2015-04-19 16:36:05 +02:00
Oleg Hahm
7b95b613b2 sys: fix thread_print_all 2014-10-30 20:16:48 +01:00
Oleg Hahm
9a61d8cf1c core: move optional tcb members to DEVELHELP 2014-10-30 16:37:10 +01:00
René Kijewski
b31e5a8675 core: introduce KERNEL_PID_FIRST and KERNEL_PID_LAST 2014-08-17 19:50:34 +02:00
René Kijewski
9e3830a72b core: only store the stack size for DEVELHELP
`tcp_t::stack_size` is only examined by the shell command `ps` and
`DEBUG_PRINT`. For the latter one only if `DEVELHELP` was enabled.

This PR guards the member `tcp_t::stack_size` in `#ifdef DEVELHELP`.
Only if DEVELHELP was activated its value get printed by `ps`.

Closes #1287.
2014-08-02 00:35:41 +02:00
Oleg Hahm
983d056c75 core: harmonizes the data type for the process ID
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
2014-08-01 12:02:54 +02:00
Ludwig Ortmann
3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 2014-07-31 22:57:20 +02:00