summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-23 02:12:49 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-23 02:12:49 -0400
commite23e931be4776b89149fdb2596f47096e6cdb78c (patch)
treefaf3963cc501f103cd2554553ec74ce21157b42e /SD-VBS/common/c
parente2d933df44b7b387b41c8c7805393ad3857c4448 (diff)
parente0217a963c6c0e0667d41d075038685956bcfacf (diff)
Merge branch 'sd-vbs' of ssh://rtsrv.cs.unc.edu/public/mc2-scripts-and-benchmarks into sd-vbs
Diffstat (limited to 'SD-VBS/common/c')
-rw-r--r--SD-VBS/common/c/extra.h29
1 files changed, 4 insertions, 25 deletions
diff --git a/SD-VBS/common/c/extra.h b/SD-VBS/common/c/extra.h
index 3215951..8c67b33 100644
--- a/SD-VBS/common/c/extra.h
+++ b/SD-VBS/common/c/extra.h
@@ -1,5 +1,5 @@
1/** 1/**
2 * Copyright 2019 Sims Hill Osborne and Joshua Bakita 2 * Copyright 2019 Sims Hill Osborne and 2020 Joshua Bakita
3 * 3 *
4 * This header provides facilities by which to separably run and time TACLeBench 4 * This header provides facilities by which to separably run and time TACLeBench
5 * To use this for paired task timing, define PAIRED (pass CFLAGS=-DPAIRED to make) 5 * To use this for paired task timing, define PAIRED (pass CFLAGS=-DPAIRED to make)
@@ -29,7 +29,7 @@ extern int sched_getcpu();
29#include <sys/syscall.h> 29#include <sys/syscall.h>
30#endif 30#endif
31 31
32#define LITMUS 0 32#define LITMUS 1
33#define MC2 0 33#define MC2 0
34#define MMDC_PROF 0 34#define MMDC_PROF 0
35 35
@@ -200,20 +200,6 @@ static void _rt_load_params_itrl(int argc, char **argv) {
200 perror("Unable to migrate to specified CPU"); \ 200 perror("Unable to migrate to specified CPU"); \
201 exit(1); \ 201 exit(1); \
202 } \ 202 } \
203 struct reservation_config res; \
204 res.id = gettid(); \
205 res.cpu = cpu; \
206 res.priority = LITMUS_HIGHEST_PRIORITY; \
207 /* we take over half the CPU time (these are ns) */ \
208 res.polling_params.budget = ms2ns(3000); \
209 res.polling_params.period = ms2ns(3000); \
210 res.polling_params.offset = 0; \
211 res.polling_params.relative_deadline = ms2ns(3000); \
212 /* Not 100% sure that we should use periodic polling */ \
213 if (reservation_create(PERIODIC_POLLING, &res) < 0) { \
214 perror("Unable to create reservation"); \
215 exit(1); \
216 } \
217 struct rt_task rt_param; \ 203 struct rt_task rt_param; \
218 init_rt_task_param(&rt_param); \ 204 init_rt_task_param(&rt_param); \
219 /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ 205 /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \
@@ -223,7 +209,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
223 rt_param.cls = RT_CLASS_HARD; \ 209 rt_param.cls = RT_CLASS_HARD; \
224 rt_param.release_policy = TASK_PERIODIC; \ 210 rt_param.release_policy = TASK_PERIODIC; \
225 rt_param.budget_policy = NO_ENFORCEMENT; \ 211 rt_param.budget_policy = NO_ENFORCEMENT; \
226 rt_param.cpu = cpu; \ 212 rt_param.cpu = _rt_core; \
227 if (set_rt_task_param(gettid(), &rt_param) < 0) { \ 213 if (set_rt_task_param(gettid(), &rt_param) < 0) { \
228 perror("Unable to set real-time parameters"); \ 214 perror("Unable to set real-time parameters"); \
229 exit(1); \ 215 exit(1); \
@@ -244,13 +230,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
244 230
245#if MC2 231#if MC2
246#define MC2_SETUP \ 232#define MC2_SETUP \
247 struct mc2_task mc2_param; \ 233
248 mc2_param.res_id = gettid(); \
249 mc2_param.crit = CRIT_LEVEL_A; \
250 if (set_mc2_task_param(gettid(), &mc2_param) < 0) { \
251 perror("Unable to set MC^2 task params"); \
252 exit(1); \
253 } \
254 set_page_color(rt_param.cpu); 234 set_page_color(rt_param.cpu);
255#else 235#else
256#define MC2_SETUP 236#define MC2_SETUP
@@ -261,7 +241,6 @@ static void _rt_load_params_itrl(int argc, char **argv) {
261 perror("Unable to become a real-time task"); \ 241 perror("Unable to become a real-time task"); \
262 exit(1); \ 242 exit(1); \
263 } \ 243 } \
264 reservation_destroy(gettid(), rt_param.cpu);
265 244
266#if __arm__ 245#if __arm__
267// On ARM, manually flush the cache 246// On ARM, manually flush the cache