[PATCH 2/2] makedumpfile: make the incomplete vmcore generated by ENOSPC error analyzable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> >
> > For compressed kdumps, the disk_dump_header.status field currently uses these
> > three bits:
> >
> >   #define DUMP_DH_COMPRESSED_ZLIB    0x1   /* page is compressed with zlib */
> >   #define DUMP_DH_COMPRESSED_LZO     0x2   /* page is compressed with lzo */
> >   #define DUMP_DH_COMPRESSED_SNAPPY  0x4   /* page is compressed with snappy */
> >
> > Can you please simply add a DUMP_DH_COMPRESSED_INCOMPLETE flag?
> 
> OK, I'll add this flag.
> 
> >
> > With respect to ELF vmcores, the processor-specific e_flags field is unused by the
> > crash utility, and it appears that makedumpfile always sets it to zero.  But
> > I'm not sure what the kernel does when /proc/vmcore is created?  Could there
> > be e_flags bits set there that a direct-copy of /proc/vmcore might contain?
> > That's why I suggested a unique ELF note.
> 
> Add a unique ELF note is OK, and I thought it must need to allocate some diskspace
> first to store this ELF note and its data, for if the dumpfile has been modified,
> it must write a flag in this place to indicate it's an incomplete dumpfile. But
> this may waste a bit of diskspace when the dumpfile is generated with no error.
 
Looking at "kexec/crashdump-elf.c" in the kexec-tools package, it should be safe
to use the e_flags field, because even if /proc/vmcore were copied unmodified
(without makedumpfile), the crash_create_elf32_headers()/crash_create_elf64_headers()
functions would always set it to 0:

       /* Setup ELF Header*/
        elf = (EHDR *) bufp;
        bufp += sizeof(EHDR);
        memcpy(elf->e_ident, ELFMAG, SELFMAG);
        elf->e_ident[EI_CLASS]  = elf_info->class;
        elf->e_ident[EI_DATA]   = elf_info->data;
        elf->e_ident[EI_VERSION]= EV_CURRENT;
        elf->e_ident[EI_OSABI] = ELFOSABI_NONE;
        memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
        elf->e_type     = ET_CORE;
        elf->e_machine  = crash_architecture(elf_info);
        elf->e_version  = EV_CURRENT;
        elf->e_entry    = 0;
        elf->e_phoff    = sizeof(EHDR);
        elf->e_shoff    = 0;
        elf->e_flags    = 0;
        elf->e_ehsize   = sizeof(EHDR);
        elf->e_phentsize= sizeof(PHDR);
        elf->e_phnum    = 0;
        elf->e_shentsize= 0;
        elf->e_shnum    = 0;
        elf->e_shstrndx = 0;

> I thought it will confuse a user when makedumpfile automatically modified the
> dumpfile name, so I'll keep the dumpfile name unchanged and use the above two
> flags in the dumpfile to indicate that it has been modified.

OK good -- thanks!

Dave



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux