test_ctx
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0xff), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 1), 0);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_REQUESTED,
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_PROCESSED,
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_PROCESSED,
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_PROCESSED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), 0);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 1), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0x77), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), -EBUSY);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 2), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0xab), 0);
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_REQUESTED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 1), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0xcd), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), -EBUSY);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_REQUESTED,
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_REQUESTED,
ssif_bmc_test_run_event_val(test_ctx, I2C_SLAVE_READ_PROCESSED,
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 1), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0x21), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), -EBUSY);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 1), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0x22), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), -EBUSY);
struct ssif_bmc_test_ctx *test_ctx;
test_ctx = kunit_kzalloc(test, sizeof(*test_ctx), GFP_KERNEL);
if (!test_ctx)
test_ctx->adapter.algo = &test_ctx->algo;
test_ctx->client.addr = 0x20;
test_ctx->client.adapter = &test_ctx->adapter;
spin_lock_init(&test_ctx->ssif_bmc.lock);
init_waitqueue_head(&test_ctx->ssif_bmc.wait_queue);
test_ctx->ssif_bmc.client = &test_ctx->client;
i2c_set_clientdata(&test_ctx->client, &test_ctx->ssif_bmc);
test->priv = test_ctx;
struct ssif_bmc_test_ctx *test_ctx = test->priv;
if (test_ctx->ssif_bmc.response_timer_inited)
timer_delete_sync(&test_ctx->ssif_bmc.response_timer);
static int ssif_bmc_test_run_event_val(struct ssif_bmc_test_ctx *test_ctx,
return ssif_bmc_cb(&test_ctx->client, event, value);
static int ssif_bmc_test_run_event(struct ssif_bmc_test_ctx *test_ctx,
return ssif_bmc_test_run_event_val(test_ctx, event, &value);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr));
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 2);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0xaa);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0x55);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_STOP, 0), -EBUSY);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
GET_8BIT_ADDR(test_ctx->client.addr)), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED,
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 2), 0);
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_RECEIVED, 0xde), 0);
struct ssif_bmc_test_ctx *test_ctx = test->priv;
struct ssif_bmc_ctx *ssif_bmc = &test_ctx->ssif_bmc;
ssif_bmc_test_run_event(test_ctx, I2C_SLAVE_WRITE_REQUESTED,
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]);
if (read_fair_runtime_all(test_ctx->nr_cpus, original_runtime) < 0) {
if (write_fair_runtime_all(test_ctx->nr_cpus, doubled_runtime) < 0) {
if (fetch_verify_total_bw(doubled_bw, test_ctx->nr_cpus) < 0) {
for (i = 0; i < test_ctx->nr_cpus; i++) {
if (doubled_bw[i] <= test_ctx->baseline_bw[i]) {
i, test_ctx->baseline_bw[i], doubled_bw[i]);
link = bpf_map__attach_struct_ops(test_ctx->skel->maps.minimal_ops);
if (fetch_verify_total_bw(loaded_bw, test_ctx->nr_cpus) < 0) {
for (i = 0; i < test_ctx->nr_cpus; i++) {
if (loaded_bw[i] != test_ctx->baseline_bw[i]) {
i, test_ctx->baseline_bw[i], loaded_bw[i]);
if (fetch_verify_total_bw(unloaded_bw, test_ctx->nr_cpus) < 0) {
for (i = 0; i < test_ctx->nr_cpus; i++) {
if (restore_fair_runtime_all(test_ctx->nr_cpus, original_runtime) < 0)
struct total_bw_ctx *test_ctx = ctx;
if (test_ctx) {
if (test_ctx->skel)
minimal__destroy(test_ctx->skel);
free(test_ctx);