Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update CXL Host exerciser latency calculations #3088

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions samples/cxl_host_exerciser/cxl_he_cache_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions samples/cxl_host_exerciser/cxl_he_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<he_cache_dsm_status*>(
(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;
Expand Down