Skip to content

Commit 07f5a6f

Browse files
eriktamlinkartben
authored andcommitted
k_pipe: fix trace point for blocking writes
Fix the trace point in k_pipe wait_for. Signed-off-by: Erik Tamlin <[email protected]>
1 parent 25b66c9 commit 07f5a6f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernel/pipe.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ static int wait_for(_wait_q_t *waitq, struct k_pipe *pipe, k_spinlock_key_t *key
4646

4747
pipe->waiting++;
4848
*need_resched = false;
49-
SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_pipe, read, pipe, timeout);
49+
if (waitq == &pipe->space) {
50+
SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_pipe, write, pipe, timeout);
51+
} else {
52+
SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_pipe, read, pipe, timeout);
53+
}
5054
rc = z_pend_curr(&pipe->lock, *key, waitq, timeout);
5155
*key = k_spin_lock(&pipe->lock);
5256
pipe->waiting--;

0 commit comments

Comments
 (0)