Skip to content

Commit 5db0ba6

Browse files
Lin YikaiAlexei Starovoitov
authored andcommitted
selftests/bpf: fix some typos in selftests
Hi, fix some spelling errors in selftest, the details are as follows: -in the codes: test_bpf_sk_stoarge_map_iter_fd(void) ->test_bpf_sk_storage_map_iter_fd(void) load BTF from btf_data.o->load BTF from btf_data.bpf.o -in the code comments: preample->preamble multi-contollers->multi-controllers errono->errno unsighed/unsinged->unsigned egree->egress shoud->should regsiter->register assummed->assumed conditiona->conditional rougly->roughly timetamp->timestamp ingores->ignores null-termainted->null-terminated slepable->sleepable implemenation->implementation veriables->variables timetamps->timestamps substitue a costant->substitute a constant secton->section unreferened->unreferenced verifer->verifier libppf->libbpf ... Signed-off-by: Lin Yikai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 552895a commit 5db0ba6

25 files changed

+39
-39
lines changed

tools/testing/selftests/bpf/benchs/bench_trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static void trigger_rawtp_setup(void)
276276
* instructions. So use two different targets, one of which starts with nop
277277
* and another doesn't.
278278
*
279-
* GCC doesn't generate stack setup preample for these functions due to them
279+
* GCC doesn't generate stack setup preamble for these functions due to them
280280
* having no input arguments and doing nothing in the body.
281281
*/
282282
__nocf_check __weak void uprobe_target_nop(void)

tools/testing/selftests/bpf/cgroup_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ unsigned long long get_classid_cgroup_id(void)
644644
/**
645645
* get_cgroup1_hierarchy_id - Retrieves the ID of a cgroup1 hierarchy from the cgroup1 subsys name.
646646
* @subsys_name: The cgroup1 subsys name, which can be retrieved from /proc/self/cgroup. It can be
647-
* a named cgroup like "name=systemd", a controller name like "net_cls", or multi-contollers like
647+
* a named cgroup like "name=systemd", a controller name like "net_cls", or multi-controllers like
648648
* "net_cls,net_prio".
649649
*/
650650
int get_cgroup1_hierarchy_id(const char *subsys_name)

tools/testing/selftests/bpf/map_tests/htab_map_batch_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void __test_map_lookup_and_delete_batch(bool is_pcpu)
197197
CHECK(total != max_entries, "delete with steps",
198198
"total = %u, max_entries = %u\n", total, max_entries);
199199

200-
/* check map is empty, errono == ENOENT */
200+
/* check map is empty, errno == ENOENT */
201201
err = bpf_map_get_next_key(map_fd, NULL, &key);
202202
CHECK(!err || errno != ENOENT, "bpf_map_get_next_key()",
203203
"error: %s\n", strerror(errno));

tools/testing/selftests/bpf/map_tests/lpm_trie_map_batch_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void test_lpm_trie_map_batch_ops(void)
135135
CHECK(total != max_entries, "delete with steps",
136136
"total = %u, max_entries = %u\n", total, max_entries);
137137

138-
/* check map is empty, errono == ENOENT */
138+
/* check map is empty, errno == ENOENT */
139139
err = bpf_map_get_next_key(map_fd, NULL, &key);
140140
CHECK(!err || errno != ENOENT, "bpf_map_get_next_key()",
141141
"error: %s\n", strerror(errno));

tools/testing/selftests/bpf/prog_tests/bpf_iter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ static void test_bpf_sk_storage_get(void)
12181218
bpf_iter_bpf_sk_storage_helpers__destroy(skel);
12191219
}
12201220

