gpu: pvr: reinstate dumping EDM trace to syslog
authorImre Deak <imre.deak@nokia.com>
Tue, 22 Mar 2011 14:57:04 +0000 (16:57 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:04 +0000 (21:43 +0300)
Since at the moment we don't have any other means to get the EDM trace
for core-matic reports, dump the trace to syslog, which will be picked
up by the core-matic report generating tool.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/Makefile
pvr/pvr_debugfs.c
pvr/pvr_debugfs.h
pvr/sgxinit.c

index 69534d6..0e5bd28 100644 (file)
@@ -10,10 +10,10 @@ pvrsrvkm-objs               := osfunc.o mmap.o module.o proc.o         \
                           sgxinit.o sgxreset.o sgxutils.o sgxkick.o       \
                           sgxtransfer.o mmu.o pb.o perproc.o sysconfig.o  \
                           sysutils.o osperproc.o bridged_support.o        \
-                          bridged_sgx_bridge.o sgxpower.o pvr_events.o
+                          bridged_sgx_bridge.o sgxpower.o pvr_events.o    \
+                          pvr_debugfs.o
 
 pvrsrvkm-objs-$(CONFIG_PVR_DEBUG) += pvr_debug.o
-pvrsrvkm-objs-$(CONFIG_DEBUG_FS) += pvr_debugfs.o
 pvrsrvkm-objs-$(CONFIG_PVR_TIMING) += pvr_debug.o
 pvrsrvkm-objs-$(CONFIG_PVR_DEBUG_PDUMP) += pvr_pdump.o pvr_pdumpfs.o
 
index ed2c795..9d4fc4c 100644 (file)
@@ -124,7 +124,7 @@ struct edm_buf_info {
        char data[1];
 };
 
-static size_t
+size_t
 edm_trace_print(struct PVRSRV_SGXDEV_INFO *sdev, char *dst, size_t dst_len)
 {
        u32 *buf_start;
@@ -139,8 +139,12 @@ edm_trace_print(struct PVRSRV_SGXDEV_INFO *sdev, char *dst, size_t dst_len)
 
        buf = sdev->psKernelEDMStatusBufferMemInfo->pvLinAddrKM;
 
-       p += scnprintf(dst + p, dst_len - p,
-                     "Last SGX microkernel status code: 0x%x\n", *buf);
+       if (dst)
+               p += scnprintf(dst + p, dst_len - p,
+                             "Last SGX microkernel status code: 0x%x\n", *buf);
+       else
+               printk(KERN_DEBUG "Last SGX microkernel status code: 0x%x\n",
+                               *buf);
        buf++;
        wr_ofs = *buf;
        buf++;
@@ -152,9 +156,13 @@ edm_trace_print(struct PVRSRV_SGXDEV_INFO *sdev, char *dst, size_t dst_len)
 
        /* Dump the status values */
        for (i = 0; i < SGXMK_TRACE_BUFFER_SIZE; i++) {
-               p += scnprintf(dst + p, dst_len - p,
-                             "%3d %08X %08X %08X %08X\n",
-                             i, buf[2], buf[3], buf[1], buf[0]);
+               if (dst)
+                       p += scnprintf(dst + p, dst_len - p,
+                                     "%3d %08X %08X %08X %08X\n",
+                                     i, buf[2], buf[3], buf[1], buf[0]);
+               else
+                       printk(KERN_DEBUG "%3d %08X %08X %08X %08X\n",
+                                     i, buf[2], buf[3], buf[1], buf[0]);
                buf += 4;
                if (buf >= buf_end)
                        buf = buf_start;
index 32aa38b..c60f3e8 100644 (file)
 #ifndef _PVR_DEBUGFS_H_
 #define _PVR_DEBUGFS_H_ 1
 
-#ifndef CONFIG_DEBUG_FS
-#error Error: debugfs header included but CONFIG_DEBUG_FS is not defined!
-#endif
-
 extern struct dentry *pvr_debugfs_dir;
 
 int pvr_debugfs_init(void);
@@ -32,6 +28,9 @@ void pvr_debugfs_cleanup(void);
 void pvr_hwrec_dump(struct PVRSRV_PER_PROCESS_DATA *proc_data,
                    struct PVRSRV_SGXDEV_INFO *psDevInfo);
 
+size_t edm_trace_print(struct PVRSRV_SGXDEV_INFO *sdev, char *dst,
+                      size_t dst_len);
+
 #ifdef CONFIG_PVR_DEBUG
 /* to be used for memory dumping from mmu.c */
 int hwrec_mem_write(u8 *buffer, size_t size);
index 210c66d..6170038 100644 (file)
@@ -697,6 +697,9 @@ HWRecoveryResetSGX(struct PVRSRV_DEVICE_NODE *psDeviceNode, const char *caller)
 
        pr_err_process_info(proc);
        pr_err_sgx_registers(psDevInfo);
+#ifdef PVRSRV_USSE_EDM_STATUS_DEBUG
+       edm_trace_print(psDevInfo, NULL, 0);
+#endif
 
 #ifdef CONFIG_DEBUG_FS
        pvr_hwrec_dump(proc, psDevInfo);