Skip to content

Conversation

@jsarha
Copy link
Contributor

@jsarha jsarha commented Feb 25, 2025

The sof-ipc-timer collects module initialization and configuration timings from 'journalctl -k -o short-precise' output if SOF IPC debug is enabled.

@jsarha jsarha requested a review from a team as a code owner February 25, 2025 19:28
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

I didn't look at any of the logic, just some general Python advice.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Just needs some more readability for me.

@jsarha
Copy link
Contributor Author

jsarha commented Mar 3, 2025

I am actually thinking of turning this PR to draft, as it does not produce the accuracy needed to to show the DRAM offloading impact, so I do not think its worth my time to polish this to the merge-able quality. Or maybe I come up with something extra to this script parsing FW logs too with some extra lines for the purpose, that can be turned on with a kcontrol option.

@kv2019i kv2019i requested a review from Copilot March 3, 2025 13:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

A new tool, sof-ipc-timer.py, has been added to collect and report initialization and configuration timings from kernel log output when SOF IPC debug is enabled.

  • Introduces a Component class for mapping widget IDs to components.
  • Implements parsing of journalctl log messages for kernel debug information and computes timing differences.
  • Provides command-line options for controlling output details such as reply timings, module id, and pipeline id.

Reviewed Changes

File Description
tools/sof-ipc-timer.py New tool to extract timing information from kernel logs for SOF IPC debug.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

@lgirdwood
Copy link
Member

@jsarha ping

@jsarha
Copy link
Contributor Author

jsarha commented Mar 6, 2025

@jsarha ping

There has been some further development since this version. I'll finish those developments first and then update and clean up everything according to comments here.

The sof-ipc-timer collects module initialization and configuration
timings, and set pipeline state timings from 'journalctl -k -o
short-precise' output if SOF IPC debug is enabled.

Different kind of outputs can be generated with different flags. Adding
just -s gives a summary like this:

host-copier.0.playback init     min 196 us      max 456 us      average 322 us of 100
gain.1.1 init   min 192 us      max 552 us      average 327 us of 100
gain.1.1 conf   min 197 us      max 494 us      average 325 us of 100
mixin.1.1 init  min 193 us      max 8219 us     average 406 us of 100
mixout.2.1 init min 197 us      max 573 us      average 327 us of 100
gain.2.1 init   min 197 us      max 484 us      average 324 us of 100
gain.2.1 conf   min 193 us      max 418 us      average 322 us of 100
smart_amp.2.1 init      min 194 us      max 526 us      average 326 us of 100
smart_amp.2.1 conf      min 197 us      max 1826 us     average 393 us of 100
dai-copier.SSP.NoCodec-0.playback init  min 202 us      max 2135 us     average 479 us of 100
pipeline.1: host-copier.0.playback, gain.1.1, mixin.1.1,
pipeline.1 3    min 200 us      max 2592 us     average 553 us of 200
pipeline.1 4    min 228 us      max 3202 us     average 673 us of 100
pipeline.1 2    min 208 us      max 1867 us     average 565 us of 100
pipeline.2: mixout.2.1, gain.2.1, smart_amp.2.1, dai-copier.SSP.NoCodec-0.playback,
pipeline.2 3    min 199 us      max 2667 us     average 863 us of 200
pipeline.2 4    min 205 us      max 8656 us     average 794 us of 100

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>

sof-ipc-timer.py: Fix summary only functionality
@jsarha jsarha force-pushed the dmesg_ipc_diff_timer branch from c33652a to 54df69f Compare March 11, 2025 20:40
@jsarha
Copy link
Contributor Author

jsarha commented Mar 11, 2025

There has now been almost complete rewrite with added features. I took advice on the most of the suggestions where applicable, but on several places I restructured the code heavily to make it more maintainable.

I'll resolve all the past comments because its unlikely they are applicable any more.

@marc-hb
Copy link
Collaborator

marc-hb commented Mar 11, 2025

There has now been almost complete rewrite with added features.

Have you considered a fresh new PR and closing this one? We can still refer to this one when needed.

@jsarha
Copy link
Contributor Author

jsarha commented Mar 12, 2025

There has now been almost complete rewrite with added features.

Have you considered a fresh new PR and closing this one? We can still refer to this one when needed.

Sure, done:
#1262

@jsarha jsarha closed this Mar 12, 2025
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.

4 participants