diff options
Diffstat (limited to 'firmware/thread.c')
-rw-r--r-- | firmware/thread.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/thread.c b/firmware/thread.c index aeedbac349..205375a44d 100644 --- a/firmware/thread.c +++ b/firmware/thread.c @@ -24,6 +24,9 @@ #include "kernel.h" #include "cpu.h" #include "string.h" +#ifdef RB_PROFILE +#include <profile.h> +#endif #define DEADBEEF ((unsigned int)0xdeadbeef) /* Cast to the the machine int type, whose size could be < 4. */ @@ -67,13 +70,6 @@ void switch_thread(bool save_context, struct thread_entry **blocked_list) static inline void store_context(void* addr) __attribute__ ((always_inline)); static inline void load_context(const void* addr) __attribute__ ((always_inline)); -#ifdef RB_PROFILE -#include <profile.h> -void profile_thread(void) { - profstart(cores[CURRENT_CORE].current_thread); -} -#endif - #if defined(CPU_ARM) /*--------------------------------------------------------------------------- * Store non-volatile context. @@ -372,6 +368,10 @@ static int get_threadnum(struct thread_entry *thread) return -1; } + +void profile_thread(void) { + profstart(get_threadnum(cores[CURRENT_CORE].running)); +} #endif /* Compiler trick: Don't declare as static to prevent putting |