diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-02-04 20:15:36 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-02-04 20:15:36 -0500 |
commit | 0bc17e1ede563f8d59706250dc46757570977723 (patch) | |
tree | b46ddb87fa027b3f12223f70958e4d37ee5a6703 | |
parent | 48e8cdc06c6bf3e3344ef8824843d6a83434cea5 (diff) |
sched_plgn: Add fn. for reporting CPU/cluster maps
This patch adds the plugin interface "get_domain_proc_info()".
Plugins use this function to report their cpu/clustering configuration
to the user via /proc/litmus/domains and /proc/litmus/cpus.
-rw-r--r-- | include/litmus/sched_plugin.h | 6 | ||||
-rw-r--r-- | litmus/sched_plugin.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index 0f2fe90123db..f173dca7cd65 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h | |||
@@ -16,6 +16,8 @@ | |||
16 | typedef long (*activate_plugin_t) (void); | 16 | typedef long (*activate_plugin_t) (void); |
17 | typedef long (*deactivate_plugin_t) (void); | 17 | typedef long (*deactivate_plugin_t) (void); |
18 | 18 | ||
19 | struct domain_proc_info; | ||
20 | typedef long (*get_domain_proc_info_t) (struct domain_proc_info **info); | ||
19 | 21 | ||
20 | 22 | ||
21 | /********************* scheduler invocation ******************/ | 23 | /********************* scheduler invocation ******************/ |
@@ -69,6 +71,9 @@ typedef long (*admit_task_t)(struct task_struct* tsk); | |||
69 | 71 | ||
70 | typedef void (*release_at_t)(struct task_struct *t, lt_t start); | 72 | typedef void (*release_at_t)(struct task_struct *t, lt_t start); |
71 | 73 | ||
74 | /************************ misc routines ***********************/ | ||
75 | |||
76 | |||
72 | struct sched_plugin { | 77 | struct sched_plugin { |
73 | struct list_head list; | 78 | struct list_head list; |
74 | /* basic info */ | 79 | /* basic info */ |
@@ -77,6 +82,7 @@ struct sched_plugin { | |||
77 | /* setup */ | 82 | /* setup */ |
78 | activate_plugin_t activate_plugin; | 83 | activate_plugin_t activate_plugin; |
79 | deactivate_plugin_t deactivate_plugin; | 84 | deactivate_plugin_t deactivate_plugin; |
85 | get_domain_proc_info_t get_domain_proc_info; | ||
80 | 86 | ||
81 | /* scheduler invocation */ | 87 | /* scheduler invocation */ |
82 | scheduler_tick_t tick; | 88 | scheduler_tick_t tick; |
diff --git a/litmus/sched_plugin.c b/litmus/sched_plugin.c index c4747e0ef2ab..592489629105 100644 --- a/litmus/sched_plugin.c +++ b/litmus/sched_plugin.c | |||
@@ -111,6 +111,12 @@ static long litmus_dummy_deactivate_plugin(void) | |||
111 | return 0; | 111 | return 0; |
112 | } | 112 | } |
113 | 113 | ||
114 | static long litmus_dummy_get_domain_proc_info(struct domain_proc_info **d) | ||
115 | { | ||
116 | *d = NULL; | ||
117 | return 0; | ||
118 | } | ||
119 | |||
114 | #ifdef CONFIG_LITMUS_LOCKING | 120 | #ifdef CONFIG_LITMUS_LOCKING |
115 | 121 | ||
116 | static long litmus_dummy_allocate_lock(struct litmus_lock **lock, int type, | 122 | static long litmus_dummy_allocate_lock(struct litmus_lock **lock, int type, |
@@ -137,6 +143,7 @@ struct sched_plugin linux_sched_plugin = { | |||
137 | .finish_switch = litmus_dummy_finish_switch, | 143 | .finish_switch = litmus_dummy_finish_switch, |
138 | .activate_plugin = litmus_dummy_activate_plugin, | 144 | .activate_plugin = litmus_dummy_activate_plugin, |
139 | .deactivate_plugin = litmus_dummy_deactivate_plugin, | 145 | .deactivate_plugin = litmus_dummy_deactivate_plugin, |
146 | .get_domain_proc_info = litmus_dummy_get_domain_proc_info, | ||
140 | #ifdef CONFIG_LITMUS_LOCKING | 147 | #ifdef CONFIG_LITMUS_LOCKING |
141 | .allocate_lock = litmus_dummy_allocate_lock, | 148 | .allocate_lock = litmus_dummy_allocate_lock, |
142 | #endif | 149 | #endif |
@@ -175,6 +182,7 @@ int register_sched_plugin(struct sched_plugin* plugin) | |||
175 | CHECK(complete_job); | 182 | CHECK(complete_job); |
176 | CHECK(activate_plugin); | 183 | CHECK(activate_plugin); |
177 | CHECK(deactivate_plugin); | 184 | CHECK(deactivate_plugin); |
185 | CHECK(get_domain_proc_info); | ||
178 | #ifdef CONFIG_LITMUS_LOCKING | 186 | #ifdef CONFIG_LITMUS_LOCKING |
179 | CHECK(allocate_lock); | 187 | CHECK(allocate_lock); |
180 | #endif | 188 | #endif |