mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: add nvgpu_current_time_ns()
Add an abstraction over a monotonic system clock in nanosecond units. Use ktime_get() for the Linux implementation, similarly to nvgpu_current_time_ms(). Jira NVGPU-708 Change-Id: I3165c20abf2652f1a1fa04e66c04cd34a8fe6dcc Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1723201 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b65197c26d
commit
a4d1a4830e
@@ -242,6 +242,18 @@ s64 nvgpu_current_time_ms(void)
|
|||||||
return ktime_to_ms(ktime_get());
|
return ktime_to_ms(ktime_get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nvgpu_current_time_ns - Time in nanoseconds from a monotonic clock.
|
||||||
|
*
|
||||||
|
* Return a clock in nanosecond units. The start time of the clock is
|
||||||
|
* unspecified; the time returned can be compared with older ones to measure
|
||||||
|
* durations. The source clock does not jump when the system clock is adjusted.
|
||||||
|
*/
|
||||||
|
s64 nvgpu_current_time_ns(void)
|
||||||
|
{
|
||||||
|
return ktime_to_ns(ktime_get());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nvgpu_hr_timestamp - Opaque 'high resolution' time stamp.
|
* nvgpu_hr_timestamp - Opaque 'high resolution' time stamp.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ void nvgpu_udelay(unsigned int usecs);
|
|||||||
* Timekeeping.
|
* Timekeeping.
|
||||||
*/
|
*/
|
||||||
s64 nvgpu_current_time_ms(void);
|
s64 nvgpu_current_time_ms(void);
|
||||||
|
s64 nvgpu_current_time_ns(void);
|
||||||
u64 nvgpu_hr_timestamp(void);
|
u64 nvgpu_hr_timestamp(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user