Compressed Dump
Compressed Dump White Paper, Version 1.3
page 22
libcrash(5) libcrash(5)
NAME
libcrash - crash dump access library
SYNOPSIS
#include <libcrash.h>
int cr_open(const char *path, CRASH **cb, int flags);
int cr_verify(CRASH *crash_cb, int flags);
cr_info_t *cr_info(CRASH *crash_cb);
int cr_uncompress(CRASH *crash_cb, const char *pathname, uint64_t size,
int flags);
int cr_isaddr(CRASH *crash_cb, uint64_t pagenum, int *avail);
int cr_read(CRASH *crash_cb, void *buf, uint64_t mem_page,int
*num_pages);
int cr_set_node(CRASH *crash_cb, int node_num, int *old_node_num);
void cr_perror(CRASH *crash_cb, int error);
int cr_close(CRASH *crash_cb);
DESCRIPTION
libcrash is a library which provides access to system crash dumps. Access to a
dump through the library is independent of the format of the crash dump (there are
several, described below). It is also independent of the location of the dump, which
could be on a raw dump device, in files in a file system, or a mixture of the two. The
memory of a running system can also be treated as a “dump” through use of the /
dev/mem driver.
All accesses to a dump through the library begin with a call to cr_open(). The crash
dump descriptor returned from this call is a necessary parameter to all of the other
libcrash calls. They are:
cr_verify() Verifies the integrity of a dump by checking the
sizes and checksums of all of the files making up
the dump.
cr_info() Returns a pointer to a structure containing infor-
mation about the dump and the machine and ker-
nel that produced it.
cr_uncompress() Prepares a file in the crash dump for use, by
uncompressing it (if needed) and validating its
size and checksum. This function is used inter-
nally by the library for access to the physical
memory image, and can be used by callers for
access to the kernel and kernel module files.
cr_isaddr() Gives information about whether a particular phys-
ical memory page was valid on the machine that
dumped, and if so, whether or not that page’s con-
tents were included in the dump.