clean up
This commit is contained in:
parent
5460ef87b7
commit
5d5c7f1584
|
@ -27,8 +27,9 @@ tsc(void)
|
|||
return ((uint64_t)high << 32) | low;
|
||||
}
|
||||
|
||||
static
|
||||
uint64_t get_tsc_frequency() {
|
||||
static uint64_t
|
||||
get_tsc_frequency()
|
||||
{
|
||||
uint32_t high, low;
|
||||
__asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
|
||||
__asm__ volatile("rdtsc");
|
||||
|
@ -36,7 +37,8 @@ uint64_t get_tsc_frequency() {
|
|||
}
|
||||
|
||||
double
|
||||
tsc_ticks_to_ns(uint64_t tsc_ticks) {
|
||||
tsc_ticks_to_ns(uint64_t tsc_ticks)
|
||||
{
|
||||
static uint64_t tsc_freq = 0;
|
||||
if (tsc_freq == 0) {
|
||||
tsc_freq = get_tsc_frequency();
|
||||
|
|
|
@ -696,8 +696,8 @@ test_perf_span_solo(const MunitParameter params[], void *data)
|
|||
}
|
||||
}
|
||||
uint64_t est = EST_MEDIAN_GET(solo);
|
||||
fprintf(stdout, "median time %zu or %f ns\n", est, tsc_ticks_to_ns(est)); // measured 228
|
||||
assert_true(EST_MEDIAN_GET(solo) < 500);
|
||||
// fprintf(stdout, "median time %zu or %f ns\n", est, tsc_ticks_to_ns(est)); // measured 228
|
||||
assert_true(est < 500);
|
||||
fflush(stdout);
|
||||
|
||||
return MUNIT_OK;
|
||||
|
@ -751,7 +751,8 @@ test_perf_span_tainted(const MunitParameter params[], void *data)
|
|||
}
|
||||
}
|
||||
uint64_t est = EST_MEDIAN_GET(tainted);
|
||||
fprintf(stdout, "median time %zu or %f ns\n", est, tsc_ticks_to_ns(est)); // measured 228
|
||||
// fprintf(stdout, "median time %zu or %f ns\n", est, tsc_ticks_to_ns(est)); // measured 228
|
||||
assert_true(est < 500);
|
||||
|
||||
return MUNIT_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue