diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-03 00:23:32 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-03 00:23:32 -0500 |
| commit | 526afdfb333ca29170fd210b08860ac2a4c141ed (patch) | |
| tree | a5d1d271da8d59bfa1055d20247621c253efe02f | |
| parent | 7c5e0f1834595a83053ffa7cad1a1947a2490b60 (diff) | |
rip out old junk
| -rw-r--r-- | Makefile | 23 | ||||
| -rw-r--r-- | bin/hrt.c | 78 | ||||
| -rw-r--r-- | bin/iotest.c | 74 | ||||
| -rw-r--r-- | bin/rt_launch.c | 82 | ||||
| -rw-r--r-- | bin/set_rt_mode.c | 46 | ||||
| -rw-r--r-- | bin/show_scheduler.c | 10 | ||||
| -rw-r--r-- | bin/stdump.c | 22 | ||||
| -rw-r--r-- | bin/timeout.c | 36 | ||||
| -rw-r--r-- | include/adaptive.h | 38 | ||||
| -rw-r--r-- | include/edf-hsb.h | 10 | ||||
| -rw-r--r-- | include/litmus.h | 57 | ||||
| -rw-r--r-- | include/sched_trace.h | 21 | ||||
| -rw-r--r-- | src/adaptive.c | 48 | ||||
| -rw-r--r-- | src/edf-hsb.c | 48 | ||||
| -rw-r--r-- | src/litmus.c | 37 | ||||
| -rw-r--r-- | src/sched_trace.c | 1 | ||||
| -rw-r--r-- | src/syscalls.c | 7 |
17 files changed, 20 insertions, 618 deletions
| @@ -3,9 +3,9 @@ CPPFLAGS=-Wall -g | |||
| 3 | 3 | ||
| 4 | LIBS= ./liblitmus.a | 4 | LIBS= ./liblitmus.a |
| 5 | 5 | ||
| 6 | LIB_OBJ= litmus.o syscalls.o sched_trace.o adaptive.o edf-hsb.o task.o kernel_iface.o | 6 | LIB_OBJ= litmus.o syscalls.o sched_trace.o task.o kernel_iface.o |
| 7 | 7 | ||
| 8 | TARGETS = showsched iotest set_rt_mode run timeout rt_launch edfhsb liblitmus.a \ | 8 | TARGETS = run rt_launch liblitmus.a \ |
| 9 | wait_test np_test stdump mode_test base_task base_mt_task | 9 | wait_test np_test stdump mode_test base_task base_mt_task |
| 10 | 10 | ||
| 11 | vpath %.h include/ | 11 | vpath %.h include/ |
| @@ -30,30 +30,15 @@ mode_test: mode_test.o litmus.h liblitmus.a | |||
| 30 | np_test: np_test.o litmus.h liblitmus.a | 30 | np_test: np_test.o litmus.h liblitmus.a |
| 31 | cc -static -o np_test np_test.o ${LIBS} | 31 | cc -static -o np_test np_test.o ${LIBS} |
| 32 | 32 | ||
| 33 | iotest: iotest.o litmus.h liblitmus.a | 33 | run: run.o ${LIBS} |
| 34 | cc -static -o iotest iotest.o ${LIBS} | ||
| 35 | |||
| 36 | run: run.o | ||
| 37 | cc -o run run.o ${LIBS} | 34 | cc -o run run.o ${LIBS} |
| 38 | 35 | ||
| 39 | set_rt_mode: liblitmus.a set_rt_mode.o | ||
| 40 | cc -o set_rt_mode set_rt_mode.o ${LIBS} | ||
| 41 | |||
| 42 | showsched: show_scheduler.o liblitmus.a litmus.h | ||
| 43 | cc -o showsched show_scheduler.o ${LIBS} | ||
| 44 | |||
| 45 | timeout: liblitmus.a timeout.o litmus.h | ||
| 46 | cc -static -o timeout timeout.o ${LIBS} | ||
| 47 | |||
| 48 | rt_launch: liblitmus.a litmus.h rt_launch.o | 36 | rt_launch: liblitmus.a litmus.h rt_launch.o |
| 49 | cc -static -o rt_launch rt_launch.o ${LIBS} | 37 | cc -static -o rt_launch rt_launch.o ${LIBS} |
| 50 | 38 | ||
| 51 | edfhsb: liblitmus.a edf-hsb.o litmus.h edf-hsb.h hrt.o | ||
| 52 | cc -o edfhsb hrt.o edf-hsb.o ${LIBS} | ||
| 53 | |||
| 54 | stdump: liblitmus.a litmus.h sched_trace.h stdump.o | 39 | stdump: liblitmus.a litmus.h sched_trace.h stdump.o |
| 55 | cc -o stdump stdump.o ${LIBS} | 40 | cc -o stdump stdump.o ${LIBS} |
| 56 | 41 | ||
| 57 | liblitmus.a: ${LIB_OBJ} adaptive.h litmus.h edf-hsb.h | 42 | liblitmus.a: ${LIB_OBJ} litmus.h |
| 58 | ${AR} rcs liblitmus.a ${LIB_OBJ} | 43 | ${AR} rcs liblitmus.a ${LIB_OBJ} |
| 59 | 44 | ||
diff --git a/bin/hrt.c b/bin/hrt.c deleted file mode 100644 index 224293c..0000000 --- a/bin/hrt.c +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include <stdlib.h> | ||
| 3 | #include <string.h> | ||
| 4 | |||
| 5 | #include "edf-hsb.h" | ||
| 6 | |||
| 7 | |||
| 8 | void usage(char *name) | ||
| 9 | { | ||
| 10 | fprintf(stderr, | ||
| 11 | "EDF-HSB server setup utility\n" | ||
| 12 | "Usage: %s hrt show <#cpu>\n" | ||
| 13 | " %s hrt set <#cpu> <wcet> <period>\n" | ||
| 14 | " %s be create <wcet> <period>\n", | ||
| 15 | name, name, name); | ||
| 16 | exit(1); | ||
| 17 | } | ||
| 18 | |||
| 19 | |||
| 20 | int hrt(int argc, char** argv) | ||
| 21 | { | ||
| 22 | int wcet, period, cpu; | ||
| 23 | |||
| 24 | if (argc == 2 && !strcmp(argv[0], "show")) { | ||
| 25 | cpu = atoi(argv[1]); | ||
| 26 | if (!get_hrt(cpu, &wcet, &period)) | ||
| 27 | printf("HRT/%d = (%d, %d)\n", cpu, wcet, period); | ||
| 28 | else | ||
| 29 | perror("cannot read HRT settings"); | ||
| 30 | } else if (argc == 4 && !strcmp(argv[0], "set")) { | ||
| 31 | cpu = atoi(argv[1]); | ||
| 32 | wcet = atoi(argv[2]); | ||
| 33 | period = atoi(argv[3]); | ||
| 34 | printf("Setting HRT/%d to (%d, %d)", cpu, wcet, period); | ||
| 35 | if (!set_hrt(cpu, wcet, period)) | ||
| 36 | printf(" OK.\n"); | ||
| 37 | else { | ||
| 38 | printf("\n"); | ||
| 39 | perror("cannot write HRT settings"); | ||
| 40 | } | ||
| 41 | } else | ||
| 42 | return 1; | ||
| 43 | |||
| 44 | return 0; | ||
| 45 | } | ||
| 46 | |||
| 47 | int be(int argc, char** argv) | ||
| 48 | { | ||
| 49 | int wcet, period; | ||
| 50 | if (argc == 3 && !strcmp(argv[0], "create")) { | ||
| 51 | wcet = atoi(argv[1]); | ||
| 52 | period = atoi(argv[2]); | ||
| 53 | printf("Creating BE with (%d, %d)", wcet, period); | ||
| 54 | if (!create_be(wcet, period)) | ||
| 55 | printf(" OK.\n"); | ||
| 56 | else { | ||
| 57 | printf("\n"); | ||
| 58 | perror("cannot create BE server"); | ||
| 59 | } | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | else | ||
| 63 | return 1; | ||
| 64 | } | ||
| 65 | |||
| 66 | int main(int argc, char** argv) | ||
| 67 | { | ||
| 68 | int ret = 1; | ||
| 69 | if (argc > 1) { | ||
| 70 | if (!strcmp(argv[1], "hrt")) | ||
| 71 | ret = hrt(argc - 2, argv + 2); | ||
| 72 | else if (!strcmp(argv[1], "be")) | ||
| 73 | ret = be(argc - 2, argv + 2); | ||
| 74 | } | ||
| 75 | if (ret) | ||
| 76 | usage(argv[0]); | ||
| 77 | return ret; | ||
| 78 | } | ||
diff --git a/bin/iotest.c b/bin/iotest.c deleted file mode 100644 index ac07e74..0000000 --- a/bin/iotest.c +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | #include <stdio.h> | ||
| 2 | #include <stdlib.h> | ||
| 3 | #include <signal.h> | ||
| 4 | #include <unistd.h> | ||
| 5 | #include <sys/time.h> | ||
| 6 | #include <sys/wait.h> | ||
| 7 | |||
| 8 | #include "litmus.h" | ||
| 9 | |||
| 10 | #define US_PER_MS 1000 | ||
| 11 | |||
| 12 | int iotest(void *nil) { | ||
| 13 | int id = getpid(); | ||
| 14 | FILE* file; | ||
| 15 | char str[255]; | ||
| 16 | unsigned long last = 0; | ||
| 17 | struct timeval time; | ||
| 18 | |||
| 19 | printf("I'am real time task %d doing IO!\n", id); | ||
| 20 | snprintf(str, sizeof(str), "rt-io-%d.txt", id); | ||
| 21 | file = fopen(str, "w"); | ||
| 22 | if (!file) { | ||
| 23 | perror("could not open file for output"); | ||
| 24 | exit(1); | ||
| 25 | } | ||
| 26 | while (1) { | ||
| 27 | gettimeofday(&time, NULL); | ||
| 28 | if (time.tv_usec - last > US_PER_MS) { | ||
| 29 | fprintf(file, "ran at %lus %lums\n", time.tv_sec, time.tv_usec / US_PER_MS); | ||
| 30 | last = time.tv_usec; | ||
| 31 | } | ||
| 32 | fflush(file); | ||
| 33 | } | ||
| 34 | return id; | ||
| 35 | } | ||
| 36 | |||
| 37 | #define NUMTASKS 4 | ||
| 38 | |||
| 39 | int main(int argc, char** argv) | ||
| 40 | { | ||
| 41 | int rt_task[NUMTASKS]; | ||
| 42 | int i; | ||
| 43 | int ret, pid; | ||
| 44 | |||
| 45 | for (i = 0; i < NUMTASKS; i++) { | ||
| 46 | /* func arg cpu wcet period */ | ||
| 47 | rt_task[i] = create_rt_task(iotest, NULL, 0, 25, 100); | ||
| 48 | if (rt_task[i] < 0) { | ||
| 49 | perror("Could not create rt child process"); | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | sync(); | ||
| 54 | sync(); | ||
| 55 | |||
| 56 | printf(":: Starting real-time mode.\n"); | ||
| 57 | set_rt_mode(MODE_RT_RUN); | ||
| 58 | |||
| 59 | printf(":: Sleeping...\n"); | ||
| 60 | sleep(120); | ||
| 61 | |||
| 62 | printf("Killing real-time tasks.\n"); | ||
| 63 | for (i = 0; i < NUMTASKS; i++) { | ||
| 64 | printf(":: sending SIGKILL to %d\n", rt_task[i]); | ||
| 65 | kill(rt_task[i], SIGKILL); | ||
| 66 | } | ||
| 67 | for (i = 0; i < NUMTASKS; i++) { | ||
| 68 | pid = wait(&ret); | ||
| 69 | printf(":: %d exited with status %d\n", pid, ret); | ||
| 70 | } | ||
| 71 | printf(":: Leaving real-time mode.\n"); | ||
