diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-10-15 17:18:01 -0400 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-10-15 17:18:01 -0400 |
| commit | 34c00c482f8d63af02784de9d376237611b42bfe (patch) | |
| tree | 4ecf10ace6253f848ee2a73a76bb9e79171164e3 | |
| parent | 84c21bf0c89821bd35b035cd9f7f08acc13ea2dc (diff) | |
| -rw-r--r-- | rt-graph.c | 8 | ||||
| -rw-r--r-- | rt-graph.h | 6 | ||||
| -rw-r--r-- | rt-plot-container.c | 4 | ||||
| -rw-r--r-- | rt-plot-vcpu.c | 91 |
4 files changed, 65 insertions, 44 deletions
| @@ -664,7 +664,7 @@ int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record, | |||
| 664 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, | 664 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, |
| 665 | struct record *record, | 665 | struct record *record, |
| 666 | gint *sid, gint *job, | 666 | gint *sid, gint *job, |
| 667 | gint *tid, gint *tjob, | 667 | gint *tid, gint *tjob, gint *cpu, |
| 668 | unsigned long long *ts) | 668 | unsigned long long *ts) |
| 669 | { | 669 | { |
| 670 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; | 670 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; |
| @@ -684,6 +684,7 @@ int rt_graph_check_server_switch_to(struct graph_info *ginfo, | |||
| 684 | STORE_FIELD(rtg_info, event, sswitch_to, job); | 684 | STORE_FIELD(rtg_info, event, sswitch_to, job); |
| 685 | STORE_FIELD(rtg_info, event, sswitch_to, tid); | 685 | STORE_FIELD(rtg_info, event, sswitch_to, tid); |
| 686 | STORE_FIELD(rtg_info, event, sswitch_to, tjob); | 686 | STORE_FIELD(rtg_info, event, sswitch_to, tjob); |
| 687 | STORE_FIELD(rtg_info, event, sswitch_to, cpu); | ||
| 687 | } | 688 | } |
| 688 | 689 | ||
| 689 | id = pevent_data_type(pevent, record); | 690 | id = pevent_data_type(pevent, record); |
| @@ -692,6 +693,7 @@ int rt_graph_check_server_switch_to(struct graph_info *ginfo, | |||
| 692 | LOAD_INT(rtg_info, record, sswitch_to, job, job); | 693 | LOAD_INT(rtg_info, record, sswitch_to, job, job); |
| 693 | LOAD_INT(rtg_info, record, sswitch_to, tid, tid); | 694 | LOAD_INT(rtg_info, record, sswitch_to, tid, tid); |
| 694 | LOAD_INT(rtg_info, record, sswitch_to, tjob, tjob); | 695 | LOAD_INT(rtg_info, record, sswitch_to, tjob, tjob); |
| 696 | LOAD_INT(rtg_info, record, sswitch_to, cpu, cpu); | ||
| 695 | *ts = get_rts(ginfo, record); | 697 | *ts = get_rts(ginfo, record); |
| 696 | 698 | ||
| 697 | dprintf(3, "Read server_switch_to(job(%d, %d)): %d\n", | 699 | dprintf(3, "Read server_switch_to(job(%d, %d)): %d\n", |
| @@ -709,7 +711,7 @@ int rt_graph_check_server_switch_to(struct graph_info *ginfo, | |||
| 709 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, | 711 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, |
| 710 | struct record *record, | 712 | struct record *record, |
| 711 | gint *sid, gint *job, | 713 | gint *sid, gint *job, |
| 712 | gint *tid, gint *tjob, | 714 | gint *tid, gint *tjob, gint *cpu, |
| 713 | unsigned long long *ts) | 715 | unsigned long long *ts) |
| 714 | { | 716 | { |
| 715 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; | 717 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; |
| @@ -729,6 +731,7 @@ int rt_graph_check_server_switch_away(struct graph_info *ginfo, | |||
| 729 | STORE_FIELD(rtg_info, event, sswitch_away, job); | 731 | STORE_FIELD(rtg_info, event, sswitch_away, job); |
| 730 | STORE_FIELD(rtg_info, event, sswitch_away, tid); | 732 | STORE_FIELD(rtg_info, event, sswitch_away, tid); |
| 731 | STORE_FIELD(rtg_info, event, sswitch_away, tjob); | 733 | STORE_FIELD(rtg_info, event, sswitch_away, tjob); |
| 734 | STORE_FIELD(rtg_info, event, sswitch_away, cpu); | ||
| 732 | } | 735 | } |
| 733 | 736 | ||
| 734 | id = pevent_data_type(pevent, record); | 737 | id = pevent_data_type(pevent, record); |
| @@ -737,6 +740,7 @@ int rt_graph_check_server_switch_away(struct graph_info *ginfo, | |||
| 737 | LOAD_INT(rtg_info, record, sswitch_away, job, job); | 740 | LOAD_INT(rtg_info, record, sswitch_away, job, job); |
| 738 | LOAD_INT(rtg_info, record, sswitch_away, tid, tid); | 741 | LOAD_INT(rtg_info, record, sswitch_away, tid, tid); |
| 739 | LOAD_INT(rtg_info, record, sswitch_away, tjob, tjob); | 742 | LOAD_INT(rtg_info, record, sswitch_away, tjob, tjob); |
| 743 | LOAD_INT(rtg_info, record, sswitch_away, tjob, cpu); | ||
| 740 | *ts = get_rts(ginfo, record); | 744 | *ts = get_rts(ginfo, record); |
| 741 | 745 | ||
| 742 | 746 | ||
| @@ -86,12 +86,14 @@ struct rt_graph_info { | |||
| 86 | struct format_field *sswitch_to_job_field; | 86 | struct format_field *sswitch_to_job_field; |
| 87 | struct format_field *sswitch_to_tid_field; | 87 | struct format_field *sswitch_to_tid_field; |
| 88 | struct format_field *sswitch_to_tjob_field; | 88 | struct format_field *sswitch_to_tjob_field; |
| 89 | struct format_field *sswitch_to_cpu_field; | ||
| 89 | 90 | ||
| 90 | gint server_switch_away_id; | 91 | gint server_switch_away_id; |
| 91 | struct format_field *sswitch_away_sid_field; | 92 | struct format_field *sswitch_away_sid_field; |
| 92 | struct format_field *sswitch_away_job_field; | 93 | struct format_field *sswitch_away_job_field; |
| 93 | struct format_field *sswitch_away_tid_field; | 94 | struct format_field *sswitch_away_tid_field; |
| 94 | struct format_field *sswitch_away_tjob_field; | 95 | struct format_field *sswitch_away_tjob_field; |
| 96 | struct format_field *sswitch_away_cpu_field; | ||
| 95 | 97 | ||
| 96 | gint server_release_id; | 98 | gint server_release_id; |
| 97 | struct format_field *srelease_sid_field; | 99 | struct format_field *srelease_sid_field; |
| @@ -188,11 +190,11 @@ int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record, | |||
| 188 | unsigned long long *period); | 190 | unsigned long long *period); |
| 189 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, | 191 | int rt_graph_check_server_switch_to(struct graph_info *ginfo, |
| 190 | struct record *record, | 192 | struct record *record, |
| 191 | gint *sid, gint *job, gint *tid, gint *tjob, | 193 | gint *sid, gint *job, gint *tid, gint *tjob, gint *cpu, |
| 192 | unsigned long long *when); | 194 | unsigned long long *when); |
| 193 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, | 195 | int rt_graph_check_server_switch_away(struct graph_info *ginfo, |
| 194 | struct record *record, | 196 | struct record *record, |
| 195 | gint *sid, gint *job, gint *tid, gint *tjob, | 197 | gint *sid, gint *job, gint *tid, gint *tjob, gint *cpu, |
| 196 | unsigned long long *when); | 198 | unsigned long long *when); |
| 197 | int rt_graph_check_server_release(struct graph_info *ginfo, | 199 | int rt_graph_check_server_release(struct graph_info *ginfo, |
| 198 | struct record *record, | 200 | struct record *record, |
diff --git a/rt-plot-container.c b/rt-plot-container.c index b21f9de..623c616 100644 --- a/rt-plot-container.c +++ b/rt-plot-container.c | |||
| @@ -71,7 +71,7 @@ static inline void try_job_update(struct server_iter_args *args, int candidate) | |||
| 71 | 71 | ||
| 72 | static int server_iterator(struct graph_info *ginfo, struct record *record, void *data) | 72 | static int server_iterator(struct graph_info *ginfo, struct record *record, void *data) |
| 73 | { | 73 | { |
| 74 | int sid, job, tid, tjob, match, ret; | 74 | int sid, job, tid, tjob, match, ret, cpu; |
| 75 | struct server_iter_args *args = data; | 75 | struct server_iter_args *args = data; |
| 76 | unsigned long long when, time = get_rts(ginfo, record); | 76 | unsigned long long when, time = get_rts(ginfo, record); |
| 77 | 77 | ||
| @@ -80,7 +80,7 @@ static int server_iterator(struct graph_info *ginfo, struct record *record, void | |||
| 80 | if (time < args->goal) | 80 | if (time < args->goal) |
| 81 | return 1; | 81 | return 1; |
| 82 | 82 | ||
| 83 | #define ARGS ginfo, record, &sid, &job, &tid, &tjob, &when | 83 | #define ARGS ginfo, record, &sid, &job, &tid, &tjob, &cpu, &when |
| 84 | match = rt_graph_check_server_switch_away(ARGS); | 84 | match = rt_graph_check_server_switch_away(ARGS); |
| 85 | if (match && sid == args->match_sid) { | 85 | if (match && sid == args->match_sid) { |
| 86 | /* We were running something */ | 86 | /* We were running something */ |
diff --git a/rt-plot-vcpu.c b/rt-plot-vcpu.c index b04bcfb..60b3d90 100644 --- a/rt-plot-vcpu.c +++ b/rt-plot-vcpu.c | |||
| @@ -43,13 +43,12 @@ static int | |||
| 43 | try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | 43 | try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, |
| 44 | struct record *record, struct plot_info *info) | 44 | struct record *record, struct plot_info *info) |
| 45 | { | 45 | { |
| 46 | int job, sid, tid, tjob, match, ret = 0; | 46 | int job, sid, tid, tjob, cpu, match, ret = 0; |
| 47 | unsigned long long ts; | 47 | unsigned long long ts; |
| 48 | 48 | ||
| 49 | match = rt_graph_check_server_switch_away(ginfo, record, | 49 | match = rt_graph_check_server_switch_away(ginfo, record, |
| 50 | &sid, &job, | 50 | &sid, &job, |
| 51 | &tid, &tjob, &ts); | 51 | &tid, &tjob, &cpu, &ts); |
| 52 | |||
| 53 | if (match && sid == vcpu_info->sid) { | 52 | if (match && sid == vcpu_info->sid) { |
| 54 | /* This server is no longer running something */ | 53 | /* This server is no longer running something */ |
| 55 | update_task_label(vcpu_info, tid, tjob); | 54 | update_task_label(vcpu_info, tid, tjob); |
| @@ -76,28 +75,37 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | |||
| 76 | 75 | ||
| 77 | ret = 1; | 76 | ret = 1; |
| 78 | } else if (vcpu_info->show_server && match && tid == vcpu_info->sid) { | 77 | } else if (vcpu_info->show_server && match && tid == vcpu_info->sid) { |
| 79 | /* This server is no longer running */ | 78 | info->box = TRUE; |
| 80 | update_server_label(vcpu_info, tjob); | 79 | info->bstart = vcpu_info->server_run_time; |
| 80 | info->bend = ts; | ||
| 81 | 81 | ||
| 82 | check_server(vcpu_info->server_running, vcpu_info, ts, | 82 | if (!sid) { |
| 83 | "stopped running when wasn't running"); | 83 | /* This server is leaving an undetermined state */ |
| 84 | check_server(!vcpu_info->task_running || vcpu_info->task_cpu == NO_CPU, | 84 | vcpu_info->server_run_time = ts; |
| 85 | vcpu_info, ts, "stopped running while a task is active"); | ||
| 86 | 85 | ||
| 87 | if (vcpu_info->server_run_time && vcpu_info->server_run_time < ts) { | 86 | if (vcpu_info->server_running) { |
| 88 | info->box = TRUE; | ||
| 89 | if (!sid) | ||
| 90 | info->bcolor = 0; | 87 | info->bcolor = 0; |
| 91 | else | 88 | info->bfill = TRUE; |
| 92 | info->bcolor = hash_cpu(sid - 1); | 89 | } else { |
| 93 | info->bfill = TRUE; | 90 | info->bcolor = hash_cpu(vcpu_info->server_cpu); |
| 94 | info->bstart = vcpu_info->server_run_time; | 91 | info->bfill = FALSE; |
| 95 | info->bend = ts; | 92 | } |
| 93 | } else { | ||
| 94 | /* This server is no longer running */ | ||
| 95 | update_server_label(vcpu_info, tjob); | ||
| 96 | |||
| 97 | /* This should always be true. It is drawn just to show | ||
| 98 | * when server state has broken | ||
| 99 | */ | ||
| 100 | info->bfill = (vcpu_info->server_running) ? TRUE : FALSE; | ||
| 101 | |||
| 102 | info->bcolor = hash_cpu(cpu); | ||
| 96 | info->blabel = vcpu_info->server_label; | 103 | info->blabel = vcpu_info->server_label; |
| 104 | |||
| 105 | vcpu_info->server_run_time = 0ULL; | ||
| 106 | vcpu_info->server_cpu = NO_CPU; | ||
| 107 | vcpu_info->server_running = FALSE; | ||
| 97 | } | 108 | } |
| 98 | vcpu_info->server_run_time = 0ULL; | ||
| 99 | vcpu_info->server_cpu = NO_CPU; | ||
| 100 | vcpu_info->server_running = FALSE; | ||
| 101 | 109 | ||
| 102 | ret = 1; | 110 | ret = 1; |
| 103 | } | 111 | } |
| @@ -105,11 +113,6 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | |||
| 105 | if (ret) { | 113 | if (ret) { |
| 106 | dprintf(3, "VCPU Switch away tid: %d on %d:%d at %llu\n", | 114 | dprintf(3, "VCPU Switch away tid: %d on %d:%d at %llu\n", |
| 107 | tid, sid, job, ts); | 115 | tid, sid, job, ts); |
| 108 | |||
| 109 | vcpu_info->task_run_time = 0ULL; | ||
| 110 | vcpu_info->task_tid = -1; | ||
| 111 | vcpu_info->task_running = FALSE; | ||
| 112 | vcpu_info->task_cpu = NO_CPU; | ||
| 113 | } | 116 | } |
| 114 | 117 | ||
| 115 | return ret; | 118 | return ret; |
| @@ -118,11 +121,11 @@ try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | |||
| 118 | static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | 121 | static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, |
| 119 | struct record *record, struct plot_info *info) | 122 | struct record *record, struct plot_info *info) |
| 120 | { | 123 | { |
| 121 | int job, sid, tid, tjob, match, ret = 0; | 124 | int job, sid, tid, tjob, cpu, match, ret = 0; |
| 122 | unsigned long long ts; | 125 | unsigned long long ts; |
| 123 | 126 | ||
| 124 | match = rt_graph_check_server_switch_to(ginfo, record, | 127 | match = rt_graph_check_server_switch_to(ginfo, record, |
| 125 | &sid, &job, &tid, &tjob, &ts); | 128 | &sid, &job, &tid, &tjob, &cpu, &ts); |
| 126 | if (match && sid == vcpu_info->sid) { | 129 | if (match && sid == vcpu_info->sid) { |
| 127 | update_server_label(vcpu_info, job); | 130 | update_server_label(vcpu_info, job); |
| 128 | check_server(!vcpu_info->task_running || vcpu_info->task_cpu == NO_CPU, vcpu_info, ts, | 131 | check_server(!vcpu_info->task_running || vcpu_info->task_cpu == NO_CPU, vcpu_info, ts, |
| @@ -137,22 +140,33 @@ static int try_server_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu | |||
| 137 | 140 | ||
| 138 | vcpu_info->task_run_time = ts; | 141 | vcpu_info->task_run_time = ts; |
| 139 | vcpu_info->task_cpu = sid; | 142 | vcpu_info->task_cpu = sid; |
| 140 | vcpu_info->server_cpu = record->cpu; | 143 | vcpu_info->server_cpu = cpu; |
| 141 | vcpu_info->task_tid = tid; | 144 | vcpu_info->task_tid = tid; |
| 142 | vcpu_info->task_running = TRUE; | 145 | vcpu_info->task_running = TRUE; |
| 143 | ret = 1; | 146 | ret = 1; |
| 144 | } else if (vcpu_info->show_server && match && tid == vcpu_info->sid) { | 147 | } else if (vcpu_info->show_server && match && tid == vcpu_info->sid) { |
| 145 | /* This server is now running */ | 148 | if (!sid) { |
| 146 | update_server_label(vcpu_info, tjob); | 149 | /* Server is now in an undetermined state */ |
| 150 | if (vcpu_info->server_running) { | ||
| 151 | info->box = TRUE; | ||
| 152 | info->bstart = vcpu_info->server_run_time; | ||
| 153 | info->bend = ts; | ||
| 154 | info->blabel = vcpu_info->server_label; | ||
| 155 | info->bfill = TRUE; | ||
| 156 | info->bcolor = hash_cpu(vcpu_info->server_cpu); | ||
| 157 | } | ||
| 158 | } else { | ||
| 159 | /* This server is now running */ | ||
| 160 | update_server_label(vcpu_info, tjob); | ||
| 147 | 161 | ||
| 148 | check_server(vcpu_info->spare || !vcpu_info->server_running || vcpu_info->server_cpu == NO_CPU, | ||
| 149 | vcpu_info, ts, "running server again on %d:%d, run: %d, cpu: %d", sid, job, vcpu_info->server_running, vcpu_info->server_cpu); | ||
| 150 | 162 | ||
| 151 | vcpu_info->spare = FALSE; | 163 | vcpu_info->server_running = TRUE; |
| 164 | vcpu_info->task_running = FALSE; | ||
| 165 | vcpu_info->task_run_time = ts; | ||
| 152 | 166 | ||
| 167 | } | ||
| 168 | vcpu_info->server_cpu = cpu; | ||
| 153 | vcpu_info->server_run_time = ts; | 169 | vcpu_info->server_run_time = ts; |
| 154 | vcpu_info->server_cpu = sid; | ||
| 155 | vcpu_info->server_running = TRUE; | ||
| 156 | ret = 1; | 170 | ret = 1; |
| 157 | } | 171 | } |
| 158 | 172 | ||
| @@ -196,7 +210,7 @@ static int try_switch_to(struct graph_info *ginfo, struct vcpu_info *vcpu_info, | |||
| 196 | } | 210 | } |
| 197 | 211 | ||
| 198 | if (ret) { | 212 | if (ret) { |
| 199 | dprintf(3, "VCPU Switch away on VCPU %d for %d:%d at %llu\n", | 213 | dprintf(3, "Switch to on VCPU %d for %d:%d at %llu\n", |
| 200 | vcpu_info->sid, pid, job, ts); | 214 | vcpu_info->sid, pid, job, ts); |
| 201 | } | 215 | } |
| 202 | return ret; | 216 | return ret; |
| @@ -260,6 +274,7 @@ static int try_server_block(struct graph_info *ginfo, struct vcpu_info *vcpu_inf | |||
| 260 | vcpu_info->block_time = ts; | 274 | vcpu_info->block_time = ts; |
| 261 | vcpu_info->block_cpu = record->cpu; | 275 | vcpu_info->block_cpu = record->cpu; |
| 262 | vcpu_info->blocked = TRUE; | 276 | vcpu_info->blocked = TRUE; |
| 277 | vcpu_info->server_running = FALSE; | ||
| 263 | 278 | ||
| 264 | if (!ts) | 279 | if (!ts) |
| 265 | die("Initally no block time\n"); | 280 | die("Initally no block time\n"); |
| @@ -495,8 +510,8 @@ int rt_vcpu_plot_record_matches(struct rt_plot_common *rt, | |||
| 495 | unsigned long long dull; | 510 | unsigned long long dull; |
| 496 | 511 | ||
| 497 | #define ARG ginfo, record, &sid, &dint | 512 | #define ARG ginfo, record, &sid, &dint |
| 498 | match = rt_graph_check_server_switch_to(ARG, &dint, &dint, &dull) || | 513 | match = rt_graph_check_server_switch_to(ARG, &dint, &dint, &dint, &dull) || |
| 499 | rt_graph_check_server_switch_away(ARG,&dint, &dint, &dull) || | 514 | rt_graph_check_server_switch_away(ARG, &dint, &dint, &dint, &dull) || |
| 500 | rt_graph_check_server_completion(ARG, &dull) || | 515 | rt_graph_check_server_completion(ARG, &dull) || |
| 501 | rt_graph_check_server_release(ARG, &dull, &dull) || | 516 | rt_graph_check_server_release(ARG, &dull, &dull) || |
| 502 | rt_graph_check_switch_to(ARG, &dull) || | 517 | rt_graph_check_switch_to(ARG, &dull) || |
