<div dir="ltr">Hi<div><br></div><div>The context switch recorder code -- _Record_Thread_switch in record-userext.c has this code:</div><div><br></div><div>  items[ 0 ].event = RTEMS_RECORD_THREAD_SWITCH_OUT;<br>  items[ 0 ].data = executing->Object.id;<br>  items[ 1 ].event = RTEMS_RECORD_THREAD_STACK_CURRENT;<br>  items[ 1 ].data =<br>#if defined(__GNUC__)<br>    (uintptr_t) __builtin_frame_address( 0 )<br>      - (uintptr_t) executing->Start.Initial_stack.area;<br></div><div><br></div><div>There isn't a comment about what items[1].data is supposed to be but I am assuming it is intended to be stack used. Unfortunately, it doesn't conditionalize on stack growing up or down. On the ARM, the stack grows down This means on the ARM, it is stack memory remaining.</div><div><br></div><div>I think this needs a comment as to the intent and then some conditional logic on CPU_STACK_GROWS_UP like the stack checker has.</div><div><br></div><div>Anyone know what the meaning of the value should be? I suppose remaining is good for quick monitoring if the size is captured on say create.</div><div><br></div><div>Thanks.</div><div><br></div><div>--joel</div></div>