@@ -760,7 +760,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
"CPU count: %i\n"
"\n",
odp_version_api_str(), odp_cpu_model_str(),
- odp_sys_cpu_hz(), odp_sys_cache_line_size(),
+ odp_cpu_hz(), odp_sys_cache_line_size(),
odp_cpu_count());
printf("Running ODP appl: \"%s\"\n"
@@ -1063,7 +1063,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
"Cache line size: %i\n"
"CPU count: %i\n"
"\n",
- odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(),
+ odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
odp_sys_cache_line_size(), odp_cpu_count());
printf("Running ODP appl: \"%s\"\n"
@@ -1517,7 +1517,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
"Cache line size: %i\n"
"CPU count: %i\n"
"\n",
- odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(),
+ odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
odp_sys_cache_line_size(), odp_cpu_count());
printf("Running ODP appl: \"%s\"\n"
@@ -650,7 +650,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
"Cache line size: %i\n"
"CPU count: %i\n"
"\n",
- odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(),
+ odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
odp_sys_cache_line_size(), odp_cpu_count());
printf("Running ODP appl: \"%s\"\n"
@@ -350,7 +350,7 @@ int main(int argc, char *argv[])
printf("---------------\n");
printf("ODP API version: %s\n", odp_version_api_str());
printf("CPU model: %s\n", odp_cpu_model_str());
- printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz());
+ printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz());
printf("Cache line size: %i\n", odp_sys_cache_line_size());
printf("Max CPU count: %i\n", odp_cpu_count());
@@ -446,7 +446,7 @@ int main(int argc, char *argv[])
return -1;
}
- printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz());
+ printf("CPU freq %"PRIu64" Hz\n", odp_cpu_hz());
printf("Timer ticks vs nanoseconds:\n");
ns = 0;
tick = odp_timer_ns_to_tick(gbls->tp, ns);
@@ -55,6 +55,15 @@ int odp_cpu_count(void);
const char *odp_cpu_model_str(void);
/**
+ * Current CPU frequency in Hz
+ *
+ * Returns current frequency of this CPU
+ *
+ * @return CPU frequency in Hz
+ */
+uint64_t odp_cpu_hz(void);
+
+/**
* Current CPU cycle count
*
* Return current CPU cycle count. Cycle count may not be reset at ODP init
@@ -24,13 +24,6 @@ extern "C" {
*/
/**
- * CPU frequency in Hz
- *
- * @return CPU frequency in Hz
- */
-uint64_t odp_sys_cpu_hz(void);
-
-/**
* Huge page size in bytes
*
* @return Huge page size in bytes
@@ -27,7 +27,7 @@ uint64_t odp_cpu_cycles(void)
if (ret != 0)
ODP_ABORT("clock_gettime failed\n");
- hz = odp_sys_cpu_hz();
+ hz = odp_cpu_hz();
sec = (uint64_t)time.tv_sec;
ns = (uint64_t)time.tv_nsec;
@@ -374,7 +374,7 @@ int odp_system_info_init(void)
* Public access functions
*************************
*/
-uint64_t odp_sys_cpu_hz(void)
+uint64_t odp_cpu_hz(void)
{
return odp_global_data.system_info.cpu_hz[0];
}
@@ -28,7 +28,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
uint64_t odp_time_cycles_to_ns(uint64_t cycles)
{
- uint64_t hz = odp_sys_cpu_hz();
+ uint64_t hz = odp_cpu_hz();
if (cycles > (UINT64_MAX / GIGA))
return (cycles/hz)*GIGA;
@@ -39,7 +39,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles)
uint64_t odp_time_ns_to_cycles(uint64_t ns)
{
- uint64_t hz = odp_sys_cpu_hz();
+ uint64_t hz = odp_cpu_hz();
if (ns > (UINT64_MAX / hz))
return (ns/GIGA)*hz;
@@ -42,7 +42,7 @@ void odp_print_system_info(void)
printf("---------------\n");
printf("ODP API version: %s\n", odp_version_api_str());
printf("CPU model: %s\n", odp_cpu_model_str());
- printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz());
+ printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz());
printf("Cache line size: %i\n", odp_sys_cache_line_size());
printf("CPU count: %i\n", odp_cpu_count());
printf("CPU mask: %s\n", str);
@@ -338,7 +338,7 @@ void odp_print_system_info(void)
printf("---------------\n");
printf("ODP API version: %s\n", odp_version_api_str());
printf("CPU model: %s\n", odp_cpu_model_str());
- printf("CPU freq (hz): %"PRIu64"\n", odp_sys_cpu_hz());
+ printf("CPU freq (hz): %"PRIu64"\n", odp_cpu_hz());
printf("Cache line size: %i\n", odp_sys_cache_line_size());
printf("CPU count: %i\n", odp_cpu_count());
printf("CPU mask: %s\n", str);
@@ -713,7 +713,7 @@ static void print_info(char *progname, appl_args_t *appl_args)
"Cache line size: %i\n"
"CPU count: %i\n"
"\n",
- odp_version_api_str(), odp_cpu_model_str(), odp_sys_cpu_hz(),
+ odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
odp_sys_cache_line_size(), odp_cpu_count());
printf("Running ODP appl: \"%s\"\n"
@@ -746,14 +746,14 @@ static void test_cpu_freq(void)
nsec -= tp1.tv_nsec - tp2.tv_nsec;
cycles = odp_cpu_cycles_diff(c1, c2);
- max_cycles = (nsec * odp_sys_cpu_hz()) / 1000000000.0;
+ max_cycles = (nsec * odp_cpu_hz()) / 1000000000.0;
/* Compare measured CPU cycles to maximum theoretical CPU cycle count */
diff_max_hz = ((double)(cycles) - max_cycles) / max_cycles;
printf("clock_gettime %" PRIu64 " ns\n", nsec);
printf("odp_cpu_cycles %" PRIu64 " CPU cycles\n", cycles);
- printf("odp_sys_cpu_hz %" PRIu64 " hz\n", odp_sys_cpu_hz());
+ printf("odp_sys_cpu_hz %" PRIu64 " hz\n", odp_cpu_hz());
printf("Diff from max CPU freq %f%%\n", diff_max_hz * 100.0);
printf("\n");
@@ -868,7 +868,7 @@ int main(int argc, char *argv[])
printf("---------------\n");
printf("ODP API version: %s\n", odp_version_api_str());
printf("CPU model: %s\n", odp_cpu_model_str());
- printf("CPU freq (hz): %" PRIu64 "\n", odp_sys_cpu_hz());
+ printf("CPU freq (hz): %" PRIu64 "\n", odp_cpu_hz());
printf("Cache line size: %i\n", odp_sys_cache_line_size());
printf("Max CPU count: %i\n", odp_cpu_count());
@@ -75,11 +75,11 @@ void system_test_odp_sys_huge_page_size(void)
CU_ASSERT(0 < page);
}
-void system_test_odp_sys_cpu_hz(void)
+void system_test_odp_cpu_hz(void)
{
uint64_t hz;
- hz = odp_sys_cpu_hz();
+ hz = odp_cpu_hz();
CU_ASSERT(0 < hz);
}
@@ -90,7 +90,7 @@ CU_TestInfo system_suite[] = {
_CU_TEST_INFO(system_test_odp_cpu_model_str),
_CU_TEST_INFO(system_test_odp_sys_page_size),
_CU_TEST_INFO(system_test_odp_sys_huge_page_size),
- _CU_TEST_INFO(system_test_odp_sys_cpu_hz),
+ _CU_TEST_INFO(system_test_odp_cpu_hz),
CU_TEST_INFO_NULL,
};
@@ -16,7 +16,7 @@ void system_test_odp_sys_cache_line_size(void);
void system_test_odp_cpu_model_str(void);
void system_test_odp_sys_page_size(void);
void system_test_odp_sys_huge_page_size(void);
-void system_test_odp_sys_cpu_hz(void);
+void system_test_odp_cpu_hz(void);
/* test arrays: */
extern CU_TestInfo system_suite[];