diff mbox

[API-NEXT,v2,3/4] linux-generic: use appropriate time API with tick instead of cycles

Message ID 1438986490-12100-4-git-send-email-ivan.khoronzhuk@linaro.org
State New
Headers show

Commit Message

Ivan Khoronzhuk Aug. 7, 2015, 10:28 p.m. UTC
The time API were changed from *_cycles* to *_tick*, so use
appropriate names.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 platform/linux-generic/arch/linux/odp_time.c  | 2 +-
 platform/linux-generic/arch/mips64/odp_time.c | 2 +-
 platform/linux-generic/arch/x86/odp_time.c    | 2 +-
 platform/linux-generic/odp_schedule.c         | 8 ++++----
 platform/linux-generic/odp_time.c             | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)

Comments

Stuart Haslam Aug. 19, 2015, 9:50 a.m. UTC | #1
On Sat, Aug 08, 2015 at 01:28:09AM +0300, Ivan Khoronzhuk wrote:
> The time API were changed from *_cycles* to *_tick*, so use
> appropriate names.
> 
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
>  platform/linux-generic/arch/linux/odp_time.c  | 2 +-
>  platform/linux-generic/arch/mips64/odp_time.c | 2 +-
>  platform/linux-generic/arch/x86/odp_time.c    | 2 +-
>  platform/linux-generic/odp_schedule.c         | 8 ++++----
>  platform/linux-generic/odp_time.c             | 6 +++---
>  5 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time.c
> index 4dc0764..bd16a32 100644
> --- a/platform/linux-generic/arch/linux/odp_time.c
> +++ b/platform/linux-generic/arch/linux/odp_time.c
> @@ -16,7 +16,7 @@
>  
>  #define GIGA 1000000000
>  
> -uint64_t odp_time_cycles(void)
> +uint64_t odp_time_tick(void)
>  {
>  	struct timespec time;
>  	uint64_t sec, ns, hz, cycles;

cycles -> tick

> diff --git a/platform/linux-generic/arch/mips64/odp_time.c b/platform/linux-generic/arch/mips64/odp_time.c
> index 4fb790b..2a68aa5 100644
> --- a/platform/linux-generic/arch/mips64/odp_time.c
> +++ b/platform/linux-generic/arch/mips64/odp_time.c
> @@ -8,7 +8,7 @@
>  #include <odp/hints.h>
>  #include <odp/system_info.h>
>  
> -uint64_t odp_time_cycles(void)
> +uint64_t odp_time_tick(void)
>  {
>  	#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
>  	#define CVMX_TMP_STR2(x) #x
> diff --git a/platform/linux-generic/arch/x86/odp_time.c b/platform/linux-generic/arch/x86/odp_time.c
> index a111561..a4f60e1 100644
> --- a/platform/linux-generic/arch/x86/odp_time.c
> +++ b/platform/linux-generic/arch/x86/odp_time.c
> @@ -5,7 +5,7 @@
>   */
>  #include <odp/time.h>
>  
> -uint64_t odp_time_cycles(void)
> +uint64_t odp_time_tick(void)
>  {
>  	union {
>  		uint64_t tsc_64;
> diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
> index 5d32c81..d0cd41e 100644
> --- a/platform/linux-generic/odp_schedule.c
> +++ b/platform/linux-generic/odp_schedule.c
> @@ -528,12 +528,12 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t wait,
>  			break;
>  
>  		if (start_cycle == 0) {
> -			start_cycle = odp_time_cycles();
> +			start_cycle = odp_time_tick();
>  			continue;
>  		}
>  
> -		cycle = odp_time_cycles();
> -		diff  = odp_time_diff_cycles(start_cycle, cycle);
> +		cycle = odp_time_tick();
> +		diff  = odp_time_ticks_diff(start_cycle, cycle);
>  
>  		if (wait < diff)
>  			break;
> @@ -579,7 +579,7 @@ uint64_t odp_schedule_wait_time(uint64_t ns)
>  	if (ns <= ODP_SCHED_NO_WAIT)
>  		ns = ODP_SCHED_NO_WAIT + 1;
>  
> -	return odp_time_ns_to_cycles(ns);
> +	return odp_time_ns_to_tick(ns);
>  }
>  
>  
> diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
> index a08833d..aed3702 100644
> --- a/platform/linux-generic/odp_time.c
> +++ b/platform/linux-generic/odp_time.c
> @@ -12,7 +12,7 @@
>  
>  #define GIGA 1000000000
>  
> -uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
> +uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2)
>  {
>  	if (odp_likely(t2 > t1))
>  		return t2 - t1;
> @@ -20,7 +20,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
>  	return t2 + (UINT64_MAX - t1);
>  }
>  
> -uint64_t odp_time_cycles_to_ns(uint64_t cycles)
> +uint64_t odp_time_tick_to_ns(uint64_t cycles)

parameter name; cycles -> tick

>  {
>  	uint64_t hz = odp_sys_cpu_hz();
>  
> @@ -31,7 +31,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles)
>  }
>  
>  
> -uint64_t odp_time_ns_to_cycles(uint64_t ns)
> +uint64_t odp_time_ns_to_tick(uint64_t ns)
>  {
>  	uint64_t hz = odp_sys_cpu_hz();
>  
> -- 
> 1.9.1
>
Ivan Khoronzhuk Aug. 19, 2015, 11:06 a.m. UTC | #2
Hi, Stuart

On 19.08.15 12:50, Stuart Haslam wrote:
> On Sat, Aug 08, 2015 at 01:28:09AM +0300, Ivan Khoronzhuk wrote:
>> The time API were changed from *_cycles* to *_tick*, so use
>> appropriate names.
>>
>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>> ---
>>   platform/linux-generic/arch/linux/odp_time.c  | 2 +-
>>   platform/linux-generic/arch/mips64/odp_time.c | 2 +-
>>   platform/linux-generic/arch/x86/odp_time.c    | 2 +-
>>   platform/linux-generic/odp_schedule.c         | 8 ++++----
>>   platform/linux-generic/odp_time.c             | 6 +++---
>>   5 files changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time.c
>> index 4dc0764..bd16a32 100644
>> --- a/platform/linux-generic/arch/linux/odp_time.c
>> +++ b/platform/linux-generic/arch/linux/odp_time.c
>> @@ -16,7 +16,7 @@
>>
>>   #define GIGA 1000000000
>>
>> -uint64_t odp_time_cycles(void)
>> +uint64_t odp_time_tick(void)
>>   {
>>   	struct timespec time;
>>   	uint64_t sec, ns, hz, cycles;
>
> cycles -> tick
>

I have leaved cycles here intentionally, as in this
implementation exactly CPU cycles inside of function.
If you don't agree with this, let me know and I will change it.

>> diff --git a/platform/linux-generic/arch/mips64/odp_time.c b/platform/linux-generic/arch/mips64/odp_time.c
>> index 4fb790b..2a68aa5 100644
>> --- a/platform/linux-generic/arch/mips64/odp_time.c
>> +++ b/platform/linux-generic/arch/mips64/odp_time.c
>> @@ -8,7 +8,7 @@
>>   #include <odp/hints.h>
>>   #include <odp/system_info.h>
>>
>> -uint64_t odp_time_cycles(void)
>> +uint64_t odp_time_tick(void)
>>   {
>>   	#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
>>   	#define CVMX_TMP_STR2(x) #x
>> diff --git a/platform/linux-generic/arch/x86/odp_time.c b/platform/linux-generic/arch/x86/odp_time.c
>> index a111561..a4f60e1 100644
>> --- a/platform/linux-generic/arch/x86/odp_time.c
>> +++ b/platform/linux-generic/arch/x86/odp_time.c
>> @@ -5,7 +5,7 @@
>>    */
>>   #include <odp/time.h>
>>
>> -uint64_t odp_time_cycles(void)
>> +uint64_t odp_time_tick(void)
>>   {
>>   	union {
>>   		uint64_t tsc_64;
>> diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
>> index 5d32c81..d0cd41e 100644
>> --- a/platform/linux-generic/odp_schedule.c
>> +++ b/platform/linux-generic/odp_schedule.c
>> @@ -528,12 +528,12 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t wait,
>>   			break;
>>
>>   		if (start_cycle == 0) {
>> -			start_cycle = odp_time_cycles();
>> +			start_cycle = odp_time_tick();
>>   			continue;
>>   		}
>>
>> -		cycle = odp_time_cycles();
>> -		diff  = odp_time_diff_cycles(start_cycle, cycle);
>> +		cycle = odp_time_tick();
>> +		diff  = odp_time_ticks_diff(start_cycle, cycle);
>>
>>   		if (wait < diff)
>>   			break;
>> @@ -579,7 +579,7 @@ uint64_t odp_schedule_wait_time(uint64_t ns)
>>   	if (ns <= ODP_SCHED_NO_WAIT)
>>   		ns = ODP_SCHED_NO_WAIT + 1;
>>
>> -	return odp_time_ns_to_cycles(ns);
>> +	return odp_time_ns_to_tick(ns);
>>   }
>>
>>
>> diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
>> index a08833d..aed3702 100644
>> --- a/platform/linux-generic/odp_time.c
>> +++ b/platform/linux-generic/odp_time.c
>> @@ -12,7 +12,7 @@
>>
>>   #define GIGA 1000000000
>>
>> -uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
>> +uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2)
>>   {
>>   	if (odp_likely(t2 > t1))
>>   		return t2 - t1;
>> @@ -20,7 +20,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
>>   	return t2 + (UINT64_MAX - t1);
>>   }
>>
>> -uint64_t odp_time_cycles_to_ns(uint64_t cycles)
>> +uint64_t odp_time_tick_to_ns(uint64_t cycles)
>
> parameter name; cycles -> tick
>

same here. It was not changed intentionally

>>   {
>>   	uint64_t hz = odp_sys_cpu_hz();
>>
>> @@ -31,7 +31,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles)
>>   }
>>
>>
>> -uint64_t odp_time_ns_to_cycles(uint64_t ns)
>> +uint64_t odp_time_ns_to_tick(uint64_t ns)
>>   {
>>   	uint64_t hz = odp_sys_cpu_hz();
>>
>> --
>> 1.9.1
>>
>
Stuart Haslam Aug. 19, 2015, 11:26 a.m. UTC | #3
On Wed, Aug 19, 2015 at 02:06:34PM +0300, Ivan Khoronzhuk wrote:
> Hi, Stuart
> 
> On 19.08.15 12:50, Stuart Haslam wrote:
> >On Sat, Aug 08, 2015 at 01:28:09AM +0300, Ivan Khoronzhuk wrote:
> >>The time API were changed from *_cycles* to *_tick*, so use
> >>appropriate names.
> >>
> >>Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> >>---
> >>  platform/linux-generic/arch/linux/odp_time.c  | 2 +-
> >>  platform/linux-generic/arch/mips64/odp_time.c | 2 +-
> >>  platform/linux-generic/arch/x86/odp_time.c    | 2 +-
> >>  platform/linux-generic/odp_schedule.c         | 8 ++++----
> >>  platform/linux-generic/odp_time.c             | 6 +++---
> >>  5 files changed, 10 insertions(+), 10 deletions(-)
> >>
> >>diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time.c
> >>index 4dc0764..bd16a32 100644
> >>--- a/platform/linux-generic/arch/linux/odp_time.c
> >>+++ b/platform/linux-generic/arch/linux/odp_time.c
> >>@@ -16,7 +16,7 @@
> >>
> >>  #define GIGA 1000000000
> >>
> >>-uint64_t odp_time_cycles(void)
> >>+uint64_t odp_time_tick(void)
> >>  {
> >>  	struct timespec time;
> >>  	uint64_t sec, ns, hz, cycles;
> >
> >cycles -> tick
> >
> 
> I have leaved cycles here intentionally, as in this
> implementation exactly CPU cycles inside of function.
> If you don't agree with this, let me know and I will change it.
> 

OK I see, it's still doing some conversion to mimic a clock that runs at
the rate of odp_sys_cpu_hz(). I wonder if that should be removed and
just return "(time.tv_sec * 1000000000) + time.tv_nsec"?

> >>diff --git a/platform/linux-generic/arch/mips64/odp_time.c b/platform/linux-generic/arch/mips64/odp_time.c
> >>index 4fb790b..2a68aa5 100644
> >>--- a/platform/linux-generic/arch/mips64/odp_time.c
> >>+++ b/platform/linux-generic/arch/mips64/odp_time.c
> >>@@ -8,7 +8,7 @@
> >>  #include <odp/hints.h>
> >>  #include <odp/system_info.h>
> >>
> >>-uint64_t odp_time_cycles(void)
> >>+uint64_t odp_time_tick(void)
> >>  {
> >>  	#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
> >>  	#define CVMX_TMP_STR2(x) #x
> >>diff --git a/platform/linux-generic/arch/x86/odp_time.c b/platform/linux-generic/arch/x86/odp_time.c
> >>index a111561..a4f60e1 100644
> >>--- a/platform/linux-generic/arch/x86/odp_time.c
> >>+++ b/platform/linux-generic/arch/x86/odp_time.c
> >>@@ -5,7 +5,7 @@
> >>   */
> >>  #include <odp/time.h>
> >>
> >>-uint64_t odp_time_cycles(void)
> >>+uint64_t odp_time_tick(void)
> >>  {
> >>  	union {
> >>  		uint64_t tsc_64;
> >>diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
> >>index 5d32c81..d0cd41e 100644
> >>--- a/platform/linux-generic/odp_schedule.c
> >>+++ b/platform/linux-generic/odp_schedule.c
> >>@@ -528,12 +528,12 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t wait,
> >>  			break;
> >>
> >>  		if (start_cycle == 0) {
> >>-			start_cycle = odp_time_cycles();
> >>+			start_cycle = odp_time_tick();
> >>  			continue;
> >>  		}
> >>
> >>-		cycle = odp_time_cycles();
> >>-		diff  = odp_time_diff_cycles(start_cycle, cycle);
> >>+		cycle = odp_time_tick();
> >>+		diff  = odp_time_ticks_diff(start_cycle, cycle);
> >>
> >>  		if (wait < diff)
> >>  			break;
> >>@@ -579,7 +579,7 @@ uint64_t odp_schedule_wait_time(uint64_t ns)
> >>  	if (ns <= ODP_SCHED_NO_WAIT)
> >>  		ns = ODP_SCHED_NO_WAIT + 1;
> >>
> >>-	return odp_time_ns_to_cycles(ns);
> >>+	return odp_time_ns_to_tick(ns);
> >>  }
> >>
> >>
> >>diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
> >>index a08833d..aed3702 100644
> >>--- a/platform/linux-generic/odp_time.c
> >>+++ b/platform/linux-generic/odp_time.c
> >>@@ -12,7 +12,7 @@
> >>
> >>  #define GIGA 1000000000
> >>
> >>-uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
> >>+uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2)
> >>  {
> >>  	if (odp_likely(t2 > t1))
> >>  		return t2 - t1;
> >>@@ -20,7 +20,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
> >>  	return t2 + (UINT64_MAX - t1);
> >>  }
> >>
> >>-uint64_t odp_time_cycles_to_ns(uint64_t cycles)
> >>+uint64_t odp_time_tick_to_ns(uint64_t cycles)
> >
> >parameter name; cycles -> tick
> >
> 
> same here. It was not changed intentionally
> 
> >>  {
> >>  	uint64_t hz = odp_sys_cpu_hz();
> >>
> >>@@ -31,7 +31,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles)
> >>  }
> >>
> >>
> >>-uint64_t odp_time_ns_to_cycles(uint64_t ns)
> >>+uint64_t odp_time_ns_to_tick(uint64_t ns)
> >>  {
> >>  	uint64_t hz = odp_sys_cpu_hz();
> >>
> >>--
> >>1.9.1
> >>
> >
> 
> -- 
> Regards,
> Ivan Khoronzhuk
Ivan Khoronzhuk Aug. 19, 2015, 12:31 p.m. UTC | #4
On 19.08.15 14:26, Stuart Haslam wrote:
> On Wed, Aug 19, 2015 at 02:06:34PM +0300, Ivan Khoronzhuk wrote:
>> Hi, Stuart
>>
>> On 19.08.15 12:50, Stuart Haslam wrote:
>>> On Sat, Aug 08, 2015 at 01:28:09AM +0300, Ivan Khoronzhuk wrote:
>>>> The time API were changed from *_cycles* to *_tick*, so use
>>>> appropriate names.
>>>>
>>>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>>>> ---
>>>>   platform/linux-generic/arch/linux/odp_time.c  | 2 +-
>>>>   platform/linux-generic/arch/mips64/odp_time.c | 2 +-
>>>>   platform/linux-generic/arch/x86/odp_time.c    | 2 +-
>>>>   platform/linux-generic/odp_schedule.c         | 8 ++++----
>>>>   platform/linux-generic/odp_time.c             | 6 +++---
>>>>   5 files changed, 10 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time.c
>>>> index 4dc0764..bd16a32 100644
>>>> --- a/platform/linux-generic/arch/linux/odp_time.c
>>>> +++ b/platform/linux-generic/arch/linux/odp_time.c
>>>> @@ -16,7 +16,7 @@
>>>>
>>>>   #define GIGA 1000000000
>>>>
>>>> -uint64_t odp_time_cycles(void)
>>>> +uint64_t odp_time_tick(void)
>>>>   {
>>>>   	struct timespec time;
>>>>   	uint64_t sec, ns, hz, cycles;
>>>
>>> cycles -> tick
>>>
>>
>> I have leaved cycles here intentionally, as in this
>> implementation exactly CPU cycles inside of function.
>> If you don't agree with this, let me know and I will change it.
>>
>
> OK I see, it's still doing some conversion to mimic a clock that runs at
> the rate of odp_sys_cpu_hz(). I wonder if that should be removed and
> just return "(time.tv_sec * 1000000000) + time.tv_nsec"?

Nor sure.
Current variant is more clear in what's going on.
If it should be changed it can be done outside of this series.

>
>>>> diff --git a/platform/linux-generic/arch/mips64/odp_time.c b/platform/linux-generic/arch/mips64/odp_time.c
>>>> index 4fb790b..2a68aa5 100644
>>>> --- a/platform/linux-generic/arch/mips64/odp_time.c
>>>> +++ b/platform/linux-generic/arch/mips64/odp_time.c
>>>> @@ -8,7 +8,7 @@
>>>>   #include <odp/hints.h>
>>>>   #include <odp/system_info.h>
>>>>
>>>> -uint64_t odp_time_cycles(void)
>>>> +uint64_t odp_time_tick(void)
>>>>   {
>>>>   	#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
>>>>   	#define CVMX_TMP_STR2(x) #x
>>>> diff --git a/platform/linux-generic/arch/x86/odp_time.c b/platform/linux-generic/arch/x86/odp_time.c
>>>> index a111561..a4f60e1 100644
>>>> --- a/platform/linux-generic/arch/x86/odp_time.c
>>>> +++ b/platform/linux-generic/arch/x86/odp_time.c
>>>> @@ -5,7 +5,7 @@
>>>>    */
>>>>   #include <odp/time.h>
>>>>
>>>> -uint64_t odp_time_cycles(void)
>>>> +uint64_t odp_time_tick(void)
>>>>   {
>>>>   	union {
>>>>   		uint64_t tsc_64;
>>>> diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
>>>> index 5d32c81..d0cd41e 100644
>>>> --- a/platform/linux-generic/odp_schedule.c
>>>> +++ b/platform/linux-generic/odp_schedule.c
>>>> @@ -528,12 +528,12 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t wait,
>>>>   			break;
>>>>
>>>>   		if (start_cycle == 0) {
>>>> -			start_cycle = odp_time_cycles();
>>>> +			start_cycle = odp_time_tick();
>>>>   			continue;
>>>>   		}
>>>>
>>>> -		cycle = odp_time_cycles();
>>>> -		diff  = odp_time_diff_cycles(start_cycle, cycle);
>>>> +		cycle = odp_time_tick();
>>>> +		diff  = odp_time_ticks_diff(start_cycle, cycle);
>>>>
>>>>   		if (wait < diff)
>>>>   			break;
>>>> @@ -579,7 +579,7 @@ uint64_t odp_schedule_wait_time(uint64_t ns)
>>>>   	if (ns <= ODP_SCHED_NO_WAIT)
>>>>   		ns = ODP_SCHED_NO_WAIT + 1;
>>>>
>>>> -	return odp_time_ns_to_cycles(ns);
>>>> +	return odp_time_ns_to_tick(ns);
>>>>   }
>>>>
>>>>
>>>> diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
>>>> index a08833d..aed3702 100644
>>>> --- a/platform/linux-generic/odp_time.c
>>>> +++ b/platform/linux-generic/odp_time.c
>>>> @@ -12,7 +12,7 @@
>>>>
>>>>   #define GIGA 1000000000
>>>>
>>>> -uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
>>>> +uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2)
>>>>   {
>>>>   	if (odp_likely(t2 > t1))
>>>>   		return t2 - t1;
>>>> @@ -20,7 +20,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
>>>>   	return t2 + (UINT64_MAX - t1);
>>>>   }
>>>>
>>>> -uint64_t odp_time_cycles_to_ns(uint64_t cycles)
>>>> +uint64_t odp_time_tick_to_ns(uint64_t cycles)
>>>
>>> parameter name; cycles -> tick
>>>
>>
>> same here. It was not changed intentionally
>>
>>>>   {
>>>>   	uint64_t hz = odp_sys_cpu_hz();
>>>>
>>>> @@ -31,7 +31,7 @@ uint64_t odp_time_cycles_to_ns(uint64_t cycles)
>>>>   }
>>>>
>>>>
>>>> -uint64_t odp_time_ns_to_cycles(uint64_t ns)
>>>> +uint64_t odp_time_ns_to_tick(uint64_t ns)
>>>>   {
>>>>   	uint64_t hz = odp_sys_cpu_hz();
>>>>
>>>> --
>>>> 1.9.1
>>>>
>>>
>>
>> --
>> Regards,
>> Ivan Khoronzhuk
diff mbox

Patch

diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time.c
index 4dc0764..bd16a32 100644
--- a/platform/linux-generic/arch/linux/odp_time.c
+++ b/platform/linux-generic/arch/linux/odp_time.c
@@ -16,7 +16,7 @@ 
 
 #define GIGA 1000000000
 
-uint64_t odp_time_cycles(void)
+uint64_t odp_time_tick(void)
 {
 	struct timespec time;
 	uint64_t sec, ns, hz, cycles;
diff --git a/platform/linux-generic/arch/mips64/odp_time.c b/platform/linux-generic/arch/mips64/odp_time.c
index 4fb790b..2a68aa5 100644
--- a/platform/linux-generic/arch/mips64/odp_time.c
+++ b/platform/linux-generic/arch/mips64/odp_time.c
@@ -8,7 +8,7 @@ 
 #include <odp/hints.h>
 #include <odp/system_info.h>
 
-uint64_t odp_time_cycles(void)
+uint64_t odp_time_tick(void)
 {
 	#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
 	#define CVMX_TMP_STR2(x) #x
diff --git a/platform/linux-generic/arch/x86/odp_time.c b/platform/linux-generic/arch/x86/odp_time.c
index a111561..a4f60e1 100644
--- a/platform/linux-generic/arch/x86/odp_time.c
+++ b/platform/linux-generic/arch/x86/odp_time.c
@@ -5,7 +5,7 @@ 
  */
 #include <odp/time.h>
 
-uint64_t odp_time_cycles(void)
+uint64_t odp_time_tick(void)
 {
 	union {
 		uint64_t tsc_64;
diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
index 5d32c81..d0cd41e 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -528,12 +528,12 @@  static int schedule_loop(odp_queue_t *out_queue, uint64_t wait,
 			break;
 
 		if (start_cycle == 0) {
-			start_cycle = odp_time_cycles();
+			start_cycle = odp_time_tick();
 			continue;
 		}
 
-		cycle = odp_time_cycles();
-		diff  = odp_time_diff_cycles(start_cycle, cycle);
+		cycle = odp_time_tick();
+		diff  = odp_time_ticks_diff(start_cycle, cycle);
 
 		if (wait < diff)
 			break;
@@ -579,7 +579,7 @@  uint64_t odp_schedule_wait_time(uint64_t ns)
 	if (ns <= ODP_SCHED_NO_WAIT)
 		ns = ODP_SCHED_NO_WAIT + 1;
 
-	return odp_time_ns_to_cycles(ns);
+	return odp_time_ns_to_tick(ns);
 }
 
 
diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
index a08833d..aed3702 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -12,7 +12,7 @@ 
 
 #define GIGA 1000000000
 
-uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
+uint64_t odp_time_ticks_diff(uint64_t t1, uint64_t t2)
 {
 	if (odp_likely(t2 > t1))
 		return t2 - t1;
@@ -20,7 +20,7 @@  uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
 	return t2 + (UINT64_MAX - t1);
 }
 
-uint64_t odp_time_cycles_to_ns(uint64_t cycles)
+uint64_t odp_time_tick_to_ns(uint64_t cycles)
 {
 	uint64_t hz = odp_sys_cpu_hz();
 
@@ -31,7 +31,7 @@  uint64_t odp_time_cycles_to_ns(uint64_t cycles)
 }
 
 
-uint64_t odp_time_ns_to_cycles(uint64_t ns)
+uint64_t odp_time_ns_to_tick(uint64_t ns)
 {
 	uint64_t hz = odp_sys_cpu_hz();