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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/schedule/zephyr_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.

cycles_sum = 0;
cycles_max = 0;
runs = 0;
Expand Down
Loading