include/ccKVS/inline_util.h
static inline void poll_local_req_for_latency_measurement(struct latency_flags* latency_info, struct timespec* start,
														  struct local_latency* local_measure)
{

	if ((MEASURE_LATENCY == 1) && ((latency_info->measured_req_flag) == LOCAL_REQ) && ((local_measure->local_latency_start_polling) == 1))
		if (*(local_measure->flag_to_poll) == 0) {
			struct timespec end;
			clock_gettime(CLOCK_MONOTONIC, &end);
			int useconds = ((end.tv_sec - start->tv_sec) * 1000000) +
						   ((end.tv_nsec - start->tv_nsec) / 1000);
			if (ENABLE_ASSERTIONS) assert(useconds > 0);
      //			yellow_printf("Latency of a local req, region %d, flag ptr %llu: %d us\n",
      //										local_measure->measured_local_region, local_measure->flag_to_poll, useconds);
			bookkeep_latency(useconds, LOCAL_REQ);
			latency_info->measured_req_flag = NO_REQ;
			local_measure->measured_local_region = -1;
			local_measure->local_latency_start_polling = 0;
			local_measure->flag_to_poll = NULL;

		}
}
// Poll for the local reqs completion to measure a local req's latency
Poll for the local reqs completion to measure a local req's latency
Poll for the local reqs completion to measure a local req ' s latency
static inline void poll_local_req_for_latency_measurement(struct latency_flags* latency_info, struct timespec* start,
														  struct local_latency* local_measure)
{
	if ((MEASURE_LATENCY == 1) && ((latency_info->measured_req_flag) == LOCAL_REQ) && ((local_measure->local_latency_start_polling) == 1))
		if (*(local_measure->flag_to_poll) == 0) {
			struct timespec end;
			clock_gettime(CLOCK_MONOTONIC, &end);
			int useconds = ((end.tv_sec - start->tv_sec) * 1000000) +
						   ((end.tv_nsec - start->tv_nsec) / 1000);
			if (ENABLE_ASSERTIONS) assert(useconds > 0);
			bookkeep_latency(useconds, LOCAL_REQ);
			latency_info->measured_req_flag = NO_REQ;
			local_measure->measured_local_region = -1;
			local_measure->local_latency_start_polling = 0;
			local_measure->flag_to_poll = NULL;
		}
}
static inline void poll_local_req_for_latency_measurement ( struct latency_flags * latency_info , struct timespec * start , struct local_latency * local_measure ) { if ( ( MEASURE_LATENCY == 1 ) && ( ( latency_info -> measured_req_flag ) == LOCAL_REQ ) && ( ( local_measure -> local_latency_start_polling ) == 1 ) ) if ( * ( local_measure -> flag_to_poll ) == 0 ) { struct timespec end ; clock_gettime ( CLOCK_MONOTONIC , & end ) ; int useconds = ( ( end . tv_sec - start -> tv_sec ) * 1000000 ) + ( ( end . tv_nsec - start -> tv_nsec ) / 1000 ) ; if ( ENABLE_ASSERTIONS ) assert ( useconds > 0 ) ; bookkeep_latency ( useconds , LOCAL_REQ ) ; latency_info -> measured_req_flag = NO_REQ ; local_measure -> measured_local_region = -1 ; local_measure -> local_latency_start_polling = 0 ; local_measure -> flag_to_poll = NULL ; } }
Poll for the local reqs completion to measure a local req's latency
Poll for the local reqs completion to measure a local req ' s latency
//			yellow_printf("Latency of a local req, region %d, flag ptr %llu: %d us\n", //										local_measure->measured_local_region, local_measure->flag_to_poll, useconds);