From 1c40d09c4c9c011c1318c328c0b4b6b17d1f537e Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Wed, 19 Aug 2015 14:27:51 -0700 Subject: gpu: nvgpu: Add support for FECS ctxsw tracing bug 1648908 This commit adds support for FECS ctxsw tracing. Code is compiled conditionnaly under CONFIG_GK20_CTXSW_TRACE. This feature requires an updated FECS ucode that writes one record to a ring buffer on each context switch. On RM/Kernel side, the GPU driver reads records from the master ring buffer and generates trace entries into a user-facing VM ring buffer. For each record in the master ring buffer, RM/Kernel has to retrieve the vmid+pid of the user process that submitted related work. Features currently implemented: - master ring buffer allocation - debugfs to dump master ring buffer - FECS record per context switch (with both current and new contexts) - dedicated device for ctxsw tracing (access to VM ring buffer) - SOF generation (and access to PTIMER) - VM ring buffer allocation, and reconfiguration - enable/disable tracing at user level - event-based trace filtering - context_ptr to vmid+pid mapping - read system call for ctxsw dev - mmap system call for ctxsw dev (direct access to VM ring buffer) - poll system call for ctxsw dev - save/restore register on ELPG/CG6 - separate user ring from FECS ring handling Features requiring ucode changes: - enable/disable tracing at FECS level - actual busy time on engine (bug 1642354) - master ring buffer threshold interrupt (P1) - API for GPU to CPU timestamp conversion (P1) - vmid/pid/uid based filtering (P1) Change-Id: I8e39c648221ee0fa09d5df8524b03dca83fe24f3 Signed-off-by: Thomas Fleury Reviewed-on: http://git-master/r/1022737 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- include/trace/events/gk20a.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/trace/events') diff --git a/include/trace/events/gk20a.h b/include/trace/events/gk20a.h index 461ff6e8..23b5b642 100644 --- a/include/trace/events/gk20a.h +++ b/include/trace/events/gk20a.h @@ -387,7 +387,7 @@ TRACE_EVENT(gk20a_as_ioctl_get_va_regions, TRACE_EVENT(gk20a_mmu_fault, TP_PROTO(u32 fault_hi, u32 fault_lo, u32 fault_info, - u32 instance, + u64 instance, u32 engine_id, const char *engine, const char *client, @@ -398,7 +398,7 @@ TRACE_EVENT(gk20a_mmu_fault, __field(u32, fault_hi) __field(u32, fault_lo) __field(u32, fault_info) - __field(u32, instance) + __field(u64, instance) __field(u32, engine_id) __field(const char *, engine) __field(const char *, client) @@ -414,7 +414,7 @@ TRACE_EVENT(gk20a_mmu_fault, __entry->client = client; __entry->fault_type = fault_type; ), - TP_printk("fault=0x%x,%08x info=0x%x instance=0x%x engine_id=%d engine=%s client=%s type=%s", + TP_printk("fault=0x%x,%08x info=0x%x instance=0x%llx engine_id=%d engine=%s client=%s type=%s", __entry->fault_hi, __entry->fault_lo, __entry->fault_info, __entry->instance, __entry->engine_id, __entry->engine, __entry->client, __entry->fault_type) -- cgit v1.2.2