Skip to content

Commit

Permalink
trace: Add weak platform tracer function
Browse files Browse the repository at this point in the history
Add weak platform tracer function
This would allow each platform to carry out
plat specific logging, possibly to some media
for post-mortem analysis

Signed-off-by: Sheetal Tigadoli <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
  • Loading branch information
shitalt authored and jforissier committed Nov 19, 2019
1 parent ba4056f commit ea4ae5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/arch/arm/kernel/trace_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const char trace_ext_prefix[] = "TC";
int trace_level __nex_data = TRACE_LEVEL;
static unsigned int puts_lock __nex_bss = SPINLOCK_UNLOCK;

void __weak plat_trace_ext_puts(const char *str __unused)
{
}

void trace_ext_puts(const char *str)
{
uint32_t itr_status = thread_mask_exceptions(THREAD_EXCP_ALL);
Expand All @@ -25,6 +29,8 @@ void trace_ext_puts(const char *str)
cpu_spin_lock_no_dldetect(&puts_lock);
}

plat_trace_ext_puts(str);

console_flush();

if (was_contended)
Expand Down
1 change: 1 addition & 0 deletions lib/libutils/ext/include/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void trace_ext_puts(const char *str);
int trace_ext_get_thread_id(void);
void trace_set_level(int level);
int trace_get_level(void);
void plat_trace_ext_puts(const char *str);

/* Internal functions used by the macros below */
void trace_vprintf(const char *func, int line, int level, bool level_ok,
Expand Down

0 comments on commit ea4ae5c

Please sign in to comment.