>> > Ok. The point here is to know which task/cpu called panic, rather> > than to get the task_struct. That makes a lot of sense, and is> > cheap to get. Any note on the crashing cpu that is not captured> > by another cpu will give us that information.> >>> That makes sense. Sheer presence of a particular note can identify the> crashing cpu and no need to store "current". Only crashing cpu is going> to store that note and that too after respective NT_PRSTATUS.>> > My primary concern is while the concept of a task_struct is pretty> > stable who is to know how the kernel will change in the future. So> > if we don't need to export a task_struct pointer and merely need> > to flag the cpu that called panic we can do that much more reliably.

Just flagging the cpu, and then mapping that to the stack pointer found inthe associated NT_PRSTATUS register set should work OK too. It getsa little muddy if it crashed while running on an IRQ stack, but it still can betracked back from there as well. (although not if the crashing task overflowedthe IRQ stack)

The task_struct would be ideal though -- if the kernel's use of task_structschanges in the future, well, then crash is going to need a serious re-writeanyway... FWIW, netdump and diskdump use the NT_TASKSTRUCT notenote to store just the "current" pointer, and not the whole task_struct itself,which would just be a waste of space in the ELF header for crash's purposes.And looking at the gdb sources, it appears to be totally ignored. Whouses the NT_TASKSTRUCT note anyway?

>> > We do need a way that we can test to see if a core dump> > actually matches the vmlinux we are looking at. Probably> > this is capturing all of the information captured by linux/version.h> > and linux/compile.h both at runtime and at compile time and> > checking to see if they match.> >>> I quickly browsed through "crash" code and looks like it is already doing> similiar check (kernel.c, verify_version()). It seems to be retrieving> "linux_banner" from core image and also retrieving banner string from vmlinux> and trying to match. So if banner information can be directly read from the> core image, probably there is no need to export it through notes.>