diff options
author | peter <ztong@cs.unc.edu> | 2019-01-09 17:27:25 -0500 |
---|---|---|
committer | peter <ztong@cs.unc.edu> | 2019-01-09 17:27:25 -0500 |
commit | 5b3db7103adcfe1330897eaaaaf12719e4b49ce6 (patch) | |
tree | a3f54794aa791cb6556adfd5e28ef426358a3d23 | |
parent | 40e52bd5a196d2d5ca6bbcbf5b5138febf340390 (diff) |
trace debug test
-rw-r--r-- | litmus/sched_edfsc.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/litmus/sched_edfsc.c b/litmus/sched_edfsc.c index f7202a774c56..860039b92bf1 100644 --- a/litmus/sched_edfsc.c +++ b/litmus/sched_edfsc.c | |||
@@ -1,8 +1,26 @@ | |||
1 | #include <linux/module.h> | 1 | #include <linux/module.h> //for error codes |
2 | #include <litmus/sched_plugin.h> | 2 | #include <litmus/sched_plugin.h> //for register_sched_plugin |
3 | #include <linux/percpu.h> //for per cpu allocations | ||
4 | #include <linux/sched.h> //for task_struct | ||
5 | #include <litmus/rt_domain.h> | ||
6 | #include <linux/cpumask.h> //for for_each_online_cpu | ||
7 | #include <litmus/litmus.h> //for debug | ||
3 | 8 | ||
4 | static struct task_struct* edfsc_schedule(struct task_struct * prev) | 9 | struct cpu_entry_t { |
5 | { | 10 | int cpu; |
11 | |||
12 | rt_domain_t local_queues; | ||
13 | |||
14 | struct task_struct* scheduled; | ||
15 | struct task_struct* linked; | ||
16 | }; | ||
17 | |||
18 | DEFINE_PER_CPU(struct cpu_entry_t, edfsc_cpu_state); | ||
19 | |||
20 | #define cpu_state_for(cpu_id) (&per_cpu(cpu_entry_t, cpu_id)) | ||
21 | #define local_cpu_state() (this_cpu_ptr(&cpu_entry_t)) | ||
22 | |||
23 | static struct task_struct* edfsc_schedule(struct task_struct * prev) { | ||
6 | return NULL; | 24 | return NULL; |
7 | } | 25 | } |
8 | 26 | ||
@@ -19,6 +37,18 @@ static struct sched_plugin edfsc_plugin __cacheline_aligned_in_smp = { | |||
19 | 37 | ||
20 | //plugin init | 38 | //plugin init |
21 | static int __init init_edfsc(void){ | 39 | static int __init init_edfsc(void){ |
40 | int cpu; | ||
41 | struct cpu_entry_t *entry; | ||
42 | |||
43 | for_each_online_cpu(cpu) { | ||
44 | TRACE("Initializing CPU%d...\n", cpu); | ||
45 | entry = cpu_state_for(cpu); | ||
46 | entry->cpu = cpu; | ||
47 | entry->scheduled = NULL; | ||
48 | entry->linked = NULL; | ||
49 | edf_domain_init(&entry->local_queues, NULL, NULL); | ||
50 | } | ||
51 | |||
22 | return register_sched_plugin(&edfsc_plugin); | 52 | return register_sched_plugin(&edfsc_plugin); |
23 | } | 53 | } |
24 | 54 | ||