]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/allocator_replay_test: Add replay_alloc option 44265/head
authorKellen Renshaw <kellen.renshaw@canonical.com>
Wed, 27 Oct 2021 22:32:20 +0000 (22:32 +0000)
committerKellen Renshaw <kellen.renshaw@canonical.com>
Fri, 7 Jan 2022 20:39:08 +0000 (20:39 +0000)
commitd9aa77225d5813dd1dd9adec16b22064d7b999aa
treefec6dc6ad09727b5a8efdd88b6b3dc708160e1c0
parent819ecf7b8160e4eac6131e710871397233f8a8b6
test/allocator_replay_test: Add replay_alloc option

New replay_alloc option added to ceph_test_alloc_replay binary
that permits the loading of a dump produced by
"ceph daemon osd.<id> bluestore allocator dump block" and replaying
a list of allocation requests against the loaded allocator state an
arbitrary number of times (default, 100).

Once the allocator dump is loaded, the fragmentation state and
free space information are printed. Then the list of allocation
requests is replayed against that state.

Output consists of the time in ns that the allocator took to return
the requested allocation, along with the request.

If an allocation request fails or the list of allocation requests is
completed, the error info, if any, and the fragementation and
free space information is printed.

The list of allocations is formatted as a file with one allocation
request per line, with space separated values for "want", "unit",
"max", and "hint". Values can be any integer format supported by
std::scanf()'s %u formatter.

The allocation request line format:
<want> <unit> [max] [hint]

Example request lines:
0x4000 0x4000 0x4000 0x0
0x18000 0x4000 0x18000 0x0

The "want" and "unit" values are required.
Optional request values are 0 if not present in the request.

Fixes: https://tracker.ceph.com/issues/53571
Signed-off-by: Kellen Renshaw <kellen.renshaw@canonical.com>
src/test/objectstore/allocator_replay_test.cc