1/* @title: Nightmare perturbation */
2#pragma once
3#include <types/types.h>
4
5struct nightmare_ctx;
6struct nightmare_worker;
7
8struct nightmare_perturb_config {
9 const char *name;
10 time_ns_t interval_us;
11 time_ns_t period_ms;
12 time_ns_t gap_ms;
13};
14
15struct nightmare_perturb_desc {
16 const char *name;
17 void (*thread)(struct nightmare_ctx *, struct nightmare_worker *);
18};
19
20const struct nightmare_perturb_config *
21nightmare_perturb_config_lookup(const char *name);
22const struct nightmare_perturb_desc *nightmare_perturb_lookup(const char *name);
23
24void nightmare_perturb_migrator(struct nightmare_ctx *ctx,
25 struct nightmare_worker *worker);
26void nightmare_perturb_waker(struct nightmare_ctx *ctx,
27 struct nightmare_worker *worker);
28void nightmare_perturb_apc_spammer(struct nightmare_ctx *ctx,
29 struct nightmare_worker *worker);
30void nightmare_perturb_stutter(struct nightmare_ctx *ctx,
31 struct nightmare_worker *worker);
32void nightmare_perturb_alloc_pressure(struct nightmare_ctx *ctx,
33 struct nightmare_worker *worker);
34void nightmare_perturb_inject_armer(struct nightmare_ctx *ctx,
35 struct nightmare_worker *worker);
36