Lines Matching +full:in4 +full:- +full:in5
1 // SPDX-License-Identifier: GPL-2.0
33 if (CHECK(skel->kconfig, "skel_kconfig", "kconfig is mmaped()!\n")) in test_skeleton()
36 bss = skel->bss; in test_skeleton()
37 data = skel->data; in test_skeleton()
38 data_dyn = skel->data_dyn; in test_skeleton()
39 rodata = skel->rodata; in test_skeleton()
40 rodata_dyn = skel->rodata_dyn; in test_skeleton()
42 ASSERT_STREQ(bpf_map__name(skel->maps.rodata_dyn), ".rodata.dyn", "rodata_dyn_name"); in test_skeleton()
43 ASSERT_STREQ(bpf_map__name(skel->maps.data_dyn), ".data.dyn", "data_dyn_name"); in test_skeleton()
45 /* validate values are pre-initialized correctly */ in test_skeleton()
46 CHECK(data->in1 != -1, "in1", "got %d != exp %d\n", data->in1, -1); in test_skeleton()
47 CHECK(data->out1 != -1, "out1", "got %d != exp %d\n", data->out1, -1); in test_skeleton()
48 CHECK(data->in2 != -1, "in2", "got %lld != exp %lld\n", data->in2, -1LL); in test_skeleton()
49 CHECK(data->out2 != -1, "out2", "got %lld != exp %lld\n", data->out2, -1LL); in test_skeleton()
51 CHECK(bss->in3 != 0, "in3", "got %d != exp %d\n", bss->in3, 0); in test_skeleton()
52 CHECK(bss->out3 != 0, "out3", "got %d != exp %d\n", bss->out3, 0); in test_skeleton()
53 CHECK(bss->in4 != 0, "in4", "got %lld != exp %lld\n", bss->in4, 0LL); in test_skeleton()
54 CHECK(bss->out4 != 0, "out4", "got %lld != exp %lld\n", bss->out4, 0LL); in test_skeleton()
56 CHECK(rodata->in.in6 != 0, "in6", "got %d != exp %d\n", rodata->in.in6, 0); in test_skeleton()
57 CHECK(bss->out6 != 0, "out6", "got %d != exp %d\n", bss->out6, 0); in test_skeleton()
59 ASSERT_EQ(rodata_dyn->in_dynarr_sz, 0, "in_dynarr_sz"); in test_skeleton()
61 ASSERT_EQ(rodata_dyn->in_dynarr[i], -(i + 1), "in_dynarr"); in test_skeleton()
63 ASSERT_EQ(data_dyn->out_dynarr[i], i + 1, "out_dynarr"); in test_skeleton()
65 /* validate we can pre-setup global variables, even in .bss */ in test_skeleton()
66 data->in1 = 10; in test_skeleton()
67 data->in2 = 11; in test_skeleton()
68 bss->in3 = 12; in test_skeleton()
69 bss->in4 = 13; in test_skeleton()
70 rodata->in.in6 = 14; in test_skeleton()
72 rodata_dyn->in_dynarr_sz = 4; in test_skeleton()
74 rodata_dyn->in_dynarr[i] = i + 10; in test_skeleton()
80 /* validate pre-setup values are still there */ in test_skeleton()
81 CHECK(data->in1 != 10, "in1", "got %d != exp %d\n", data->in1, 10); in test_skeleton()
82 CHECK(data->in2 != 11, "in2", "got %lld != exp %lld\n", data->in2, 11LL); in test_skeleton()
83 CHECK(bss->in3 != 12, "in3", "got %d != exp %d\n", bss->in3, 12); in test_skeleton()
84 CHECK(bss->in4 != 13, "in4", "got %lld != exp %lld\n", bss->in4, 13LL); in test_skeleton()
85 CHECK(rodata->in.in6 != 14, "in6", "got %d != exp %d\n", rodata->in.in6, 14); in test_skeleton()
87 ASSERT_EQ(rodata_dyn->in_dynarr_sz, 4, "in_dynarr_sz"); in test_skeleton()
89 ASSERT_EQ(rodata_dyn->in_dynarr[i], i + 10, "in_dynarr"); in test_skeleton()
92 data->in1 = 1; in test_skeleton()
93 data->in2 = 2; in test_skeleton()
94 bss->in3 = 3; in test_skeleton()
95 bss->in4 = 4; in test_skeleton()
96 bss->in5.a = 5; in test_skeleton()
97 bss->in5.b = 6; in test_skeleton()
98 kcfg = skel->kconfig; in test_skeleton()
100 skel->data_read_mostly->read_mostly_var = 123; in test_skeleton()
109 CHECK(data->out1 != 1, "res1", "got %d != exp %d\n", data->out1, 1); in test_skeleton()
110 CHECK(data->out2 != 2, "res2", "got %lld != exp %d\n", data->out2, 2); in test_skeleton()
111 CHECK(bss->out3 != 3, "res3", "got %d != exp %d\n", (int)bss->out3, 3); in test_skeleton()
112 CHECK(bss->out4 != 4, "res4", "got %lld != exp %d\n", bss->out4, 4); in test_skeleton()
113 CHECK(bss->out5.a != 5, "res5", "got %d != exp %d\n", bss->out5.a, 5); in test_skeleton()
114 CHECK(bss->out5.b != 6, "res6", "got %lld != exp %d\n", bss->out5.b, 6); in test_skeleton()
115 CHECK(bss->out6 != 14, "res7", "got %d != exp %d\n", bss->out6, 14); in test_skeleton()
117 CHECK(bss->bpf_syscall != kcfg->CONFIG_BPF_SYSCALL, "ext1", in test_skeleton()
118 "got %d != exp %d\n", bss->bpf_syscall, kcfg->CONFIG_BPF_SYSCALL); in test_skeleton()
119 CHECK(bss->kern_ver != kcfg->LINUX_KERNEL_VERSION, "ext2", in test_skeleton()
120 "got %d != exp %d\n", bss->kern_ver, kcfg->LINUX_KERNEL_VERSION); in test_skeleton()
123 ASSERT_EQ(data_dyn->out_dynarr[i], i + 10, "out_dynarr"); in test_skeleton()
125 ASSERT_EQ(skel->bss->out_mostly_var, 123, "out_mostly_var"); in test_skeleton()
127 ASSERT_EQ(bss->huge_arr[ARRAY_SIZE(bss->huge_arr) - 1], 123, "huge_arr"); in test_skeleton()
129 fd = bpf_map__fd(skel->maps.data_non_mmapable); in test_skeleton()
134 ASSERT_EQ(bpf_map__map_flags(skel->maps.data_non_mmapable), 0, "non_mmap_flags"); in test_skeleton()