# Payloads generator

## Introduction

Payloads for the TAB subsystem are generated by special python scripts. Each script prints the generated file inside the terminal. For details about how the contents of the payloads are used, see [TAB documentation](../shelter/tab.md)

## Pez subsystem payload

File: `shelter/tools/generator/pez_alloc_free_payload_gen.py`

This script generates two arrays of `sh_uint64`:
- `test_pez_physical_size`: 2000 values that should be interpreted as pages count. Half of them are 1. The other half ranges from 2 to 1000. In the other half, higher values are less likely to appear as their value rises.
- `test_pez_physical_alloc`: 4000 values ranging 0 to 1999, each one appearing twice. 

## Radix tree subsystem

File: `shelter/tools/generator/radix_tree_payload_gen.py`

This script generates three arrays of `sh_uint64`, containing 10000 random 8 bytes unsigned integers each: `test_keys`, `test_values` and `test_search`.

## Malloc subsystem

File: `shelter/tools/generator/malloc_payload_gen.py`

This script generate three arrays of `sh_uint64`:
- `test_malloc_small_size`: 10000 values that should be interpreted as size in bytes. They range from 1 to 1024, higher values are less likely to appear as their value rises.
- `test_malloc_big_size`: 1000 values ranging from 1 to 25, higher values are less likely to appear as their value rises.
- `test_malloc_big_alloc`: 2000 values ranging 0 to 999, each one appearing twice.
