Skip to content

Conversation

@jsarha
Copy link
Contributor

@jsarha jsarha commented Mar 13, 2025

Kconfig option DEBUG_IPC_TIMINGS to add logging after IPC handling right before sending IPC reply. The logging contains both the reply and the original request message headers and the time that it took to process the request in micro seconds. The value can be used to collect statistics on changes in firmware response times. This also disables the logging of the received request on core 0 to avoid flooding the logs too much.

#ifdef CONFIG_DEBUG_IPC_TIMINGS
tr_info(&ipc_tr, "tx-reply\t: %#x|%#x to %#x|%#x in %llu us", msg_reply.header,
msg_reply.extension, req.primary.dat, req.extension.dat,
k_cyc_to_us_near64(sof_cycle_get_64() - tstamp));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function only prepares IPCs and ipc4_send_reply() below only queues them, they're actually sent in ipc_send_queued_msg() in the IPC work handler. But maybe indeed for our purposes we only need the processing time, not the request-response time, just something to be aware of. So maybe the Kconfig description isn't quite correct - it's not before sending, it's before queuing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be E2E timing, i.e we stop the timer when we actually send the reply ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be E2E timing, i.e we stop the timer when we actually send the reply ?

@lgirdwood I guess both are needed for different kinds of analysis - depending on what we want to measure.

Kconfig option DEBUG_IPC_TIMINGS to add logging after IPC handling
before putting IPC reply to send queue. The logging contains both the
reply and the original request message headers and the time that it
took to process the request in micro seconds. The value can be used to
collect statistics on changes in firmware response times. This also
disables the logging of the received request on core 0 to avoid
flooding the logs too much.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
@jsarha jsarha force-pushed the ipc_handling_times branch from a09df34 to f4ec37c Compare March 17, 2025 12:11
@jsarha
Copy link
Contributor Author

jsarha commented Mar 17, 2025

Update commit message and Kconfig description to better describe what the commit does.

Copy link
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can bw used as is to get actual processing times, without response queue draining time

@lgirdwood lgirdwood merged commit 41edf3e into thesofproject:main Mar 19, 2025
47 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants