]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/gvt: refine trace_render_mmio
authorWeinan Li <weinan.z.li@intel.com>
Wed, 13 Dec 2017 02:46:59 +0000 (10:46 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 18 Dec 2017 08:30:03 +0000 (16:30 +0800)
Refine trace_render_mmio to show the vm id before and after vgpu switch,
tag host id as '0', this patch will be used in the future patch for refine
mocs switch policy.

Signed-off-by: Weinan Li <weinan.z.li@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/mmio_context.c
drivers/gpu/drm/i915/gvt/trace.h

index 8a52b56f0e8601d886364c62f5aa66371ba41eb3..77d3a0d43d7cad1dfd3e3bb3864ffabae1903a7c 100644 (file)
@@ -304,7 +304,7 @@ static void switch_mmio_to_vgpu(struct intel_vgpu *vgpu, int ring_id)
 
                I915_WRITE_FW(mmio->reg, v);
 
-               trace_render_mmio(vgpu->id, "load",
+               trace_render_mmio(0, vgpu->id, "switch",
                                  i915_mmio_reg_offset(mmio->reg),
                                  mmio->value, v);
        }
@@ -340,7 +340,7 @@ static void switch_mmio_to_host(struct intel_vgpu *vgpu, int ring_id)
 
                I915_WRITE_FW(mmio->reg, v);
 
-               trace_render_mmio(vgpu->id, "restore",
+               trace_render_mmio(vgpu->id, 0, "switch",
                                  i915_mmio_reg_offset(mmio->reg),
                                  mmio->value, v);
        }
index 8c150381d9a4ef9f9c014305ead6f000aed963f1..7a2511538f340f5d5f6f7a06519bbc844e6fc4b1 100644 (file)
@@ -330,13 +330,14 @@ TRACE_EVENT(inject_msi,
 );
 
 TRACE_EVENT(render_mmio,
-       TP_PROTO(int id, char *action, unsigned int reg,
+       TP_PROTO(int old_id, int new_id, char *action, unsigned int reg,
                 unsigned int old_val, unsigned int new_val),
 
-       TP_ARGS(id, action, reg, new_val, old_val),
+       TP_ARGS(old_id, new_id, action, reg, new_val, old_val),
 
        TP_STRUCT__entry(
-               __field(int, id)
+               __field(int, old_id)
+               __field(int, new_id)
                __array(char, buf, GVT_TEMP_STR_LEN)
                __field(unsigned int, reg)
                __field(unsigned int, old_val)
@@ -344,15 +345,17 @@ TRACE_EVENT(render_mmio,
        ),
 
        TP_fast_assign(
-               __entry->id = id;
+               __entry->old_id = old_id;
+               __entry->new_id = new_id;
                snprintf(__entry->buf, GVT_TEMP_STR_LEN, "%s", action);
                __entry->reg = reg;
                __entry->old_val = old_val;
                __entry->new_val = new_val;
        ),
 
-       TP_printk("VM%u %s reg %x, old %08x new %08x\n",
-                 __entry->id, __entry->buf, __entry->reg,
+       TP_printk("VM%u -> VM%u %s reg %x, old %08x new %08x\n",
+                 __entry->old_id, __entry->new_id,
+                 __entry->buf, __entry->reg,
                  __entry->old_val, __entry->new_val)
 );