-
Notifications
You must be signed in to change notification settings - Fork 349
profiling task: modify task profiling with performance counter macro #6407
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| #include <sof/schedule/ll_schedule_domain.h> | ||
| #include <sof/schedule/schedule.h> | ||
| #include <sof/schedule/task.h> | ||
|
|
||
| #include <sof/lib/perf_cnt.h> | ||
| #include <zephyr/kernel.h> | ||
|
|
||
| LOG_MODULE_REGISTER(ll_schedule, CONFIG_SOF_LOG_LEVEL); | ||
|
|
@@ -122,30 +122,18 @@ static void zephyr_ll_task_insert_after_unlocked(struct task *task, struct task | |
|
|
||
| static inline enum task_state do_task_run(struct task *task) | ||
| { | ||
| uint32_t cycles0, cycles1, diff; | ||
| enum task_state state; | ||
|
|
||
| cycles0 = k_cycle_get_32(); | ||
| #if CONFIG_PERFORMANCE_COUNTERS | ||
| perf_cnt_init(&task->pcd); | ||
| #endif | ||
|
|
||
| state = task_run(task); | ||
|
|
||
| cycles1 = k_cycle_get_32(); | ||
| if (cycles1 > cycles0) | ||
| diff = cycles1 - cycles0; | ||
| else | ||
| diff = UINT32_MAX - cycles0 + cycles1; | ||
|
|
||
| task->cycles_sum += diff; | ||
| task->cycles_max = diff > task->cycles_max ? diff : task->cycles_max; | ||
|
|
||
| if (++task->cycles_cnt == 1 << CYCLES_WINDOW_SIZE) { | ||
| task->cycles_sum >>= CYCLES_WINDOW_SIZE; | ||
| tr_info(&ll_tr, "ll task %p %pU avg %u, max %u", | ||
| task, task->uid, task->cycles_sum, task->cycles_max); | ||
| task->cycles_sum = 0; | ||
| task->cycles_cnt = 0; | ||
| task->cycles_max = 0; | ||
| } | ||
| #if CONFIG_PERFORMANCE_COUNTERS | ||
| perf_cnt_stamp(&task->pcd, perf_trace_null, NULL); | ||
| task_perf_cnt_avg(&task->pcd, task_perf_avg_info, &ll_tr, task); | ||
|
||
| #endif | ||
|
|
||
| return state; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have now two new lines. Just keep one.