test_ctx
struct test_ctx *ctx = test->priv;
struct test_ctx *ctx = test->priv;
struct test_ctx *ctx;
struct nand_op_parser_ctx test_ctx = ctx;
if (!nand_op_parser_match_pat(pattern, &test_ctx))
nand_op_parser_cmp_ctx(&test_ctx, &best_ctx) <= 0)
best_ctx = test_ctx;
struct damon_ctx *test_ctx;
test_ctx = damon_new_ctx();
if (!test_ctx)
err = damon_commit_ctx(test_ctx, running_ctx);
damon_destroy_ctx(test_ctx);
return test_ctx;
struct damon_ctx *param_ctx, *test_ctx;
test_ctx = damon_sysfs_new_test_ctx(kdamond->damon_ctx);
if (!test_ctx) {
err = damon_commit_ctx(test_ctx, param_ctx);
damon_destroy_ctx(test_ctx);
static void test_ctx__free(struct test_ctx *t)
static int test_ctx__init(struct test_ctx *t)
static void test_ctx__dump_and_compare(struct test_ctx *t,
struct test_ctx t = {};
struct test_ctx t = {};
struct test_ctx t = {};
struct test_ctx *skel;
static int test_global_init(struct test_ctx *ctx)
static void test_global_shutdown(struct test_ctx *ctx)
struct test_ctx ctx;
on_sample, NULL, &test_ctx, NULL);
struct test_ctx_s test_ctx;
test_ctx.passed = false;
test_ctx.pkt_size = pkt_size;
ASSERT_TRUE(test_ctx.passed, "test passed");
struct total_bw_ctx *test_ctx;
test_ctx = calloc(1, sizeof(*test_ctx));
if (!test_ctx)
test_ctx->nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
if (test_ctx->nr_cpus <= 0) {
free(test_ctx);
if (test_ctx->nr_cpus > MAX_CPUS)
test_ctx->nr_cpus = MAX_CPUS;
if (fetch_verify_total_bw(test_ctx->baseline_bw, test_ctx->nr_cpus) < 0) {
free(test_ctx);
test_ctx->skel = minimal__open();
if (!test_ctx->skel) {
free(test_ctx);
SCX_ENUM_INIT(test_ctx->skel);
if (minimal__load(test_ctx->skel)) {
minimal__destroy(test_ctx->skel);
free(test_ctx);
*ctx = test_ctx;
struct total_bw_ctx *test_ctx = ctx;
link = bpf_map__attach_struct_ops(test_ctx->skel->maps.minimal_ops);
if (fetch_verify_total_bw(loaded_bw, test_ctx->nr_cpus) < 0) {
if (fetch_verify_total_bw(unloaded_bw, test_ctx->nr_cpus) < 0) {
for (i = 0; i < test_ctx->nr_cpus; i++) {
if (test_ctx->baseline_bw[i] != loaded_bw[i]) {
i, test_ctx->baseline_bw[i], loaded_bw[i]);
if (test_ctx->baseline_bw[i] != unloaded_bw[i]) {
i, test_ctx->baseline_bw[i], unloaded_bw[i]);
struct total_bw_ctx *test_ctx = ctx;
if (test_ctx) {
if (test_ctx->skel)
minimal__destroy(test_ctx->skel);
free(test_ctx);