[PATCH 1/2] drm/amdgpu: Add support for logging process info in amdgpu_vm.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <andrey.grodzovsky at amd.com>
> ---
>   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(&adev->vm_manager.pasid_lock);
> +
> +	vm = idr_find(&adev->vm_manager.pasid_idr, pasid);
> +	if (vm)
> +		*task_info = vm->task_info;
> +
> +	spin_unlock(&adev->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) & 0xfffffffff000ULL)
>   
> +
> +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



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux