From 1777409472ef63a0c70a747a846b92019ee7c300 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Wed, 4 May 2016 20:47:35 +0200 Subject: [PATCH] ps: add heap statistics for TLSF (if enabled) --- sys/ps/ps.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/ps/ps.c b/sys/ps/ps.c index d20ee4f274..86cebb1095 100644 --- a/sys/ps/ps.c +++ b/sys/ps/ps.c @@ -26,6 +26,10 @@ #include "xtimer.h" #endif +#ifdef MODULE_TLSF +#include "tlsf.h" +#endif + /* list of states copied from tcb.h */ const char *state_names[] = { [STATUS_RUNNING] = "running", @@ -112,5 +116,9 @@ void ps(void) #ifdef DEVELHELP printf("\t%5s %-21s|%13s%6s %5i (%5i)\n", "|", "SUM", "|", "|", overall_stacksz, overall_used); +# ifdef MODULE_TLSF + puts("\nHeap usage:"); + tlsf_walk_pool(NULL); +# endif #endif }