Skip to content

Commit

Permalink
igsc: enable traffic dump in trace mode only
Browse files Browse the repository at this point in the history
Print traffic dump only if log mode is trace.

Signed-off-by: Alexander Usyskin <[email protected]>
  • Loading branch information
ausyskin committed Nov 10, 2024
1 parent ac0acdf commit 9b1d341
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/igsc_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int status_tee2fu(TEESTATUS status)
}
}

static void gsc_trace_hex_dump(const char *title, const void *buf, size_t len)
static void __gsc_trace_hex_dump(const char *title, const void *buf, size_t len)
{
#define pbufsz (16 * 3)
char pbuf[pbufsz];
Expand All @@ -107,6 +107,12 @@ static void gsc_trace_hex_dump(const char *title, const void *buf, size_t len)
}
}

static inline void gsc_trace_hex_dump(const char* title, const void* buf, size_t len)
{
if (igsc_get_log_level() >= IGSC_LOG_LEVEL_TRACE)
__gsc_trace_hex_dump(title, buf, len);
}

mockable_static
void driver_working_buffer_free(struct igsc_lib_ctx *lib_ctx)
{
Expand Down

0 comments on commit 9b1d341

Please sign in to comment.