Skip to content

Commit

Permalink
posix: tracing for custom thread abort func
Browse files Browse the repository at this point in the history
POSIX has a custom implementation for thread abort
(z_impl_k_thread_abort)	which lacks the	tracing	function
calls as in the	generic	version. So add	them.

Signed-off-by: Daniel Leung <[email protected]>
  • Loading branch information
dcpleung authored and dleach02 committed Mar 19, 2024
1 parent a951f96 commit dadbe10
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/posix/core/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
#include "posix_core.h"
#include <zephyr/arch/posix/posix_soc_if.h>

#ifdef CONFIG_TRACING
#include <zephyr/tracing/tracing_macros.h>
#include <zephyr/tracing/tracing.h>
#endif

/* Note that in this arch we cheat quite a bit: we use as stack a normal
* pthreads stack and therefore we ignore the stack size
*/
Expand Down Expand Up @@ -62,6 +67,8 @@ void z_impl_k_thread_abort(k_tid_t thread)
unsigned int key;
int thread_idx;

SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_thread, abort, thread);

posix_thread_status_t *tstatus =
(posix_thread_status_t *)
thread->callee_saved.thread_status;
Expand Down Expand Up @@ -103,5 +110,7 @@ void z_impl_k_thread_abort(k_tid_t thread)

/* The abort handler might have altered the ready queue. */
z_reschedule_irqlock(key);

SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_thread, abort, thread);
}
#endif

0 comments on commit dadbe10

Please sign in to comment.