notifier: Add traces for notifier.

Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
This commit is contained in:
ArturX Kloniecki 2019-10-30 10:43:26 +01:00 committed by Janusz Jankowski
parent a88543a92c
commit 81936774c8
4 changed files with 14 additions and 1 deletions

View File

@ -62,6 +62,7 @@ struct system_time {
#define TRACE_CLASS_KEYWORD (33 << 24)
#define TRACE_CLASS_CHMAP (34 << 24)
#define TRACE_CLASS_ASRC (35 << 24)
#define TRACE_CLASS_NOTIFIER (36 << 24)
#define LOG_ENABLE 1 /* Enable logging */
#define LOG_DISABLE 0 /* Disable logging */

View File

@ -15,6 +15,13 @@
#include <sof/spinlock.h>
#include <ipc/topology.h>
#define trace_notifier(__e, ...) \
trace_event(TRACE_CLASS_NOTIFIER, __e, ##__VA_ARGS__)
#define tracev_notifier(__e, ...) \
tracev_event(TRACE_CLASS_NOTIFIER, __e, ##__VA_ARGS__)
#define trace_notifier_error(__e, ...) \
trace_error(TRACE_CLASS_NOTIFIER, __e, ##__VA_ARGS__)
struct notify_data {
void *caller;
enum notify_id type;
@ -42,8 +49,11 @@ int notifier_register(void *receiver, void *caller, enum notify_id type,
handle = rzalloc(RZONE_SYS_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*handle));
if (!handle)
if (!handle) {
trace_notifier_error("notifier_register() error: callback "
"handle allocation failed.");
return -ENOMEM;
}
handle->receiver = receiver;
handle->caller = caller;

View File

@ -102,6 +102,7 @@ static const char * get_component_name(uint32_t component_id) {
CASE(KEYWORD);
CASE(CHMAP);
CASE(ASRC);
CASE(NOTIFIER);
default: return "unknown";
}
}

View File

@ -56,6 +56,7 @@ char *get_trace_class(uint32_t trace_class)
CASE(KEYWORD);
CASE(CHMAP);
CASE(ASRC);
CASE(NOTIFIER);
default: return "unknown";
}
}