Commit df4c0a60 authored by Anmol Vatsa's avatar Anmol Vatsa

profiling remote flows

parent 63b6d741
......@@ -1984,7 +1984,9 @@ int proxy_node_grant_remote_cap(struct cnode* node_grant_cnode, cn_principal_t*
int proxy_remote_create_flow(cn_principal_t *as, cn_dispatch_result_t *result,
cn_objtype_t type, cn_dispatch_create_flow_args_t * fargs, cn_obj_t **obj,
struct cnode **obj_base) {
c_log_debug("DEBUG:%s: Request remote end to create flow", __func__);
struct timespec starttime;
clock_gettime(CLOCK_REALTIME, &starttime);
c_log_debug("DEBUG:%s:%lu.%lu:Start", __func__, starttime.tv_sec, starttime.tv_nsec);
int res = 0;
struct cnode *dest_cnode;
......@@ -2031,13 +2033,16 @@ int proxy_remote_create_flow(cn_principal_t *as, cn_dispatch_result_t *result,
res = cn_dispatch_result_fail(result, "ERROR:%s: Could not retrieve remote client for key[%s].", __func__, shadow_node_grant->remote_end);
goto fail_free1;
struct timespec reqstarttime;
clock_gettime(CLOCK_REALTIME, &reqstarttime);
ControllerRPC__RPCMessage *response;
if( intercomm_rpc(client_addr, message, &response) < 0) {
c_log_err("ERROR:%s:Could not send CreateObjectRequest", __func__);
res = cn_dispatch_result_fail(result, "ERROR:%s:Could not send CreateObjectRequest", __func__);
goto fail_free1;
struct timespec reqendtime;
clock_gettime(CLOCK_REALTIME, &reqendtime);
char* from_ctlr_id = response->from_ctlr_id;
//NOTE: Ideally, the from_ctlr_id would be signed
//with a private key that should also be verified here
......@@ -2115,6 +2120,11 @@ int proxy_remote_create_flow(cn_principal_t *as, cn_dispatch_result_t *result,
struct timespec endtime;
clock_gettime(CLOCK_REALTIME, &endtime);
c_log_debug("DEBUG:%s:%lu.%lu:End", __func__, endtime.tv_sec, endtime.tv_nsec);
c_log_debug("DEBUG:%s:End-Start:%lu", __func__, mytimediff(starttime, endtime) - mytimediff(reqstarttime, reqendtime));
c_log_debug("DEBUG:%s:NW End-Start:%lu", __func__, mytimediff(starttime, endtime));
return res;
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