aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-10-15 17:18:01 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-10-15 17:18:01 -0400
commit34c00c482f8d63af02784de9d376237611b42bfe (patch)
tree4ecf10ace6253f848ee2a73a76bb9e79171164e3
parent84c21bf0c89821bd35b035cd9f7f08acc13ea2dc (diff)
Allow servers to run on a special NULL cpu.HEADmaster
-rw-r--r--rt-graph.c8
-rw-r--r--rt-graph.h6
-rw-r--r--rt-plot-container.c4
-rw-r--r--rt-plot-vcpu.c91
4 files changed, 65 insertions, 44 deletions
diff --git a/rt-graph.c b/rt-graph.c
index f9abcef..b77f9ea 100644
--- a/rt-graph.c
+++ b/rt-graph.c
@@ -664,7 +664,7 @@ int rt_graph_check_server_param(struct graph_info *ginfo, struct record *record,
664int rt_graph_check_server_switch_to(struct graph_info *ginfo, 664int 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,
709int rt_graph_check_server_switch_away(struct graph_info *ginfo, 711int 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
diff --git a/rt-graph.h b/rt-graph.h
index f3a1705..91ce3c0 100644
--- a/rt-graph.h
+++ b/rt-graph.h
@@ -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);
189int rt_graph_check_server_switch_to(struct graph_info *ginfo, 191int 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);
193int rt_graph_check_server_switch_away(struct graph_info *ginfo, 195int 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);
197int rt_graph_check_server_release(struct graph_info *ginfo, 199int 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
72static int server_iterator(struct graph_info *ginfo, struct record *record, void *data) 72static 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
43try_server_switch_away(struct graph_info *ginfo, struct vcpu_info *vcpu_info, 43try_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