diff options
author | px4dev <px4@purgatory.org> | 2012-12-01 14:55:48 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-12-01 14:55:48 -0800 |
commit | 404332aefe5e2ad3d0766f99bd8d8efebdd4d331 (patch) | |
tree | 07577bfc7e49669ea0a7c755d999ecb1d2957b0d /Debug/NuttX | |
parent | 008a354391fddbe2154a04a145a5f20d86104612 (diff) | |
download | px4-firmware-404332aefe5e2ad3d0766f99bd8d8efebdd4d331.tar.gz px4-firmware-404332aefe5e2ad3d0766f99bd8d8efebdd4d331.tar.bz2 px4-firmware-404332aefe5e2ad3d0766f99bd8d8efebdd4d331.zip |
Break out the task stack usage sniffer so we can use it on systems where the task layout has been shrunk (e.g. PX4IO)
Diffstat (limited to 'Debug/NuttX')
-rw-r--r-- | Debug/NuttX | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Debug/NuttX b/Debug/NuttX index 825733554..8e6544842 100644 --- a/Debug/NuttX +++ b/Debug/NuttX @@ -168,17 +168,29 @@ define _showsemaphore printf "\n" end -define showtask +# +# Print information about a task's stack usage +# +define showtaskstack set $task = (struct _TCB *)$arg0 - printf "%p %.2d ", $task, $task->pid - _showtaskstate $task - printf " %s\n", $task->name set $stack_free = 0 while ($stack_free < $task->adj_stack_size) && *(uint8_t *)($task->stack_alloc_ptr + $stack_free) set $stack_free = $stack_free + 1 end printf" stack 0x%08x-0x%08x (%d) %d free\n", $task->stack_alloc_ptr, $task->adj_stack_ptr, $task->adj_stack_size, $stack_free +end + +# +# Print details of a task +# +define showtask + set $task = (struct _TCB *)$arg0 + + printf "%p %.2d ", $task, $task->pid + _showtaskstate $task + printf " %s\n", $task->name + showtaskstack $task if $task->task_state == TSTATE_WAIT_SEM printf " waiting on %p ", $task->waitsem |