aboutsummaryrefslogtreecommitdiffstats
path: root/testrecovery.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2001-10-19 06:09:29 +0000
committerH. Peter Anvin <hpa@zytor.com>2001-10-19 06:09:29 +0000
commit7699ea1cbb2cbdc7a81279b23fd4eafe188d99dc (patch)
tree173e73ac01d7678be9f82bc5bfe74ce0dd5c938b /testrecovery.c
parent6f9d2dab5ff8d60ed805a821e9c7d2272c753e81 (diff)
downloadlpsm-7699ea1cbb2cbdc7a81279b23fd4eafe188d99dc.tar.gz
lpsm-7699ea1cbb2cbdc7a81279b23fd4eafe188d99dc.tar.xz
lpsm-7699ea1cbb2cbdc7a81279b23fd4eafe188d99dc.zip
Change names around to be more consistent; set the name of the system to
LPSM (Linux Persistent Memory); set the load address to 0x58000000 on i386 (in case we're on x86-64 in 32-bit mode, or using Andrea's 3.5G patches); change symbol names throughout. Add README file.
Diffstat (limited to 'testrecovery.c')
-rw-r--r--testrecovery.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/testrecovery.c b/testrecovery.c
index 0dbe66c..0ebf816 100644
--- a/testrecovery.c
+++ b/testrecovery.c
@@ -30,7 +30,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
-#include "objstore.h"
+#include "lpsm.h"
#define COUNT 262144
#define SLOTS 4096
@@ -83,25 +83,25 @@ int main(int argc, char *argv[])
unlink("arena.dat");
unlink("arena.log");
- if ( !(root_ptr = objstore_arena_init("arena.dat", "arena.log")) ) {
- fprintf(stderr, "%s: objstore_arena_init() failed\n", argv[0]);
+ if ( !(root_ptr = lpsm_init("arena.dat", "arena.log")) ) {
+ fprintf(stderr, "%s: lpsm_arena_init() failed\n", argv[0]);
return 1;
}
printf("Arena: initialized, %d root pointers at %p\n",
- ROOT_DATA_POINTERS, root_ptr);
+ LPSM_ROOT_POINTERS, root_ptr);
- root_ptr[0] = misc_ptr = objstore_malloc(sizeof(struct misc_info));
- root_ptr[1] = areas = objstore_malloc(sizeof(void *) * SLOTS);
- root_ptr[2] = sizes = objstore_malloc(sizeof(int) * SLOTS);
+ root_ptr[0] = misc_ptr = lpsm_malloc(sizeof(struct misc_info));
+ root_ptr[1] = areas = lpsm_malloc(sizeof(void *) * SLOTS);
+ root_ptr[2] = sizes = lpsm_malloc(sizeof(int) * SLOTS);
misc_ptr->count = misc_ptr->occupied = 0;
memset(areas, 0, sizeof(areas));
memset(sizes, 0, sizeof(sizes));
- objstore_checkpoint(0.0, OBJSYNC_SYNC);
- objstore_shutdown();
+ lpsm_checkpoint(0.0, PSMSYNC_SYNC);
+ lpsm_shutdown();
/* Become our own process group and ignore SIGTERM to make it easier to
"kill everything". Become our own session to keep shell job control
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
gettimeofday(&start_time, NULL);
- root_ptr = objstore_arena_init("arena.dat", "arena.log");
+ root_ptr = lpsm_init("arena.dat", "arena.log");
gettimeofday(&init_time, NULL);
@@ -175,7 +175,7 @@ int main(int argc, char *argv[])
if ( areas[slot] ) {
if ( rand() % 1 ) {
- objstore_free(areas[slot]);
+ lpsm_free(areas[slot]);
printf("Free: %d (0x%08x) bytes at %p\n",
sizes[slot], sizes[slot], areas[slot]);
areas[slot] = NULL;
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
} else {
rnd = (double)rand()/RAND_MAX;
newsize = (int)pow(2.0, MAXLOG*pow(rnd,3.0));
- nptr = objstore_realloc(areas[slot], newsize);
+ nptr = lpsm_realloc(areas[slot], newsize);
if ( nptr ) {
printf("Realloc: %d bytes at %p -> %d bytes at %p\n",
sizes[slot], areas[slot], newsize, nptr);
@@ -202,7 +202,7 @@ int main(int argc, char *argv[])
} else {
rnd = (double)rand()/RAND_MAX;
sizes[slot] = (int)pow(2.0, MAXLOG*pow(rnd,5.0));
- areas[slot] = objstore_malloc(sizes[slot]);
+ areas[slot] = lpsm_malloc(sizes[slot]);
if (areas[slot]) {
printf("Alloc: %d (0x%08x) bytes at %p\n",
sizes[slot], sizes[slot], areas[slot]);
@@ -217,13 +217,13 @@ int main(int argc, char *argv[])
if ( (i & 255) == 0 ) {
printf("Arena: checkpointing, count = %d\n", i);
- objstore_checkpoint(0.1, OBJSYNC_SKIP);
+ lpsm_checkpoint(0.1, PSMSYNC_SKIP);
}
printf("Arena: %ld bytes officially occupied\n", misc_ptr->occupied);
}
/* If the loop finishes, exit... */
fprintf(stderr, "ready...\n");
- objstore_checkpoint(0.0, OBJSYNC_SYNC); /* Synchronous checkpoint */
+ lpsm_checkpoint(0.0, PSMSYNC_SYNC); /* Synchronous checkpoint */
exit(0);
}
}