@@ -1296,7 +1296,7 @@ static int gen8_alloc_va_range_3lvl(struct i915_address_space *vm,
trace_i915_page_table_entry_map(&ppgtt->base, pde, pt,
gen8_pte_index(start),
gen8_pte_count(start, length),
- GEN8_PTES);
+ bitmap_weight(pt->used_ptes, GEN8_PTES));
/* NB: We haven't yet mapped ptes to pages. At this
* point we're still relying on insert_entries() */
@@ -1875,7 +1875,7 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
trace_i915_page_table_entry_map(vm, pde, pt,
gen6_pte_index(start),
gen6_pte_count(start, length),
- GEN6_PTES);
+ bitmap_weight(pt->used_ptes, GEN6_PTES));
}
/* Make sure write is complete before other code can use this page
@@ -238,22 +238,17 @@ DEFINE_EVENT_PRINT(i915_px_entry, i915_page_directory_pointer_entry_alloc,
__entry->vm, __entry->px, __entry->start, __entry->end)
);
-/* Avoid extra math because we only support two sizes. The format is defined by
- * bitmap_scnprintf. Each 32 bits is 8 HEX digits followed by comma */
-#define TRACE_PT_SIZE(bits) \
- ((((bits) == 1024) ? 288 : 144) + 1)
-
DECLARE_EVENT_CLASS(i915_page_table_entry_update,
TP_PROTO(struct i915_address_space *vm, u32 pde,
- struct i915_page_table *pt, u32 first, u32 count, u32 bits),
- TP_ARGS(vm, pde, pt, first, count, bits),
+ struct i915_page_table *pt, u32 first, u32 count, u32 num),
+ TP_ARGS(vm, pde, pt, first, count, num),
TP_STRUCT__entry(
__field(struct i915_address_space *, vm)
__field(u32, pde)
__field(u32, first)
__field(u32, last)
- __dynamic_array(char, cur_ptes, TRACE_PT_SIZE(bits))
+ __field(u32, num)
),
TP_fast_assign(
@@ -261,16 +256,12 @@ DECLARE_EVENT_CLASS(i915_page_table_entry_update,
__entry->pde = pde;
__entry->first = first;
__entry->last = first + count - 1;
- scnprintf(__get_str(cur_ptes),
- TRACE_PT_SIZE(bits),
- "%*pb",
- bits,
- pt->used_ptes);
+ __entry->num = num;
),
- TP_printk("vm=%p, pde=%d, updating %u:%u\t%s",
+ TP_printk("vm=%p, pde=%d, updating %u:%u\t%u",
__entry->vm, __entry->pde, __entry->last, __entry->first,
- __get_str(cur_ptes))
+ __entry->num)
);
DEFINE_EVENT(i915_page_table_entry_update, i915_page_table_entry_map,
There's no fast way to provide the info on which entries are present for this tracepoint once bitmaps dissapear. Let's just pass the counter instead. Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Michel Thierry <michel.thierry@intel.com> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> --- drivers/gpu/drm/i915/i915_gem_gtt.c | 4 ++-- drivers/gpu/drm/i915/i915_trace.h | 21 ++++++--------------- 2 files changed, 8 insertions(+), 17 deletions(-)