Commit 17c5b4d9 authored by John Esmet's avatar John Esmet

FT-300 Block allocator trace replay tool

parent e9de0225
......@@ -129,7 +129,7 @@ void block_allocator::create(uint64_t reserve_at_beginning, uint64_t alignment)
VALIDATE();
if (ba_trace_enabled()) {
fprintf(stderr, "ba_trace_create %p", this);
fprintf(stderr, "ba_trace_create %p\n", this);
}
}
......@@ -137,7 +137,7 @@ void block_allocator::destroy() {
toku_free(_blocks_array);
if (ba_trace_enabled()) {
fprintf(stderr, "ba_trace_destroy %p", this);
fprintf(stderr, "ba_trace_destroy %p\n", this);
}
}
......@@ -460,6 +460,14 @@ void block_allocator::get_unused_statistics(TOKU_DB_FRAGMENTATION report) {
}
}
void block_allocator::get_statistics(TOKU_DB_FRAGMENTATION report) {
report->data_bytes = _n_bytes_in_use;
report->data_blocks = _n_blocks;
report->file_size_bytes = 0;
report->checkpoint_bytes_additional = 0;
get_unused_statistics(report);
}
void block_allocator::validate() const {
uint64_t n_bytes_in_use = _reserve_at_beginning;
for (uint64_t i = 0; i < _n_blocks; i++) {
......
......@@ -213,6 +213,14 @@ class block_allocator {
// report->checkpoint_bytes_additional is filled in
void get_unused_statistics(TOKU_DB_FRAGMENTATION report);
// Effect: Fill in report->data_bytes with the number of bytes in use
// Fill in report->data_blocks with the number of blockpairs in use
// Fill in unused statistics using this->get_unused_statistics()
// Requires:
// report->file_size is ignored on return
// report->checkpoint_bytes_additional is ignored on return
void get_statistics(TOKU_DB_FRAGMENTATION report);
// Effect: Merge dst[d] and src[s] into dst[d+s], merging in place.
// Initially dst and src hold sorted arrays (sorted by increasing offset).
// Finally dst contains all d+s elements sorted in order.
......
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPRECATE_ERRNO)
set(tools tokudb_dump tokuftdump tdb_logprint tdb-recover ftverify)
set(tools tokudb_dump tokuftdump tdb_logprint tdb-recover ftverify ba_replay)
foreach(tool ${tools})
add_executable(${tool} ${tool})
add_dependencies(${tool} install_tdb_h)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment