diff options
-rw-r--r-- | perf/Makefile.am | 1 | ||||
-rw-r--r-- | perf/heap.c | 15 | ||||
-rw-r--r-- | perf/heap_pdb4.vgperf | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/perf/Makefile.am b/perf/Makefile.am index ad5ceac60..66b0ed05d 100644 --- a/perf/Makefile.am +++ b/perf/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = \ fbench.vgperf \ ffbench.vgperf \ heap.vgperf \ + heap_pdb4.vgperf \ many-loss-records.vgperf \ many-xpts.vgperf \ sarp.vgperf \ diff --git a/perf/heap.c b/perf/heap.c index c84f6cbfc..8b38bec22 100644 --- a/perf/heap.c +++ b/perf/heap.c @@ -7,9 +7,16 @@ char* arr[NLIVE]; -int main ( void ) +int main ( int argc, char* argv[] ) { int i, j, nbytes = 0; + int pdb = 0; + int jpdb; + + if (argc > 1) { + pdb = atoi(argv[1]); + } + printf("initialising\n"); for (i = 0; i < NLIVE; i++) arr[i] = NULL; @@ -22,6 +29,12 @@ int main ( void ) if (arr[j]) free(arr[j]); arr[j] = malloc(nbytes); + if (pdb > 0) { + // create some partially defined bytes in arr[j] + for (jpdb=0; jpdb<nbytes; jpdb = jpdb+pdb) { + arr[j][jpdb] &= (jpdb & 0xff); + } + } // Cycle through the sizes 0,8,16,24,32. Zero will get rounded up to // 8, so the 8B bucket will get twice as much traffic. diff --git a/perf/heap_pdb4.vgperf b/perf/heap_pdb4.vgperf new file mode 100644 index 000000000..30ed0f2c3 --- /dev/null +++ b/perf/heap_pdb4.vgperf @@ -0,0 +1,2 @@ +prog: heap +args: 4 |