Re: [PATCH 1/2] drm/amdgpu: Add support for logging process info in amdgpu_vm.
Am 04.07.2018 um 16:22 schrieb Andrey Grodzovsky: On 07/04/2018 10:17 AM, Christian König wrote: Am 04.07.2018 um 16:10 schrieb Andrey Grodzovsky: Add process and thread names and pids and a function to extract this info from relevant amdgpu_vm. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 14 ++ 2 files changed, 28 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 8370660..8ec459e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2942,3 +2942,17 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) return 0; } + Please add some sphinx documentation here. +void amdgpu_vm_task_info(struct amdgpu_device *adev, + unsigned int pasid, struct amdgpu_task_info *task_info) What editor/settings do you use? When I trow those lines into vim's auto-formater it comes up with the following: void amdgpu_vm_task_info(struct amdgpu_device *adev, unsigned int pasid, struct amdgpu_task_info *task_info) I am using eclipse with CDT, I am not very into configuring the editor settings so not sure. How can I use vim to vim autoformat to fix these indentation issues ? Do i need to install some extra plug-in and configure it for kernel style indentation ? I'm using vim with linuxsty.vim. It's not much of an issue anyway. I just want to avoid that one editor automatically changes code into one style while another one changes it automatically into another style. Well, you probably know what I mean :) Christian. Andrey Not an issue at all, but I would like to know where that comes from cause it is a repeating pattern from multiple people. Apart from that whole set looks like a nice addition to me, Christian. +{ + struct amdgpu_vm *vm; + + spin_lock(>vm_manager.pasid_lock); + + vm = idr_find(>vm_manager.pasid_idr, pasid); + if (vm) + *task_info = vm->task_info; + + spin_unlock(>vm_manager.pasid_lock); +} diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 061b99a..88a1d18 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h @@ -164,6 +164,14 @@ struct amdgpu_vm_pt { #define AMDGPU_VM_FAULT_PASID(fault) ((u64)(fault) >> 48) #define AMDGPU_VM_FAULT_ADDR(fault) ((u64)(fault) & 0xf000ULL) + +struct amdgpu_task_info { + char process_name[TASK_COMM_LEN]; + char task_name[TASK_COMM_LEN]; + pid_t pid; + pid_t tgid; +}; + struct amdgpu_vm { /* tree of virtual addresses mapped */ struct rb_root_cached va; @@ -215,6 +223,9 @@ struct amdgpu_vm { /* Valid while the PD is reserved or fenced */ uint64_t pd_phys_addr; + + /* Some basic info about the task */ + struct amdgpu_task_info task_info; }; struct amdgpu_vm_manager { @@ -317,4 +328,7 @@ bool amdgpu_vm_need_pipeline_sync(struct amdgpu_ring *ring, struct amdgpu_job *job); void amdgpu_vm_check_compute_bug(struct amdgpu_device *adev); +void amdgpu_vm_task_info(struct amdgpu_device *adev, + unsigned int pasid, struct amdgpu_task_info *task_info); + #endif ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm/amdgpu: Add support for logging process info in amdgpu_vm.
On 07/04/2018 10:17 AM, Christian König wrote: Am 04.07.2018 um 16:10 schrieb Andrey Grodzovsky: Add process and thread names and pids and a function to extract this info from relevant amdgpu_vm. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 14 ++ 2 files changed, 28 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 8370660..8ec459e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2942,3 +2942,17 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) return 0; } + Please add some sphinx documentation here. +void amdgpu_vm_task_info(struct amdgpu_device *adev, + unsigned int pasid, struct amdgpu_task_info *task_info) What editor/settings do you use? When I trow those lines into vim's auto-formater it comes up with the following: void amdgpu_vm_task_info(struct amdgpu_device *adev, unsigned int pasid, struct amdgpu_task_info *task_info) I am using eclipse with CDT, I am not very into configuring the editor settings so not sure. How can I use vim to vim autoformat to fix these indentation issues ? Do i need to install some extra plug-in and configure it for kernel style indentation ? Andrey Not an issue at all, but I would like to know where that comes from cause it is a repeating pattern from multiple people. Apart from that whole set looks like a nice addition to me, Christian. +{ + struct amdgpu_vm *vm; + + spin_lock(>vm_manager.pasid_lock); + + vm = idr_find(>vm_manager.pasid_idr, pasid); + if (vm) + *task_info = vm->task_info; + + spin_unlock(>vm_manager.pasid_lock); +} diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 061b99a..88a1d18 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h @@ -164,6 +164,14 @@ struct amdgpu_vm_pt { #define AMDGPU_VM_FAULT_PASID(fault) ((u64)(fault) >> 48) #define AMDGPU_VM_FAULT_ADDR(fault) ((u64)(fault) & 0xf000ULL) + +struct amdgpu_task_info { + char process_name[TASK_COMM_LEN]; + char task_name[TASK_COMM_LEN]; + pid_t pid; + pid_t tgid; +}; + struct amdgpu_vm { /* tree of virtual addresses mapped */ struct rb_root_cached va; @@ -215,6 +223,9 @@ struct amdgpu_vm { /* Valid while the PD is reserved or fenced */ uint64_t pd_phys_addr; + + /* Some basic info about the task */ + struct amdgpu_task_info task_info; }; struct amdgpu_vm_manager { @@ -317,4 +328,7 @@ bool amdgpu_vm_need_pipeline_sync(struct amdgpu_ring *ring, struct amdgpu_job *job); void amdgpu_vm_check_compute_bug(struct amdgpu_device *adev); +void amdgpu_vm_task_info(struct amdgpu_device *adev, + unsigned int pasid, struct amdgpu_task_info *task_info); + #endif ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/2] drm/amdgpu: Add support for logging process info in amdgpu_vm.
Am 04.07.2018 um 16:10 schrieb Andrey Grodzovsky: Add process and thread names and pids and a function to extract this info from relevant amdgpu_vm. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 14 ++ 2 files changed, 28 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 8370660..8ec459e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2942,3 +2942,17 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) return 0; } + Please add some sphinx documentation here. +void amdgpu_vm_task_info(struct amdgpu_device *adev, + unsigned int pasid, struct amdgpu_task_info *task_info) What editor/settings do you use? When I trow those lines into vim's auto-formater it comes up with the following: void amdgpu_vm_task_info(struct amdgpu_device *adev, unsigned int pasid, struct amdgpu_task_info *task_info) Not an issue at all, but I would like to know where that comes from cause it is a repeating pattern from multiple people. Apart from that whole set looks like a nice addition to me, Christian. +{ + struct amdgpu_vm *vm; + + spin_lock(>vm_manager.pasid_lock); + + vm = idr_find(>vm_manager.pasid_idr, pasid); + if (vm) + *task_info = vm->task_info; + + spin_unlock(>vm_manager.pasid_lock); +} diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 061b99a..88a1d18 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h @@ -164,6 +164,14 @@ struct amdgpu_vm_pt { #define AMDGPU_VM_FAULT_PASID(fault) ((u64)(fault) >> 48) #define AMDGPU_VM_FAULT_ADDR(fault) ((u64)(fault) & 0xf000ULL) + +struct amdgpu_task_info { + charprocess_name[TASK_COMM_LEN]; + chartask_name[TASK_COMM_LEN]; + pid_t pid; + pid_t tgid; +}; + struct amdgpu_vm { /* tree of virtual addresses mapped */ struct rb_root_cached va; @@ -215,6 +223,9 @@ struct amdgpu_vm { /* Valid while the PD is reserved or fenced */ uint64_tpd_phys_addr; + + /* Some basic info about the task */ + struct amdgpu_task_info task_info; }; struct amdgpu_vm_manager { @@ -317,4 +328,7 @@ bool amdgpu_vm_need_pipeline_sync(struct amdgpu_ring *ring, struct amdgpu_job *job); void amdgpu_vm_check_compute_bug(struct amdgpu_device *adev); +void amdgpu_vm_task_info(struct amdgpu_device *adev, + unsigned int pasid, struct amdgpu_task_info *task_info); + #endif ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx