diff options
author | Arul Sekar <aruls@nvidia.com> | 2016-03-11 14:24:20 -0500 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-03-22 13:39:45 -0400 |
commit | 032efd066ec4a8034204b6a34663ab2cac582fbe (patch) | |
tree | 17bacae674a94ec68363d5496f7d9969bdc99e2e /include | |
parent | 97108797a28faaf3c7249345611f68817a99f522 (diff) |
gpu: nvgpu: Provide cpu gpu time correlation via ioctl
bug 1648908
Provides pairs of CPU and GPU timestamps that
can be used for correlatiing the two timebases
- IOCTL made available /dev/nvhost-ctrl-gpu
Change-Id: I1458b9d33d794b1b02ec9fd29ed9426756b94bcd
Signed-off-by: Arul Sekar <aruls@nvidia.com>
Reviewed-on: http://git-master/r/1029732
Reviewed-by: Arun Gona <agona@nvidia.com>
Tested-by: Arun Gona <agona@nvidia.com>
Reviewed-on: http://git-master/r/1111715
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/nvgpu.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 0787d4e4..68c1c4e0 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h | |||
@@ -351,6 +351,28 @@ struct nvgpu_gpu_get_buffer_info_args { | |||
351 | }; | 351 | }; |
352 | }; | 352 | }; |
353 | 353 | ||
354 | #define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_MAX_COUNT 16 | ||
355 | #define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TSC 1 | ||
356 | #define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_JIFFIES 2 | ||
357 | #define NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_SRC_ID_TIMEOFDAY 3 | ||
358 | |||
359 | struct nvgpu_gpu_get_cpu_time_correlation_sample { | ||
360 | /* gpu timestamp value */ | ||
361 | __u64 cpu_timestamp; | ||
362 | /* raw GPU counter (PTIMER) value */ | ||
363 | __u64 gpu_timestamp; | ||
364 | }; | ||
365 | |||
366 | struct nvgpu_gpu_get_cpu_time_correlation_info_args { | ||
367 | /* timestamp pairs */ | ||
368 | struct nvgpu_gpu_get_cpu_time_correlation_sample samples[ | ||
369 | NVGPU_GPU_GET_CPU_TIME_CORRELATION_INFO_MAX_COUNT]; | ||
370 | /* number of pairs to read */ | ||
371 | __u32 count; | ||
372 | /* cpu clock source id */ | ||
373 | __u32 source_id; | ||
374 | }; | ||
375 | |||
354 | #define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \ | 376 | #define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \ |
355 | _IOR(NVGPU_GPU_IOCTL_MAGIC, 1, struct nvgpu_gpu_zcull_get_ctx_size_args) | 377 | _IOR(NVGPU_GPU_IOCTL_MAGIC, 1, struct nvgpu_gpu_zcull_get_ctx_size_args) |
356 | #define NVGPU_GPU_IOCTL_ZCULL_GET_INFO \ | 378 | #define NVGPU_GPU_IOCTL_ZCULL_GET_INFO \ |
@@ -397,11 +419,13 @@ struct nvgpu_gpu_get_buffer_info_args { | |||
397 | _IO(NVGPU_GPU_IOCTL_MAGIC, 22) | 419 | _IO(NVGPU_GPU_IOCTL_MAGIC, 22) |
398 | #define NVGPU_GPU_IOCTL_CLEAR_SM_ERRORS \ | 420 | #define NVGPU_GPU_IOCTL_CLEAR_SM_ERRORS \ |
399 | _IO(NVGPU_GPU_IOCTL_MAGIC, 23) | 421 | _IO(NVGPU_GPU_IOCTL_MAGIC, 23) |
400 | 422 | #define NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO \ | |
423 | _IOWR(NVGPU_GPU_IOCTL_MAGIC, 24, \ | ||
424 | struct nvgpu_gpu_get_cpu_time_correlation_info_args) | ||
401 | #define NVGPU_GPU_IOCTL_LAST \ | 425 | #define NVGPU_GPU_IOCTL_LAST \ |
402 | _IOC_NR(NVGPU_GPU_IOCTL_CLEAR_SM_ERRORS) | 426 | _IOC_NR(NVGPU_GPU_IOCTL_GET_CPU_TIME_CORRELATION_INFO) |
403 | #define NVGPU_GPU_IOCTL_MAX_ARG_SIZE \ | 427 | #define NVGPU_GPU_IOCTL_MAX_ARG_SIZE \ |
404 | sizeof(struct nvgpu_gpu_prepare_compressible_read_args) | 428 | sizeof(struct nvgpu_gpu_get_cpu_time_correlation_info_args) |
405 | 429 | ||
406 | /* | 430 | /* |
407 | * /dev/nvhost-tsg-gpu device | 431 | * /dev/nvhost-tsg-gpu device |