Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: perf: add core information into performance log #8128

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

btian1
Copy link
Contributor

@btian1 btian1 commented Aug 30, 2023

print out core ID in each core performance log tracing.

@btian1 btian1 marked this pull request as ready for review August 30, 2023 14:04
@@ -84,8 +84,8 @@ static void zephyr_domain_thread_fn(void *p1, void *p2, void *p3)

if (++runs == 1 << CYCLES_WINDOW_SIZE) {
cycles_sum >>= CYCLES_WINDOW_SIZE;
tr_info(&ll_tr, "ll timer avg %u, max %u, overruns %u",
cycles_sum, cycles_max, overruns);
tr_info(&ll_tr, "ll core %u avg %u, max %u, overruns %u",
Copy link
Member

Choose a reason for hiding this comment

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

we probably want to keep timer after core %u

print out core ID in each core performance log tracing.

Signed-off-by: Baofeng Tian <[email protected]>
tr_info(&ll_tr, "ll timer avg %u, max %u, overruns %u",
cycles_sum, cycles_max, overruns);
tr_info(&ll_tr, "ll core %u timer avg %u, max %u, overruns %u",
core, cycles_sum, cycles_max, overruns);
Copy link
Collaborator

Choose a reason for hiding this comment

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

sof-logger used to print a core ID in each line, wondering if it would be a lot of overhead to add that to mtrace too...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when parsing:
[ 24.203081] ll_schedule: zephyr_domain_thread_fn: ll timer avg 3412, max 6115, overruns 0
CI want to know following data belong to which core, in this line, there is no coreID information, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could add a Kconfig option to add core info to all logs, This could even be a Zephyr side option, but probably easier to add it to SOF side trace macros. I'd keep this 1) kconfig option (as there is bound to be a slight overhead), 2) and keep this short " ". zephyr/include/zephyr/logging/log_core.h shows how this is done to add the "" et al log level prefixes (in a way that can be kconfig'ed out.

But that's an option. Would require some experiments to see how this impacts overall logging overhead. If it's too much, then this PR is probably better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is small cost, since only add one more var print per second, add Kconfig seems too cautious.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@btian1 I mean if we add this for ALL logs. We have configs that do not have multiple cores and for these this is just overhead to have core0 in all logs. And e.g. on the Intel platforms, we have to fit all logs in a 4KiB SRAM window so adding overhead might lead to dropping logs when many are sent in bursts. You might want to disable this in Kconfig if you want to enable DBG logs.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Just to clarify, we can do the generic add core id as a separate commit as well. If this is needed to unblock perf work, I'm ok to go just adding core id to here. It's easy to adapt this piece of code if generic support to attach core-id is added later.

@lgirdwood lgirdwood merged commit 7d41360 into thesofproject:main Aug 31, 2023
40 of 41 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.

4 participants