tracing: msgq: adding dedicated tracing for k_msgq_put_front
This commit adds the tracing macros and functions related specifically to the k_msgq_put_front API. Signed-off-by: Alexander Paschoaletto <axelpinheiro@gmail.com>
This commit is contained in:
parent
34efba28b1
commit
8c03410af0
@ -1419,6 +1419,28 @@
|
||||
*/
|
||||
#define sys_port_trace_k_msgq_put_exit(msgq, timeout, ret)
|
||||
|
||||
/**
|
||||
* @brief Trace Message Queue put at front attempt entry
|
||||
* @param msgq Message Queue object
|
||||
* @param timeout Timeout period
|
||||
*/
|
||||
#define sys_port_trace_k_msgq_put_front_enter(msgq, timeout)
|
||||
|
||||
/**
|
||||
* @brief Trace Message Queue put at front attempt blocking
|
||||
* @param msgq Message Queue object
|
||||
* @param timeout Timeout period
|
||||
*/
|
||||
#define sys_port_trace_k_msgq_put_front_blocking(msgq, timeout)
|
||||
|
||||
/**
|
||||
* @brief Trace Message Queue put at front attempt outcome
|
||||
* @param msgq Message Queue object
|
||||
* @param timeout Timeout period
|
||||
* @param ret Return value
|
||||
*/
|
||||
#define sys_port_trace_k_msgq_put_front_exit(msgq, timeout, ret)
|
||||
|
||||
/**
|
||||
* @brief Trace Message Queue get attempt entry
|
||||
* @param msgq Message Queue object
|
||||
|
||||
@ -136,7 +136,11 @@ static inline int put_msg_in_queue(struct k_msgq *msgq, const void *data,
|
||||
|
||||
key = k_spin_lock(&msgq->lock);
|
||||
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_msgq, put, msgq, timeout);
|
||||
if (put_at_back) {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_msgq, put, msgq, timeout);
|
||||
} else {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_msgq, put_front, msgq, timeout);
|
||||
}
|
||||
|
||||
if (msgq->used_msgs < msgq->max_msgs) {
|
||||
/* message queue isn't full */
|
||||
@ -183,17 +187,31 @@ static inline int put_msg_in_queue(struct k_msgq *msgq, const void *data,
|
||||
/* don't wait for message space to become available */
|
||||
result = -ENOMSG;
|
||||
} else {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_msgq, put, msgq, timeout);
|
||||
if (put_at_back) {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_msgq, put, msgq, timeout);
|
||||
} else {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_msgq, put_front, msgq, timeout);
|
||||
}
|
||||
|
||||
/* wait for put message success, failure, or timeout */
|
||||
_current->base.swap_data = (void *) data;
|
||||
|
||||
result = z_pend_curr(&msgq->lock, key, &msgq->wait_q, timeout);
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_msgq, put, msgq, timeout, result);
|
||||
|
||||
if (put_at_back) {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_msgq, put, msgq, timeout, result);
|
||||
} else {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_msgq, put_front, msgq, timeout, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_msgq, put, msgq, timeout, result);
|
||||
if (put_at_back) {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_msgq, put, msgq, timeout, result);
|
||||
} else {
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_msgq, put_front, msgq, timeout, result);
|
||||
}
|
||||
|
||||
if (resched) {
|
||||
z_reschedule(&msgq->lock, key);
|
||||
|
||||
@ -263,6 +263,9 @@ extern "C" {
|
||||
#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)
|
||||
|
||||
@ -513,6 +513,9 @@ void sys_trace_thread_info(struct k_thread *thread);
|
||||
#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)
|
||||
|
||||
@ -312,6 +312,14 @@
|
||||
sys_trace_k_msgq_put_blocking(msgq, data, timeout)
|
||||
#define sys_port_trace_k_msgq_put_exit(msgq, timeout, ret) \
|
||||
sys_trace_k_msgq_put_exit(msgq, data, timeout, ret)
|
||||
|
||||
#define sys_port_trace_k_msgq_put_front_enter(msgq, timeout) \
|
||||
sys_trace_k_msgq_put_front_enter(msgq, data, timeout)
|
||||
#define sys_port_trace_k_msgq_put_front_blocking(msgq, timeout) \
|
||||
sys_trace_k_msgq_put_front_blocking(msgq, data, timeout)
|
||||
#define sys_port_trace_k_msgq_put_front_exit(msgq, timeout, ret) \
|
||||
sys_trace_k_msgq_put_front_exit(msgq, data, timeout, ret)
|
||||
|
||||
#define sys_port_trace_k_msgq_get_enter(msgq, timeout) \
|
||||
sys_trace_k_msgq_get_enter(msgq, data, timeout)
|
||||
#define sys_port_trace_k_msgq_get_blocking(msgq, timeout) \
|
||||
@ -684,6 +692,11 @@ void sys_trace_k_msgq_cleanup_exit(struct k_msgq *msgq, int ret);
|
||||
void sys_trace_k_msgq_put_enter(struct k_msgq *msgq, const void *data, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_blocking(struct k_msgq *msgq, const void *data, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_exit(struct k_msgq *msgq, const void *data, k_timeout_t timeout, int ret);
|
||||
void sys_trace_k_msgq_put_front_enter(struct k_msgq *msgq, const void *data, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_front_blocking(struct k_msgq *msgq, const void *data,
|
||||
k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_put_front_exit(struct k_msgq *msgq, const void *data, k_timeout_t timeout,
|
||||
int ret);
|
||||
void sys_trace_k_msgq_get_enter(struct k_msgq *msgq, const void *data, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_get_blocking(struct k_msgq *msgq, const void *data, k_timeout_t timeout);
|
||||
void sys_trace_k_msgq_get_exit(struct k_msgq *msgq, const void *data, k_timeout_t timeout, int ret);
|
||||
|
||||
@ -304,6 +304,9 @@ void sys_trace_gpio_fire_callback_user(const struct device *port, struct gpio_ca
|
||||
#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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user