[PATCH v2 06/15] drm/i915/gvt: Add verbose gtt shadow logs

Zhenyu Wang zhenyuw at linux.intel.com
Wed Jan 3 07:34:26 UTC 2018


On 2018.01.02 16:29:37 +0800, changbin.du at intel.com wrote:
> From: Changbin Du <changbin.du at intel.com>
> 
> This add a new macro gvt_vdbg_mm() to print more verbose logs for
> gtt shadowing. The added verbose logs are very useful for debugging.
> gvt_vdbg_mm() only comes into effect if VERBOSE_DEBUG is defined by
> the developer.
>

I'd like to stick with one debug message setting method to use dynamic debug.

> Signed-off-by: Changbin Du <changbin.du at intel.com>
> Reviewed-by: Zhi Wang <zhi.a.wang at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/gtt.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
> index 0a65219..d216b82 100644
> --- a/drivers/gpu/drm/i915/gvt/gtt.c
> +++ b/drivers/gpu/drm/i915/gvt/gtt.c
> @@ -38,6 +38,12 @@
>  #include "i915_pvinfo.h"
>  #include "trace.h"
>  
> +#if defined(VERBOSE_DEBUG)
> +#define gvt_vdbg_mm(fmt, args...) gvt_dbg_mm(fmt, ##args)
> +#else
> +#define gvt_vdbg_mm(fmt, args...)
> +#endif
> +
>  static bool enable_out_of_sync = false;
>  static int preallocated_oos_pages = 8192;
>  
> @@ -582,6 +588,9 @@ static inline int ppgtt_spt_get_entry(
>  		return ret;
>  
>  	ops->test_pse(e);
> +
> +	gvt_vdbg_mm("read ppgtt entry, spt type %d, entry type %d, index %lu, value %llx\n",
> +		    type, e->type, index, e->val64);
>  	return 0;
>  }
>  
> @@ -597,6 +606,9 @@ static inline int ppgtt_spt_set_entry(
>  	if (WARN(!gtt_type_is_entry(e->type), "invalid entry type\n"))
>  		return -EINVAL;
>  
> +	gvt_vdbg_mm("set ppgtt entry, spt type %d, entry type %d, index %lu, value %llx\n",
> +		    type, e->type, index, e->val64);
> +
>  	return ops->set_entry(page_table, e, index, guest,
>  			spt->guest_page.track.gfn << I915_GTT_PAGE_SHIFT,
>  			spt->vgpu);
> @@ -1106,6 +1118,9 @@ static int ppgtt_handle_guest_entry_removal(struct intel_vgpu_guest_page *gpt,
>  	trace_gpt_change(spt->vgpu->id, "remove", spt, sp->type, se->val64,
>  			 index);
>  
> +	gvt_vdbg_mm("destroy old shadow entry, type %d, index %lu, value %llx\n",
> +		    se->type, index, se->val64);
> +
>  	if (!ops->test_present(se))
>  		return 0;
>  
> @@ -1144,6 +1159,9 @@ static int ppgtt_handle_guest_entry_add(struct intel_vgpu_guest_page *gpt,
>  	trace_gpt_change(spt->vgpu->id, "add", spt, sp->type,
>  		we->val64, index);
>  
> +	gvt_vdbg_mm("add shadow entry: type %d, index %lu, value %llx\n",
> +		    we->type, index, we->val64);
> +
>  	if (gtt_type_is_pt(get_next_pt_type(we->type))) {
>  		s = ppgtt_populate_shadow_page_by_guest_entry(vgpu, we);
>  		if (IS_ERR(s)) {
> -- 
> 2.7.4
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20180103/14616e63/attachment.sig>


More information about the intel-gvt-dev mailing list