1221-
static void test_bpf_sk_stoarge_map_iter_fd(void)
1221+
static void test_bpf_sk_storage_map_iter_fd(void)
12221222
{
12231223
struct bpf_iter_bpf_sk_storage_map *skel;
12241224

@@ -1693,7 +1693,7 @@ void test_bpf_iter(void)
16931693
if (test__start_subtest("bpf_sk_storage_map"))
16941694
test_bpf_sk_storage_map();
16951695
if (test__start_subtest("bpf_sk_storage_map_iter_fd"))
1696-
test_bpf_sk_stoarge_map_iter_fd();
1696+
test_bpf_sk_storage_map_iter_fd();
16971697
if (test__start_subtest("bpf_sk_storage_delete"))
16981698
test_bpf_sk_storage_delete();
16991699
if (test__start_subtest("bpf_sk_storage_get"))

tools/testing/selftests/bpf/prog_tests/btf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4986,7 +4986,7 @@ struct pprint_mapv_int128 {
49864986
static struct btf_raw_test pprint_test_template[] = {
49874987
{
49884988
.raw_types = {
4989-
/* unsighed char */ /* [1] */
4989+
/* unsigned char */ /* [1] */
49904990
BTF_TYPE_INT_ENC(NAME_TBD, 0, 0, 8, 1),
49914991
/* unsigned short */ /* [2] */
49924992
BTF_TYPE_INT_ENC(NAME_TBD, 0, 0, 16, 2),
@@ -5053,7 +5053,7 @@ static struct btf_raw_test pprint_test_template[] = {
50535053
* be encoded with kind_flag set.
50545054
*/
50555055
.raw_types = {
5056-
/* unsighed char */ /* [1] */
5056+
/* unsigned char */ /* [1] */
50575057
BTF_TYPE_INT_ENC(NAME_TBD, 0, 0, 8, 1),
50585058
/* unsigned short */ /* [2] */
50595059
BTF_TYPE_INT_ENC(NAME_TBD, 0, 0, 16, 2),
@@ -5120,7 +5120,7 @@ static struct btf_raw_test pprint_test_template[] = {
51205120
* will have both int and enum types.
51215121
*/
51225122
.raw_types = {
5123-
/* unsighed char */ /* [1] */
5123+
/* unsigned char */ /* [1] */
51245124
BTF_TYPE_INT_ENC(NAME_TBD, 0, 0, 8, 1),
51255125
/* unsigned short */ /* [2] */
51265126
BTF_TYPE_INT_ENC(NAME_TBD, 0, 0, 16, 2),

tools/testing/selftests/bpf/prog_tests/cg_storage_multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static void test_isolated(int parent_cgroup_fd, int child_cgroup_fd)
214214
/* Attach to parent and child cgroup, trigger packet from child.
215215
* Assert that there is six additional runs, parent cgroup egresses and
216216
* ingress, child cgroup egresses and ingress.
217-
* Assert that egree and ingress storages are separate.
217+
* Assert that egress and ingress storages are separate.
218218
*/
219219
child_egress1_link = bpf_program__attach_cgroup(obj->progs.egress1,
220220
child_cgroup_fd);

tools/testing/selftests/bpf/prog_tests/log_buf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static void bpf_prog_load_log_buf(void)
160160
opts.log_buf = log_buf;
161161
opts.log_size = log_buf_sz;
162162

163-
/* with log_level == 0 log_buf shoud stay empty for good prog */
163+
/* with log_level == 0 log_buf should stay empty for good prog */
164164
log_buf[0] = '\0';
165165
opts.log_level = 0;
166166
fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, "good_prog", "GPL",
@@ -222,7 +222,7 @@ static void bpf_btf_load_log_buf(void)
222222
opts.log_buf = log_buf;
223223
opts.log_size = log_buf_sz;
224224

225-
/* with log_level == 0 log_buf shoud stay empty for good BTF */
225+
/* with log_level == 0 log_buf should stay empty for good BTF */
226226
log_buf[0] = '\0';
227227
opts.log_level = 0;
228228
fd = bpf_btf_load(raw_btf_data, raw_btf_size, &opts);

tools/testing/selftests/bpf/prog_tests/reg_bounds.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static const char *op_str(enum op op)
503503

504504
/* Can register with range [x.a, x.b] *EVER* satisfy
505505
* OP (<, <=, >, >=, ==, !=) relation to
506-
* a regsiter with range [y.a, y.b]
506+
* a register with range [y.a, y.b]
507507
* _in *num_t* domain_
508508
*/
509509
static bool range_canbe_op(enum num_t t, struct range x, struct range y, enum op op)
@@ -532,7 +532,7 @@ static bool range_canbe_op(enum num_t t, struct range x, struct range y, enum op
532532

533533
/* Does register with range [x.a, x.b] *ALWAYS* satisfy
534534
* OP (<, <=, >, >=, ==, !=) relation to
535-
* a regsiter with range [y.a, y.b]
535+
* a register with range [y.a, y.b]
536536
* _in *num_t* domain_
537537
*/
538538
static bool range_always_op(enum num_t t, struct range x, struct range y, enum op op)
@@ -543,7 +543,7 @@ static bool range_always_op(enum num_t t, struct range x, struct range y, enum o
543543

544544
/* Does register with range [x.a, x.b] *NEVER* satisfy
545545
* OP (<, <=, >, >=, ==, !=) relation to
546-
* a regsiter with range [y.a, y.b]
546+
* a register with range [y.a, y.b]
547547
* _in *num_t* domain_
548548
*/
549549
static bool range_never_op(enum num_t t, struct range x, struct range y, enum op op)
@@ -1018,11 +1018,11 @@ static int parse_reg_state(const char *s, struct reg_state *reg)
10181018
* - umin=%llu, if missing, assumed 0;
10191019
* - umax=%llu, if missing, assumed U64_MAX;
10201020
* - smin=%lld, if missing, assumed S64_MIN;
1021-
* - smax=%lld, if missing, assummed S64_MAX;
1021+
* - smax=%lld, if missing, assumed S64_MAX;
10221022
* - umin32=%d, if missing, assumed 0;
10231023
* - umax32=%d, if missing, assumed U32_MAX;
10241024
* - smin32=%d, if missing, assumed S32_MIN;
1025-
* - smax32=%d, if missing, assummed S32_MAX;
1025+
* - smax32=%d, if missing, assumed S32_MAX;
10261026
* - var_off=(%#llx; %#llx), tnum part, we don't care about it.
10271027
*
10281028
* If some of the values are equal, they will be grouped (but min/max
@@ -1884,7 +1884,7 @@ static void validate_gen_range_vs_range(enum num_t init_t, enum num_t cond_t)
18841884
* envvar is not set, this test is skipped during test_progs testing.
18851885
*
18861886
* We split this up into smaller subsets based on initialization and
1887-
* conditiona numeric domains to get an easy parallelization with test_progs'
1887+
* conditional numeric domains to get an easy parallelization with test_progs'
18881888
* -j argument.
18891889
*/
18901890

@@ -1938,7 +1938,7 @@ static u64 rand_u64()
19381938
{
19391939
/* RAND_MAX is guaranteed to be at least 1<<15, but in practice it
19401940
* seems to be 1<<31, so we need to call it thrice to get full u64;
1941-
* we'll use rougly equal split: 22 + 21 + 21 bits
1941+
* we'll use roughly equal split: 22 + 21 + 21 bits
19421942
*/
19431943
return ((u64)random() << 42) |
19441944
(((u64)random() & RAND_21BIT_MASK) << 21) |

tools/testing/selftests/bpf/prog_tests/resolve_btfids.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static int resolve_symbols(void)
103103

104104
btf = btf__parse_elf("btf_data.bpf.o", NULL);
105105
if (CHECK(libbpf_get_error(btf), "resolve",
106-
"Failed to load BTF from btf_data.o\n"))
106+
"Failed to load BTF from btf_data.bpf.o\n"))
107107
return -1;
108108

109109
nr = btf__type_cnt(btf);

0 commit comments

Comments
 (0)