mirror of https://github.com/thesofproject/sof.git
notifier: Add traces for notifier.
Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
This commit is contained in:
parent
a88543a92c
commit
81936774c8
|
@ -62,6 +62,7 @@ struct system_time {
|
||||||
#define TRACE_CLASS_KEYWORD (33 << 24)
|
#define TRACE_CLASS_KEYWORD (33 << 24)
|
||||||
#define TRACE_CLASS_CHMAP (34 << 24)
|
#define TRACE_CLASS_CHMAP (34 << 24)
|
||||||
#define TRACE_CLASS_ASRC (35 << 24)
|
#define TRACE_CLASS_ASRC (35 << 24)
|
||||||
|
#define TRACE_CLASS_NOTIFIER (36 << 24)
|
||||||
|
|
||||||
#define LOG_ENABLE 1 /* Enable logging */
|
#define LOG_ENABLE 1 /* Enable logging */
|
||||||
#define LOG_DISABLE 0 /* Disable logging */
|
#define LOG_DISABLE 0 /* Disable logging */
|
||||||
|
|
|
@ -15,6 +15,13 @@
|
||||||
#include <sof/spinlock.h>
|
#include <sof/spinlock.h>
|
||||||
#include <ipc/topology.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 {
|
struct notify_data {
|
||||||
void *caller;
|
void *caller;
|
||||||
enum notify_id type;
|
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));
|
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;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
handle->receiver = receiver;
|
handle->receiver = receiver;
|
||||||
handle->caller = caller;
|
handle->caller = caller;
|
||||||
|
|
|
@ -102,6 +102,7 @@ static const char * get_component_name(uint32_t component_id) {
|
||||||
CASE(KEYWORD);
|
CASE(KEYWORD);
|
||||||
CASE(CHMAP);
|
CASE(CHMAP);
|
||||||
CASE(ASRC);
|
CASE(ASRC);
|
||||||
|
CASE(NOTIFIER);
|
||||||
default: return "unknown";
|
default: return "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ char *get_trace_class(uint32_t trace_class)
|
||||||
CASE(KEYWORD);
|
CASE(KEYWORD);
|
||||||
CASE(CHMAP);
|
CASE(CHMAP);
|
||||||
CASE(ASRC);
|
CASE(ASRC);
|
||||||
|
CASE(NOTIFIER);
|
||||||
default: return "unknown";
|
default: return "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue