tracing: ctf: add tracing for message queues
Add hooks for message queues. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
committed by
Johan Hedberg
parent
9e99699167
commit
26fa18ef2d
@@ -268,6 +268,134 @@ void sys_trace_k_mem_slab_free_exit(struct k_mem_slab *slab)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* Message Queues */
|
||||
void sys_trace_k_msgq_init(struct k_msgq *msgq)
|
||||
{
|
||||
ctf_top_msgq_init(
|
||||
(uint32_t)(uintptr_t)msgq
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_alloc_init_enter(struct k_msgq *msgq)
|
||||
{
|
||||
ctf_top_msgq_alloc_init_enter(
|
||||
(uint32_t)(uintptr_t)msgq
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_alloc_init_exit(struct k_msgq *msgq, int ret)
|
||||
{
|
||||
ctf_top_msgq_alloc_init_exit(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
(int32_t)ret
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_put_enter(struct k_msgq *msgq, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_msgq_put_enter(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks)
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_get_enter(struct k_msgq *msgq, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_msgq_get_enter(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks)
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_get_blocking(struct k_msgq *msgq, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_msgq_get_blocking(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks)
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_get_exit(struct k_msgq *msgq, k_timeout_t timeout, int ret)
|
||||
{
|
||||
ctf_top_msgq_get_exit(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks),
|
||||
(int32_t)ret
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_put_blocking(struct k_msgq *msgq, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_msgq_put_blocking(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks)
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_put_exit(struct k_msgq *msgq, k_timeout_t timeout, int ret)
|
||||
{
|
||||
ctf_top_msgq_put_exit(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks),
|
||||
(int32_t)ret
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_peek(struct k_msgq *msgq, int ret)
|
||||
{
|
||||
ctf_top_msgq_peek(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
(int32_t)ret
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_purge(struct k_msgq *msgq)
|
||||
{
|
||||
ctf_top_msgq_purge(
|
||||
(uint32_t)(uintptr_t)msgq
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_put_front_enter(struct k_msgq *msgq, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_msgq_put_front_enter(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks)
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_put_front_blocking(struct k_msgq *msgq, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_msgq_put_front_blocking(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks)
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_put_front_exit(struct k_msgq *msgq, k_timeout_t timeout, int ret)
|
||||
{
|
||||
ctf_top_msgq_put_front_exit(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
k_ticks_to_us_floor32((uint32_t)timeout.ticks),
|
||||
(int32_t)ret
|
||||
);
|
||||
}
|
||||
|
||||
void sys_trace_k_msgq_cleanup_enter(struct k_msgq *msgq)
|
||||
{
|
||||
ctf_top_msgq_cleanup_enter(
|
||||
(uint32_t)(uintptr_t)msgq
|
||||
);
|
||||
}
|
||||
void sys_trace_k_msgq_cleanup_exit(struct k_msgq *msgq, int ret)
|
||||
{
|
||||
ctf_top_msgq_cleanup_exit(
|
||||
(uint32_t)(uintptr_t)msgq,
|
||||
(int32_t)ret
|
||||
);
|
||||
}
|
||||
|
||||
/* Semaphore */
|
||||
void sys_trace_k_sem_init(struct k_sem *sem, int ret)
|
||||
{
|
||||
@@ -277,6 +405,7 @@ void sys_trace_k_sem_init(struct k_sem *sem, int ret)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void sys_trace_k_sem_take_enter(struct k_sem *sem, k_timeout_t timeout)
|
||||
{
|
||||
ctf_top_semaphore_take_enter(
|
||||
|
||||
@@ -197,6 +197,24 @@ typedef enum {
|
||||
CTF_EVENT_MEM_SLAB_ALLOC_EXIT = 0x84,
|
||||
CTF_EVENT_MEM_SLAB_FREE_ENTER = 0x85,
|
||||
CTF_EVENT_MEM_SLAB_FREE_EXIT = 0x86,
|
||||
|
||||
/* Message Queues */
|
||||
CTF_EVENT_MSGQ_INIT = 0x87,
|
||||
CTF_EVENT_MSGQ_ALLOC_INIT_ENTER = 0x88,
|
||||
CTF_EVENT_MSGQ_ALLOC_INIT_EXIT = 0x89,
|
||||
CTF_EVENT_MSGQ_PUT_ENTER = 0x8A,
|
||||
CTF_EVENT_MSGQ_PUT_BLOCKING = 0x8B,
|
||||
CTF_EVENT_MSGQ_PUT_EXIT = 0x8C,
|
||||
CTF_EVENT_MSGQ_GET_ENTER = 0x8D,
|
||||
CTF_EVENT_MSGQ_GET_BLOCKING = 0x8E,
|
||||
CTF_EVENT_MSGQ_GET_EXIT = 0x8F,
|
||||
CTF_EVENT_MSGQ_PEEK = 0x90,
|
||||
CTF_EVENT_MSGQ_PURGE = 0x91,
|
||||
CTF_EVENT_MSGQ_PUT_FRONT_ENTER = 0x92,
|
||||
CTF_EVENT_MSGQ_PUT_FRONT_EXIT = 0x93,
|
||||
CTF_EVENT_MSGQ_PUT_FRONT_BLOCKING = 0x94,
|
||||
CTF_EVENT_MSGQ_CLEANUP_ENTER = 0x95,
|
||||
CTF_EVENT_MSGQ_CLEANUP_EXIT = 0x96,
|
||||
} ctf_event_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -364,6 +382,87 @@ static inline void ctf_top_mem_slab_free_exit(uint32_t slab_id)
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MEM_SLAB_FREE_EXIT), slab_id);
|
||||
}
|
||||
|
||||
/* Message Queues*/
|
||||
static inline void ctf_top_msgq_init(uint32_t msgq_id)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_INIT), msgq_id);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_alloc_init_enter(uint32_t msgq_id)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_ALLOC_INIT_ENTER), msgq_id);
|
||||
}
|
||||
static inline void ctf_top_msgq_alloc_init_exit(uint32_t msgq_id, int32_t ret)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_ALLOC_INIT_EXIT), msgq_id, ret);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_put_enter(uint32_t msgq_id, uint32_t timeout)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PUT_ENTER), msgq_id, timeout);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_put_blocking(uint32_t msgq_id, uint32_t timeout)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PUT_BLOCKING), msgq_id, timeout);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_put_exit(uint32_t msgq_id, uint32_t timeout, int32_t ret)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PUT_EXIT), msgq_id, timeout, ret);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_get_enter(uint32_t msgq_id, uint32_t timeout)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_GET_ENTER), msgq_id, timeout);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_get_blocking(uint32_t msgq_id, uint32_t timeout)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_GET_BLOCKING), msgq_id, timeout);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_get_exit(uint32_t msgq_id, uint32_t timeout, int32_t ret)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_GET_EXIT), msgq_id, timeout, ret);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_peek(uint32_t msgq_id, int32_t ret)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PEEK), msgq_id, ret);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_purge(uint32_t msgq_id)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PURGE), msgq_id);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_put_front_enter(uint32_t msgq_id, uint32_t timeout)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PUT_FRONT_ENTER), msgq_id, timeout);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_put_front_exit(uint32_t msgq_id, uint32_t timeout, int32_t ret)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PUT_FRONT_EXIT), msgq_id, timeout, ret);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_put_front_blocking(uint32_t msgq_id, uint32_t timeout)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_PUT_FRONT_BLOCKING), msgq_id, timeout);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_cleanup_enter(uint32_t msgq_id)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_CLEANUP_ENTER), msgq_id);
|
||||
}
|
||||
|
||||
static inline void ctf_top_msgq_cleanup_exit(uint32_t msgq_id, int32_t ret)
|
||||
{
|
||||
CTF_EVENT(CTF_LITERAL(uint8_t, CTF_EVENT_MSGQ_CLEANUP_EXIT), msgq_id, ret);
|
||||
}
|
||||
|
||||
|
||||
/* Semaphore */
|
||||
static inline void ctf_top_semaphore_init(uint32_t sem_id,
|
||||
int32_t ret)
|
||||
|
||||
@@ -259,22 +259,38 @@ extern "C" {
|
||||
#define sys_port_trace_k_stack_pop_blocking(stack, timeout)
|
||||
#define sys_port_trace_k_stack_pop_exit(stack, timeout, ret)
|
||||
|
||||
#define sys_port_trace_k_msgq_init(msgq)
|
||||
#define sys_port_trace_k_msgq_alloc_init_enter(msgq)
|
||||
#define sys_port_trace_k_msgq_alloc_init_exit(msgq, ret)
|
||||
#define sys_port_trace_k_msgq_cleanup_enter(msgq)
|
||||
#define sys_port_trace_k_msgq_cleanup_exit(msgq, ret)
|
||||
#define sys_port_trace_k_msgq_put_enter(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_blocking(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_exit(msgq, timeout, ret)
|
||||
#define sys_port_trace_k_msgq_put_front_enter(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_front_blocking(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_front_exit(msgq, timeout, ret)
|
||||
#define sys_port_trace_k_msgq_get_enter(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_get_blocking(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_get_exit(msgq, timeout, ret)
|
||||
#define sys_port_trace_k_msgq_peek(msgq, ret)
|
||||
#define sys_port_trace_k_msgq_purge(msgq)
|
||||
#define sys_port_trace_k_msgq_init(msgq) \
|
||||
sys_trace_k_msgq_init(msgq)
|
||||
#define sys_port_trace_k_msgq_alloc_init_enter(msgq) \
|
||||
sys_trace_k_msgq_alloc_init_enter(msgq)
|
||||
#define sys_port_trace_k_msgq_alloc_init_exit(msgq, ret) \
|
||||
sys_trace_k_msgq_alloc_init_exit(msgq, ret)
|
||||
#define sys_port_trace_k_msgq_cleanup_enter(msgq) \
|
||||
sys_trace_k_msgq_cleanup_enter(msgq)
|
||||
#define sys_port_trace_k_msgq_cleanup_exit(msgq, ret) \
|
||||
sys_trace_k_msgq_cleanup_exit(msgq, ret)
|
||||
#define sys_port_trace_k_msgq_put_enter(msgq, timeout) \
|
||||
sys_trace_k_msgq_put_enter(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_blocking(msgq, timeout) \
|
||||
sys_trace_k_msgq_put_blocking(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_exit(msgq, timeout, ret) \
|
||||
sys_trace_k_msgq_put_exit(msgq, timeout, ret)
|
||||
#define sys_port_trace_k_msgq_put_front_enter(msgq, timeout) \
|
||||
sys_trace_k_msgq_put_front_enter(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_front_blocking(msgq, timeout) \
|
||||
sys_trace_k_msgq_put_front_blocking(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_put_front_exit(msgq, timeout, ret) \
|
||||
sys_trace_k_msgq_put_front_exit(msgq, timeout, ret)
|
||||
#define sys_port_trace_k_msgq_get_enter(msgq, timeout) \
|
||||
sys_trace_k_msgq_get_enter(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_get_blocking(msgq, timeout) \
|
||||
sys_trace_k_msgq_get_blocking(msgq, timeout)
|
||||
#define sys_port_trace_k_msgq_get_exit(msgq, timeout, ret) \
|
||||
sys_trace_k_msgq_get_exit(msgq, timeout, ret)
|
||||
#define sys_port_trace_k_msgq_peek(msgq, ret) \
|
||||
sys_trace_k_msgq_peek(msgq, ret)
|
||||
#define sys_port_trace_k_msgq_purge(msgq) \
|
||||
sys_trace_k_msgq_purge(msgq)
|
||||
|
||||
#define sys_port_trace_k_mbox_init(mbox)
|
||||
#define sys_port_trace_k_mbox_message_put_enter(mbox, timeout)
|
||||
@@ -429,6 +445,25 @@ void sys_trace_k_mem_slab_alloc_exit(struct k_mem_slab *slab, k_timeout_t timeou
|
||||
void sys_trace_k_mem_slab_free_enter(struct k_mem_slab *slab);
|
||||
void sys_trace_k_mem_slab_free_exit(struct k_mem_slab *slab);
|
||||
|
||||
|
||||
/* Message Queues */
|
||||
void sys_trace_k_msgq_init(struct k_msgq *msgq);
|
||||
void sys_trace_k_msgq_alloc_init_enter(struct k_msgq *msgq);
|
||||
void sys_trace_k_msgq_alloc_init_exit(struct k_msgq *msgq, int ret);
|
||||
void sys_trace_k_msgq_cleanup_enter(struct k_msgq *msgq);
|
||||
void sys_trace_k_msgq_cleanup_exit(struct k_msgq *msgq, int ret);
|
||||
void sys_trace_k_msgq_put_enter(struct k_msgq *msgq, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_blocking(struct k_msgq *msgq, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_exit(struct k_msgq *msgq, k_timeout_t timeout, int ret);
|
||||
void sys_trace_k_msgq_put_front_enter(struct k_msgq *msgq, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_front_blocking(struct k_msgq *msgq, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_front_exit(struct k_msgq *msgq, k_timeout_t timeout, int ret);
|
||||
void sys_trace_k_msgq_get_enter(struct k_msgq *msgq, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_get_blocking(struct k_msgq *msgq, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_get_exit(struct k_msgq *msgq, k_timeout_t timeout, int ret);
|
||||
void sys_trace_k_msgq_peek(struct k_msgq *msgq, int ret);
|
||||
void sys_trace_k_msgq_purge(struct k_msgq *msgq);
|
||||
|
||||
/* Semaphore */
|
||||
|
||||
void sys_trace_k_sem_init(struct k_sem *sem, int ret);
|
||||
|
||||
@@ -1121,4 +1121,149 @@ event {
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* Message Queues */
|
||||
|
||||
event {
|
||||
name = msgq_init;
|
||||
id = 0x87;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_alloc_init_enter;
|
||||
id = 0x88;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_alloc_init_exit;
|
||||
id = 0x89;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
int32_t ret;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_put_enter;
|
||||
id = 0x8A;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_put_blocking;
|
||||
id = 0x8B;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_put_exit;
|
||||
id = 0x8C;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
int32_t ret;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_get_enter;
|
||||
id = 0x8D;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_get_blocking;
|
||||
id = 0x8E;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_get_exit;
|
||||
id = 0x8F;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
int32_t ret;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_peek;
|
||||
id = 0x90;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
int32_t ret;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_purge;
|
||||
id = 0x91;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_put_front_enter;
|
||||
id = 0x92;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_put_front_blocking;
|
||||
id = 0x94;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_put_front_exit;
|
||||
id = 0x93;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
uint32_t timeout;
|
||||
int32_t ret;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_cleanup_enter;
|
||||
id = 0x95;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
};
|
||||
};
|
||||
|
||||
event {
|
||||
name = msgq_cleanup_exit;
|
||||
id = 0x96;
|
||||
fields := struct {
|
||||
uint32_t id;
|
||||
int32_t ret;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user