diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-28 22:08:32 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-28 22:08:32 -0400 |
commit | 99d81fbfc86fae7f5709e66a6c213195017f5627 (patch) | |
tree | 39ed130e765b417ee5d95af243e22e369f8d42da /src | |
parent | 8574756fb52c5feff4c552bdae6c2d8dfab4a0ba (diff) |
add stdump filter for adaptive systems2007.2
Diffstat (limited to 'src')
-rw-r--r-- | src/stdump.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/stdump.c b/src/stdump.c new file mode 100644 index 0000000..282fb31 --- /dev/null +++ b/src/stdump.c | |||
@@ -0,0 +1,44 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | |||
5 | |||
6 | #include "litmus.h" | ||
7 | #include "adaptive.h" | ||
8 | #include "sched_trace.h" | ||
9 | |||
10 | int show_sl_chg(trace_header_t* hdr) | ||
11 | { | ||
12 | service_level_change_record_t *rec; | ||
13 | |||
14 | rec = (service_level_change_record_t*) hdr; | ||
15 | printf("SL CHANGE : PID=%d PERIOD=%lu\n", rec->task.pid, | ||
16 | rec->new_level.period); | ||
17 | return 0; | ||
18 | } | ||
19 | |||
20 | int show_weight_error(trace_header_t* hdr) | ||
21 | { | ||
22 | weight_error_record_t *rec; | ||
23 | |||
24 | rec = (weight_error_record_t*) hdr; | ||
25 | printf("WEIGHT ERR: PID=%d EST=%5.4f ACT=%5.4f\n", rec->task, | ||
26 | fp2f(rec->estimate), fp2f(rec->actual)); | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | |||
31 | int main(int argc, char** argv) | ||
32 | { | ||
33 | record_callback_t cb; | ||
34 | int ret; | ||
35 | |||
36 | init_record_callback(&cb); | ||
37 | set_callback(ST_SERVICE_LEVEL_CHANGE, show_sl_chg, &cb); | ||
38 | set_callback(ST_WEIGHT_ERROR, show_weight_error, &cb); | ||
39 | |||
40 | ret = walk_sched_trace_files_ordered(argv + 1, argc - 1, 0, &cb); | ||
41 | if (ret != 0) | ||
42 | perror("walk failed"); | ||
43 | return 0; | ||
44 | } | ||