[Cbe-oss-dev] [PATCH] spufs: fix broken SPE core dumps

stenzel at de.ibm.com stenzel at de.ibm.com
Wed Mar 26 19:53:08 EST 2008


Attached patch fixes the following problem:

ppu-gdb can't trace spu infomation with coredump generated by Linux kernel.
The current ppu-gdb has been equiped the coredump trace function.
If the coredump is generated by GDB itself, it is working good.
But the one generated by Linux kernel is no good.

The problem is that while the core dumps notes have correct contents, they
have the wrong names.  For example, for an application that opens a SPE
context as fd 3, the current core dump code will generate notes like
  SPU/4/mem
  SPU/4/regs
etc.

This confuses GDB, which knows it is looking for SPE context 3 (from
parsing the spu_context_run system call arguments), and cannot find
any notes that match context 3.


Signed-off-by: Gerhard Stenzel <stenzel at de.ibm.com>
Acked-by: Jeremy Kerr <jk at ozlabs.org>

===================================================================
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 0c6a96b..b962c3a 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -133,8 +133,6 @@ static struct spu_context *coredump_next_context(int *fd)
 		if (ctx->flags & SPU_CREATE_NOSCHED)
 			continue;
 
-		/* start searching the next fd next time we're called */
-		(*fd)++;
 		break;
 	}
 
@@ -157,6 +155,9 @@ int spufs_coredump_extra_notes_size(void)
 			break;
 
 		size += rc;
+
+		/* start searching the next fd next time */
+		fd++;
 	}
 
 	return size;
@@ -239,6 +240,9 @@ int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset)
 		}
 
 		spu_release_saved(ctx);
+
+		/* start searching the next fd next time */
+		fd++;
 	}
 
 	return 0;





More information about the cbe-oss-dev mailing list