Commit 840f6701 authored by Caitlin Ross's avatar Caitlin Ross

adding ROSS instrumentation support to Slimfly

parent 3e9f0dbb
......@@ -3679,8 +3679,8 @@ struct model_net_method dragonfly_custom_method =
NULL,//(revent_f)dragonfly_custom_sample_rc_fn,
(init_f)dragonfly_custom_sample_init,
NULL,//(final_f)dragonfly_custom_sample_fin
.mn_model_stat_register = custom_dragonfly_register_model_types,
.mn_get_model_stat_types = custom_dragonfly_get_model_types,
custom_dragonfly_register_model_types,
custom_dragonfly_get_model_types,
};
struct model_net_method dragonfly_custom_router_method =
......@@ -3701,8 +3701,8 @@ struct model_net_method dragonfly_custom_router_method =
NULL,//(revent_f)dragonfly_custom_rsample_rc_fn,
(init_f)dragonfly_custom_rsample_init,
NULL,//(final_f)dragonfly_custom_rsample_fin
.mn_model_stat_register = custom_router_register_model_types,
.mn_get_model_stat_types = custom_dfly_router_get_model_types,
custom_router_register_model_types,
custom_dfly_router_get_model_types,
};
#ifdef ENABLE_CORTEX
......
......@@ -371,7 +371,7 @@ struct router_state
struct dfly_router_sample ross_rsample;
};
/* had to pull some of the ROSS model stats collection stuff up here */
/* ROSS Instrumentation Support */
void dragonfly_event_collect(terminal_message *m, tw_lp *lp, char *buffer, int *collect_flag);
void dragonfly_model_stat_collect(terminal_state *s, tw_lp *lp, char *buffer);
void dfly_router_model_stat_collect(router_state *s, tw_lp *lp, char *buffer);
......
......@@ -284,6 +284,31 @@ struct router_state
int* cur_hist_num; //Aren't used
};
/* ROSS Instrumentation Support */
struct slimfly_sample
{
tw_lpid lpid;
};
void slimfly_event_collect(slim_terminal_message *m, tw_lp *lp, char *buffer, int *collect_flag);
void slimfly_model_stat_collect(terminal_state *s, tw_lp *lp, char *buffer);
static void ross_slimfly_sample_fn(terminal_state * s, tw_bf * bf, tw_lp * lp, struct slimfly_sample *sample);
static void ross_slimfly_sample_rc_fn(terminal_state * s, tw_bf * bf, tw_lp * lp, struct slimfly_sample *sample);
st_model_types slimfly_model_types[] = {
{(rbev_trace_f) slimfly_event_collect,
sizeof(int),
(ev_trace_f) slimfly_event_collect,
sizeof(int),
(model_stat_f) slimfly_model_stat_collect,
sizeof(tw_lpid) + sizeof(long) * 2 + sizeof(double) + sizeof(tw_stime) *2,
(sample_event_f) ross_slimfly_sample_fn,
(sample_revent_f) ross_slimfly_sample_rc_fn,
sizeof(struct slimfly_sample) } ,
{NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0}
};
/* End of ROSS model stats collection */
static short routing = MINIMAL;
static tw_stime slimfly_total_time = 0;
......@@ -3373,6 +3398,57 @@ static void slimfly_register(tw_lptype *base_type) {
lp_type_register("slimfly_router", &slimfly_lps[1]);
}
/* For ROSS Instrumentation */
void slimfly_event_collect(slim_terminal_message *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->type;
memcpy(buffer, &type, sizeof(type));
}
void slimfly_model_stat_collect(terminal_state *s, tw_lp *lp, char *buffer)
{
(void)lp;
(void)s;
(void)buffer;
return;
}
static void ross_slimfly_sample_fn(terminal_state * s, tw_bf * bf, tw_lp * lp, struct slimfly_sample *sample)
{
(void)lp;
(void)bf;
(void)s;
(void)sample;
return;
}
static void ross_slimfly_sample_rc_fn(terminal_state * s, tw_bf * bf, tw_lp * lp, struct slimfly_sample *sample)
{
(void)lp;
(void)bf;
(void)s;
(void)sample;
return;
}
static const st_model_types *slimfly_get_model_types(void)
{
return(&slimfly_model_types[0]);
}
static void slimfly_register_model_types(st_model_types *base_type)
{
st_model_type_register(LP_CONFIG_NM, base_type);
st_model_type_register("slimfly_router", base_type);
}
/*** END of ROSS event tracing additions */
/* data structure for slimfly statistics */
struct model_net_method slimfly_method =
{
......@@ -3384,5 +3460,7 @@ struct model_net_method slimfly_method =
.model_net_method_recv_msg_event_rc = NULL,
.mn_get_lp_type = slimfly_get_cn_lp_type,
.mn_get_msg_sz = slimfly_get_msg_sz,
.mn_report_stats = slimfly_report_stats
.mn_report_stats = slimfly_report_stats,
.mn_model_stat_register = slimfly_register_model_types,
.mn_get_model_stat_types = slimfly_get_model_types
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment