diff --git a/samples/cxl_host_exerciser/cxl_he_cache_cmd.h b/samples/cxl_host_exerciser/cxl_he_cache_cmd.h index e2439483d7e5..eb4386540a4c 100644 --- a/samples/cxl_host_exerciser/cxl_he_cache_cmd.h +++ b/samples/cxl_host_exerciser/cxl_he_cache_cmd.h @@ -272,9 +272,9 @@ class he_cache_cmd : public he_cmd { return -1; } - total_latency = total_latency + get_ticks(); + total_latency = total_latency + get_ticks() - get_penalty_start_ticks(); host_exe_->logger_->info("Iteration: {0} Latency: {1:0.3f} nanoseconds", - i, (double)(get_ticks() * LATENCY_FACTOR)); + i, (double)((get_ticks()- get_penalty_start_ticks()) * LATENCY_FACTOR)); } //end for loop total_latency = total_latency * LATENCY_FACTOR; @@ -556,9 +556,9 @@ class he_cache_cmd : public he_cmd { return -1; } - total_latency = total_latency + get_ticks(); + total_latency = total_latency + get_ticks() - get_penalty_start_ticks(); host_exe_->logger_->info("Iteration: {0} Latency: {1:0.3f} nanoseconds", - i, (double)(get_ticks() * LATENCY_FACTOR)); + i, (double)((get_ticks() - get_penalty_start_ticks() ) * LATENCY_FACTOR)); } //end for loop total_latency = total_latency * LATENCY_FACTOR; @@ -793,9 +793,9 @@ class he_cache_cmd : public he_cmd { return -1; } - total_latency = total_latency + get_ticks(); + total_latency = total_latency + get_ticks() - get_penalty_start_ticks(); host_exe_->logger_->info("Iteration: {0} Latency: {1:0.3f} nanoseconds", - i, (double)(get_ticks() * LATENCY_FACTOR)); + i, (double)((get_ticks() - get_penalty_start_ticks() ) * LATENCY_FACTOR)); } //end for loop total_latency = total_latency * LATENCY_FACTOR; diff --git a/samples/cxl_host_exerciser/cxl_he_cmd.h b/samples/cxl_host_exerciser/cxl_he_cmd.h index 2da1f1d8ab07..dffb52466910 100644 --- a/samples/cxl_host_exerciser/cxl_he_cmd.h +++ b/samples/cxl_host_exerciser/cxl_he_cmd.h @@ -352,6 +352,19 @@ class he_cmd : public test_command { return 0; } + uint64_t get_penalty_start_ticks() { + volatile he_cache_dsm_status* dsm_status = NULL; + + dsm_status = reinterpret_cast( + (uint8_t*)(host_exe_->get_dsm())); + if (!dsm_status) + return 0; + if (dsm_status->penalty_start > 0) + return dsm_status->penalty_start; + else + return 0; + } + int get_mtime(const char* file_name, struct timespec* mtime) { struct stat s;