Commit 8a71a4a2 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

criu-coredump: merge criu-coredump project

This patch introduces a new subproject called "criu-coredump". The name
is pretty much self-explanatory, it allows generating coredumps from
criu images. Coredumps are readable and usable by gdb. The structure is
something in the middle of kernel-generated and gdb-generated core dumps.

This is a first iteration of core-dump patch series. It introduces
ability to generate gdb-operatable core dump only for x86_64 machines.
To support other architectures there will be a set to introduce proper
structures for notes section of the core dump. It is also worth noting,
that we still leave some notes(SIGINFO primarily) not fullfilled, as
I still need to figure out what to put in there in our case, where no
signal is involved in triggering core dump generation and other
caveats like zeroed vvar(we have problems with it withing CRIU itself
as well as gdb has some difficalties with it) and vsyscall vmas.
One can already use produced core dump with gdb, there is also
a quick simple demo https://asciinema.org/a/18936 .
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b28f93ef
#!/usr/bin/env python
import argparse
import os
import criu_coredump
def coredump(opts):
generator = criu_coredump.coredump_generator()
cores = generator(os.path.realpath(opts['in']))
for pid in cores:
if opts['pid'] and pid != opts['pid']:
continue
with open(os.path.realpath(opts['out'])+"/core."+str(pid), 'w+') as f:
cores[pid].write(f)
def main():
desc = 'CRIU core dump'
parser = argparse.ArgumentParser(description=desc,
formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('-i',
'--in',
default = '.',
help = 'directory where to get images from')
parser.add_argument('-p',
'--pid',
type = int,
help = 'generate coredump for specific pid(all pids py default)')
parser.add_argument('-o',
'--out',
default = '.',
help = 'directory to write coredumps to')
opts = vars(parser.parse_args())
coredump(opts)
if __name__ == '__main__':
main()
from coredump import *
import elf
This diff is collapsed.
This diff is collapsed.
../lib/py/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment