Commit 2b9746c9 authored by Florian Fischer's avatar Florian Fischer
Browse files

fix links and use single sane code blocks

parent fa35a503
......@@ -56,14 +56,14 @@ doesn't run any benchmark just summarizes the loaded results
## Benchmarks
You want to compare allocators with your own software or add a new benchmark,
have a look at [doc/Benchmarks.md]().
have a look at [](doc/Benchmarks.md).
## Allocators
By default tcmalloc, jemalloc, Hoard and your libc's allocator will be used
if found and the `-a` option is not used.
For more control about used allocators have a look at [doc/Allocators.md]().
For more control about used allocators have a look at [](doc/Allocators.md).
## License
......
# Allocators
allocbench supports three mechanisms to change the used allocator for program
run with exec. The easiest is using ```LD_PRELOAD``` to overwrite ```malloc/free```
run with exec. The easiest is using `LD_PRELOAD` to overwrite `malloc/free`
with the functions of a shared library like libtcmalloc.so. If LD_PRELOAD
can't be used you can specify a command prefix to somehow load and use your allocator.
This command prefix is used for different versions of glibc. The command is
prefixed with the loader of the glibc version to test. *Note that the whole glibc
is changed maybe tampering with the results*. Additionally binary suffixes are
supported. This could be used to use with ```patchelf``` patched binaries to
use different ```rpath``` or ```linker```.
supported. This could be used to use with `patchelf` patched binaries to
use different `rpath` or `linker`.
The used allocators are stored in a global python dictionary associating
their names with the fields: ```cmd_prefix, binary_suffix, LD_PRELOAD``` and ```color```.
their names with the fields: `cmd_prefix, binary_suffix, LD_PRELOAD` and `color`.
By default this dictionary is build from locally installed allocators found by ```whereis```.
By default this dictionary is build from locally installed allocators found by `whereis`.
You can overwrite the default allocators with the ```-a | --allocators``` option
and a python script exporting a global dictionary with the name ```allocators```.
You can overwrite the default allocators with the `-a | --allocators` option
and a python script exporting a global dictionary with the name `allocators`.
## Building Allocators
To reproducible build allocators and patched version you can use the
classes ```Allocator{_Sources,_Patched}``` provided in ```src/allocator.py```.
classes `Allocator{_Sources,_Patched}``` provided in ```src/allocator.py`.
See allocators/no_falsesharing.py or allocators/BA_allocators.py for examples.
See [](allocators/no_falsesharing.py) or [](allocators/BA_allocators.py) for examples.
......@@ -129,16 +129,16 @@ for number_of_runs
#### run hooks
* ```preallocator_hook((alloc_name, alloc_definition), current_run, verbose)``` is called
* `preallocator_hook((alloc_name, alloc_definition), current_run, verbose)` is called
if available once per allocator before any command is executed. This hook may
be useful if you want to prepare stuff for each allocator. The mysql benchmark
uses this hook to start the mysql server with the current allocator.
* ```process_output(result_dict, stdout, stderr, allocator_name, permutation, verbose)```
* `process_output(result_dict, stdout, stderr, allocator_name, permutation, verbose)`
is called after each run of your command. Store relevant data in result_dict
to use it for your summary.
* ```postallocator_hook((alloc_name, alloc_definition), current_run, verbose)``
* `postallocator_hook((alloc_name, alloc_definition), current_run, verbose)`
is called after all permutations are done for the current allocator.
The mysql benchmark uses this hook to terminate the in preallocator_hook started
mysql server.
......
Supports Markdown
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