diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-12-01 04:47:11 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-12-01 04:47:11 -0500 |
| commit | 8db31be965afd2b910e747c870941189a63d1457 (patch) | |
| tree | 47a5bacaa4775415bf073a1dc3e77755f060523c | |
| parent | a7b6bd92688343a9be234761778727fd3d07e4b2 (diff) | |
add support system release events
| -rw-r--r-- | bin/showst.c | 1 | ||||
| -rw-r--r-- | src/sched_trace.c | 32 |
2 files changed, 20 insertions, 13 deletions
diff --git a/bin/showst.c b/bin/showst.c index 1580adf..68d8b50 100644 --- a/bin/showst.c +++ b/bin/showst.c | |||
| @@ -49,7 +49,6 @@ static void show(char* file) | |||
| 49 | { | 49 | { |
| 50 | size_t s; | 50 | size_t s; |
| 51 | struct st_event_record *rec, *end; | 51 | struct st_event_record *rec, *end; |
| 52 | unsigned int count; | ||
| 53 | if (map_trace(file, &rec, &end, &s) == 0) { | 52 | if (map_trace(file, &rec, &end, &s) == 0) { |
| 54 | print_all(rec, | 53 | print_all(rec, |
| 55 | ((unsigned int)((char*) end - (char*) rec)) | 54 | ((unsigned int)((char*) end - (char*) rec)) |
diff --git a/src/sched_trace.c b/src/sched_trace.c index 434b0d7..0c478f3 100644 --- a/src/sched_trace.c +++ b/src/sched_trace.c | |||
| @@ -22,10 +22,11 @@ static const char* event_names[] = { | |||
| 22 | "COMPLETION", | 22 | "COMPLETION", |
| 23 | "BLOCK", | 23 | "BLOCK", |
| 24 | "RESUME", | 24 | "RESUME", |
| 25 | "SYS_RELEASE", | ||
| 25 | "INVALID" | 26 | "INVALID" |
| 26 | }; | 27 | }; |
| 27 | 28 | ||
| 28 | #define ST_INVALID (ST_RESUME + 1) | 29 | #define ST_INVALID (ST_SYS_RELEASE + 1) |
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | const char* event2name(unsigned int id) | 32 | const char* event2name(unsigned int id) |
| @@ -48,6 +49,7 @@ u64 event_time(struct st_event_record* rec) | |||
| 48 | case ST_COMPLETION: | 49 | case ST_COMPLETION: |
| 49 | case ST_BLOCK: | 50 | case ST_BLOCK: |
| 50 | case ST_RESUME: | 51 | case ST_RESUME: |
| 52 | case ST_SYS_RELEASE: | ||
| 51 | when = rec->data.raw[0]; | 53 | when = rec->data.raw[0]; |
| 52 | break; | 54 | break; |
| 53 | default: | 55 | default: |
| @@ -89,18 +91,24 @@ static void print_param(struct st_event_record* rec) | |||
| 89 | rec->data.param.partition); | 91 | rec->data.param.partition); |
| 90 | } | 92 | } |
| 91 | 93 | ||
| 94 | static void print_time_data2(struct st_event_record* rec) | ||
| 95 | { | ||
| 96 | printf("%6.2fms", rec->data.raw[1] / 1000000.0); | ||
| 97 | } | ||
| 98 | |||
| 92 | static print_t print_detail[] = { | 99 | static print_t print_detail[] = { |
| 93 | print_nothing, | 100 | print_nothing, /* invalid */ |
| 94 | print_name, | 101 | print_name, /* NAME */ |
| 95 | print_param, | 102 | print_param, /* PARAM */ |
| 96 | print_nothing, | 103 | print_time_data2, /* RELEASE */ |
| 97 | print_nothing, | 104 | print_nothing, /* ASSIGNED */ |
| 98 | print_nothing, | 105 | print_nothing, /* SWITCH_TO */ |
| 99 | print_nothing, | 106 | print_nothing, /* SWITCH_FROM */ |
| 100 | print_nothing, | 107 | print_nothing, /* COMPLETION */ |
| 101 | print_nothing, | 108 | print_nothing, /* BLOCK */ |
| 102 | print_nothing, | 109 | print_nothing, /* RESUME */ |
| 103 | print_nothing | 110 | print_time_data2, /* SYS_RELEASE */ |
| 111 | print_nothing, /* invalid */ | ||
| 104 | }; | 112 | }; |
| 105 | 113 | ||
| 106 | void print_event(struct st_event_record *rec) | 114 | void print_event(struct st_event_record *rec) |
