#pragma once
#include <lib/atq.h>
#include <lib/rbtree.h>
enum scx_selftest_id {
SCX_SELFTEST_ID_ALL = 0,
SCX_SELFTEST_ID_ATQ = 1,
SCX_SELFTEST_ID_BTREE = 2,
SCX_SELFTEST_ID_LVQUEUE = 3,
SCX_SELFTEST_ID_MINHEAP = 4,
SCX_SELFTEST_ID_RBTREE = 5,
SCX_SELFTEST_ID_TOPOLOGY = 6,
};
#define SCX_SELFTEST(func, ...) \
do { \
int ret = func(__VA_ARGS__); \
if (ret) { \
bpf_printk("SELFTEST %s FAIL: %d", #func, ret); \
return ret; \
} \
} while (0)
struct task_ctx_nonarena {
struct scx_task_common common;
u64 pid;
u64 vtime;
struct rbnode rbnode;
struct task_ctx_nonarena __arena *next;
};
typedef struct task_ctx_nonarena __arena task_ctx;
int scx_selftest_arena_topology_timer(void);
int scx_selftest_atq(void);
int scx_selftest_dhq(void);
int scx_selftest_bitmap(void);
int scx_selftest_btree(void);
int scx_selftest_lvqueue(void);
int scx_selftest_minheap(void);
int scx_selftest_rbtree(void);
int scx_selftest_topology(void);
#ifndef __BPF__
#define topo_ptr void *
#endif