mirror of https://github.com/thesofproject/sof.git
perf: scheduler: add periodic ll exec performance counter
Simple measument of periodically run ll scheduler task execution routine. Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This commit is contained in:
parent
05f2a626d1
commit
85525efe59
|
@ -15,6 +15,7 @@
|
||||||
#include <sof/lib/clk.h>
|
#include <sof/lib/clk.h>
|
||||||
#include <sof/lib/cpu.h>
|
#include <sof/lib/cpu.h>
|
||||||
#include <sof/lib/notifier.h>
|
#include <sof/lib/notifier.h>
|
||||||
|
#include <sof/lib/perf_cnt.h>
|
||||||
#include <sof/list.h>
|
#include <sof/list.h>
|
||||||
#include <sof/platform.h>
|
#include <sof/platform.h>
|
||||||
#include <sof/schedule/ll_schedule.h>
|
#include <sof/schedule/ll_schedule.h>
|
||||||
|
@ -23,14 +24,19 @@
|
||||||
#include <sof/schedule/task.h>
|
#include <sof/schedule/task.h>
|
||||||
#include <sof/spinlock.h>
|
#include <sof/spinlock.h>
|
||||||
#include <ipc/topology.h>
|
#include <ipc/topology.h>
|
||||||
|
#include <config.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/* one instance of data allocated per core */
|
||||||
struct ll_schedule_data {
|
struct ll_schedule_data {
|
||||||
struct list_item tasks; /* list of ll tasks */
|
struct list_item tasks; /* list of ll tasks */
|
||||||
atomic_t num_tasks; /* number of ll tasks */
|
atomic_t num_tasks; /* number of ll tasks */
|
||||||
|
#if CONFIG_PERFORMANCE_COUNTERS
|
||||||
|
struct perf_cnt_data pcd;
|
||||||
|
#endif
|
||||||
struct ll_schedule_domain *domain; /* scheduling domain */
|
struct ll_schedule_domain *domain; /* scheduling domain */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,10 +158,14 @@ static void schedule_ll_tasks_run(void *data)
|
||||||
|
|
||||||
spin_unlock(sch->domain->lock);
|
spin_unlock(sch->domain->lock);
|
||||||
|
|
||||||
|
perf_cnt_init(&sch->pcd);
|
||||||
|
|
||||||
/* run tasks if there are any pending */
|
/* run tasks if there are any pending */
|
||||||
if (schedule_ll_is_pending(sch))
|
if (schedule_ll_is_pending(sch))
|
||||||
schedule_ll_tasks_execute(sch, last_tick);
|
schedule_ll_tasks_execute(sch, last_tick);
|
||||||
|
|
||||||
|
perf_cnt_stamp(TRACE_CLASS_SCHEDULE_LL, &sch->pcd, true);
|
||||||
|
|
||||||
spin_lock(sch->domain->lock);
|
spin_lock(sch->domain->lock);
|
||||||
|
|
||||||
/* reschedule only if all clients are done */
|
/* reschedule only if all clients are done */
|
||||||
|
|
Loading…
Reference in New Issue