[CRIU] [PATCH 3/4] arch: x86 -- Add dumping of vDSO layout
Cyrill Gorcunov
gorcunov at openvz.org
Wed Apr 17 09:26:56 EDT 2013
On Wed, Apr 17, 2013 at 05:00:05PM +0400, Pavel Emelyanov wrote:
>
> > +int arch_fill_self_vdso(symtable_t *t)
> > +{
> > + char buf[512];
> > + int ret = -1;
> > + FILE *maps;
> > +
> > + maps = fopen("/proc/self/maps", "r");
>
> We do maps parsing already. Just utilize root task's vdso info for that.
> All the more so different tasks may have different VDSOs in the future
> (32-bit support).
The problem is that I use this parser in converter as well where I can't
do crtool's parsing. Thus for portability reason I need some "general" code.
Our "smaps" parsing is a way too heavy and does a much more things than
"find out vDSO vma area".
>
> > + for (i = 0; ret == 0 && i < VDSO_SYMBOL_MAX; i++) {
>
> Plz use explicit if (ret) break; below
Sure
>
> > + symbol.name = t.sym[i].name;
> > + symbol.offset = t.sym[i].offset;
> > + ret = pb_write_one(fd, &symbol, PB_VDSO);
> > + }
>
> > --- /dev/null
> > +++ b/include/vdso.h
>
> Not all code below is used in non-arch code. Plz revisit.
>
> > +#if CONFIG_X86_64
>
> Not nice.
>
OK, I'll try to rearrange it.
Cyrill
More information about the CRIU
mailing list