commit b364eca05f579f09d7d8364acad2dd3fd340169d
parent 5b17689d28db4818c7f389f0db97f937654e0ebd
Author: sin <sin@2f30.org>
Date: Mon, 4 Mar 2013 15:46:48 +0000
mdiff: Add `rsize' in mdiff_hdr structure.
This is the total size of the traced region.
Diffstat:
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/mdiffdump.c b/mdiffdump.c
@@ -25,8 +25,9 @@ main(int argc, char *argv[])
printf(" endianness: %s\n",
hdr->endianness ? "big endian" : "little endian");
printf(" version: %hhu\n", hdr->version);
- printf(" blksize: %lu\n", (unsigned long)hdr->blksize);
printf(" nregions: %lu\n", (unsigned long)hdr->nregions);
+ printf(" rsize: %lu\n", (unsigned long)hdr->rsize);
+ printf(" blksize: %lu\n", (unsigned long)hdr->blksize);
printf("\nDiff sections:\n");
for (i = 0; i < hdr->nregions; i++) {
diff --git a/memzap.c b/memzap.c
@@ -134,6 +134,7 @@ main(int argc, char *argv[])
hdr.blksize = BLKSIZE;
hdr.endianness = 0;
hdr.version = 1;
+ hdr.rsize = len;
mdiff_start_diff(fd);
/* Trace the child process and diff the memory regions
diff --git a/proto.h b/proto.h
@@ -112,6 +112,8 @@ struct mdiff_hdr {
uint8_t reserved;
/* Number of memory diff regions */
uint32_t nregions;
+ /* Size of the traced region */
+ uint32_t rsize;
/* Block size */
uint32_t blksize;
};