> On 15 Feb 2022, at 10:40, Juergen Gross <jgr...@suse.com> wrote: > > On 15.02.22 11:15, Luca Fancellu wrote: >> Add a public function to retrieve the scheduler id by the scheduler >> name. >> Signed-off-by: Luca Fancellu <luca.fance...@arm.com> >> --- >> xen/common/sched/core.c | 11 +++++++++++ >> xen/include/xen/sched.h | 11 +++++++++++ >> 2 files changed, 22 insertions(+) >> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c >> index 8f4b1ca10d1c..9696d3c1d769 100644 >> --- a/xen/common/sched/core.c >> +++ b/xen/common/sched/core.c >> @@ -2947,6 +2947,17 @@ void scheduler_enable(void) >> scheduler_active = true; >> } >> +int __init sched_get_id_by_name(const char *sched_name) >> +{ >> + unsigned int i; >> + >> + for ( i = 0; i < NUM_SCHEDULERS; i++ ) >> + if ( schedulers[i] && !strcmp(schedulers[i]->opt_name, sched_name) ) >> + return schedulers[i]->sched_id; >> + >> + return -1; >> +} >> + > > Please make use of this function in scheduler_init(), as this > functionality is open coded there, too. > Ok I will change the code in scheduler_init to use the new function. Cheers, Luca > > Juergen > <OpenPGP_0xB0DE9DD628BF132F.asc>
- [PATCH 0/5] Boot time cpupools Luca Fancellu
- [PATCH 2/5] xen/sched: create public function for cpupo... Luca Fancellu
- Re: [PATCH 2/5] xen/sched: create public function f... Juergen Gross
- Re: [PATCH 2/5] xen/sched: create public functi... Luca Fancellu
- Re: [PATCH 2/5] xen/sched: create public fu... Juergen Gross
- [PATCH 3/5] xen/sched: retrieve scheduler id by name Luca Fancellu
- Re: [PATCH 3/5] xen/sched: retrieve scheduler id by... Juergen Gross
- Re: [PATCH 3/5] xen/sched: retrieve scheduler i... Luca Fancellu
- [PATCH 1/5] tools/cpupools: Give a name to unnamed cpup... Luca Fancellu
- Re: [PATCH 1/5] tools/cpupools: Give a name to unna... Juergen Gross
- Re: [PATCH 1/5] tools/cpupools: Give a name to ... Luca Fancellu
- Re: [PATCH 1/5] tools/cpupools: Give a name... Juergen Gross
- Re: [PATCH 1/5] tools/cpupools: Give a... Luca Fancellu
- [PATCH 4/5] xen/cpupool: Create different cpupools at b... Luca Fancellu
- Re: [PATCH 4/5] xen/cpupool: Create different cpupo... Juergen Gross
- Re: [PATCH 4/5] xen/cpupool: Create different c... Luca Fancellu
- Re: [PATCH 4/5] xen/cpupool: Create differe... Juergen Gross
- Re: [PATCH 4/5] xen/cpupool: Create di... Luca Fancellu