Home
last modified time | relevance | path

Searched refs:test (Results 1 – 25 of 904) sorted by relevance

12345678910>>...37

/Linux-v5.4/tools/perf/tests/
Dtests.h30 struct test { struct
32 int (*func)(struct test *test, int subtest); argument
43 int test__vmlinux_matches_kallsyms(struct test *test, int subtest); argument
44 int test__openat_syscall_event(struct test *test, int subtest);
45 int test__openat_syscall_event_on_all_cpus(struct test *test, int subtest);
46 int test__basic_mmap(struct test *test, int subtest);
47 int test__PERF_RECORD(struct test *test, int subtest);
48 int test__perf_evsel__roundtrip_name_test(struct test *test, int subtest);
49 int test__perf_evsel__tp_sched_test(struct test *test, int subtest);
50 int test__syscall_openat_tp_fields(struct test *test, int subtest);
[all …]
Dexpr.c9 static int test(struct parse_ctx *ctx, const char *e, double val2) in test() function
19 int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) in test__expr()
32 ret = test(&ctx, "1+1", 2); in test__expr()
33 ret |= test(&ctx, "FOO+BAR", 3); in test__expr()
34 ret |= test(&ctx, "(BAR/2)%2", 1); in test__expr()
35 ret |= test(&ctx, "1 - -4", 5); in test__expr()
36 ret |= test(&ctx, "(FOO-1)*2 + (BAR/2)%2 - -4", 5); in test__expr()
37 ret |= test(&ctx, "1-1 | 1", 1); in test__expr()
38 ret |= test(&ctx, "1-1 & 1", 0); in test__expr()
39 ret |= test(&ctx, "min(1,2) + 1", 2); in test__expr()
[all …]
/Linux-v5.4/include/
DKbuild3 # Add header-test-$(CONFIG_...) guard to headers that are only compiled
6 # Headers listed in header-test- are excluded from the test coverage.
11 header-test- += acpi/acbuffer.h
12 header-test- += acpi/acpi.h
13 header-test- += acpi/acpi_bus.h
14 header-test- += acpi/acpi_drivers.h
15 header-test- += acpi/acpi_io.h
16 header-test- += acpi/acpi_lpat.h
17 header-test- += acpi/acpiosxf.h
18 header-test- += acpi/acpixf.h
[all …]
/Linux-v5.4/tools/pci/
Dpcitest.c39 static int run_test(struct pci_test *test) in run_test() argument
44 fd = open(test->device, O_RDWR); in run_test()
50 if (test->barnum >= 0 && test->barnum <= 5) { in run_test()
51 ret = ioctl(fd, PCITEST_BAR, test->barnum); in run_test()
52 fprintf(stdout, "BAR%d:\t\t", test->barnum); in run_test()
59 if (test->set_irqtype) { in run_test()
60 ret = ioctl(fd, PCITEST_SET_IRQTYPE, test->irqtype); in run_test()
61 fprintf(stdout, "SET IRQ TYPE TO %s:\t\t", irq[test->irqtype]); in run_test()
68 if (test->get_irqtype) { in run_test()
77 if (test->legacyirq) { in run_test()
[all …]
/Linux-v5.4/drivers/misc/
Dpci_endpoint_test.c114 static inline u32 pci_endpoint_test_readl(struct pci_endpoint_test *test, in pci_endpoint_test_readl() argument
117 return readl(test->base + offset); in pci_endpoint_test_readl()
120 static inline void pci_endpoint_test_writel(struct pci_endpoint_test *test, in pci_endpoint_test_writel() argument
123 writel(value, test->base + offset); in pci_endpoint_test_writel()
126 static inline u32 pci_endpoint_test_bar_readl(struct pci_endpoint_test *test, in pci_endpoint_test_bar_readl() argument
129 return readl(test->bar[bar] + offset); in pci_endpoint_test_bar_readl()
132 static inline void pci_endpoint_test_bar_writel(struct pci_endpoint_test *test, in pci_endpoint_test_bar_writel() argument
135 writel(value, test->bar[bar] + offset); in pci_endpoint_test_bar_writel()
140 struct pci_endpoint_test *test = dev_id; in pci_endpoint_test_irqhandler() local
143 reg = pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_STATUS); in pci_endpoint_test_irqhandler()
[all …]
/Linux-v5.4/lib/
Dtest_printf.c132 #define test(expect, fmt, ...) \ macro
141 test("", &nul); in test_basic()
142 test("100%", "100%%"); in test_basic()
143 test("xxx%yyy", "xxx%cyyy", '%'); in test_basic()
150 test("0x1234abcd ", "%#-12x", 0x1234abcd); in test_number()
151 test(" 0x1234abcd", "%#12x", 0x1234abcd); in test_number()
152test("0|001| 12|+123| 1234|-123|-1234", "%d|%03d|%3d|%+d|% d|%+d|% d", 0, 1, 12, 123, 1234, -123, … in test_number()
153 test("0|1|1|128|255", "%hhu|%hhu|%hhu|%hhu|%hhu", 0, 1, 257, 128, -1); in test_number()
154 test("0|1|1|-128|-1", "%hhd|%hhd|%hhd|%hhd|%hhd", 0, 1, 257, 128, -1); in test_number()
155 test("2015122420151225", "%ho%ho%#ho", 1037, 5282, -11627); in test_number()
[all …]
Dcrc32test.c558 } const test[] __initconst = variable
678 bytes += 2*test[i].length; in crc32c_test()
680 crc ^= __crc32c_le(test[i].crc, test_buf + in crc32c_test()
681 test[i].start, test[i].length); in crc32c_test()
690 if (test[i].crc32c_le != __crc32c_le(test[i].crc, test_buf + in crc32c_test()
691 test[i].start, test[i].length)) in crc32c_test()
719 crc_full = __crc32c_le(test[i].crc, test_buf + test[i].start, in crc32c_combine_test()
720 test[i].length); in crc32c_combine_test()
721 for (j = 0; j <= test[i].length; ++j) { in crc32c_combine_test()
723 u32 len1 = j, len2 = test[i].length - j; in crc32c_combine_test()
[all …]
Dtest_user_copy.c34 #define test(condition, msg, ...) \ macro
52 if (test(size < 2 * PAGE_SIZE, "buffer too small")) in test_check_nonzero_user()
87 ret |= test(copy_to_user(umem, kmem, size), in test_check_nonzero_user()
96 ret |= test(retval != expected, in test_check_nonzero_user()
113 ret = test(umem_src == NULL, "kmalloc failed"); in test_copy_struct_from_user()
118 ret = test(expected == NULL, "kmalloc failed"); in test_copy_struct_from_user()
124 ret |= test(copy_to_user(umem, umem_src, size), in test_copy_struct_from_user()
134 ret |= test(copy_struct_from_user(kmem, ksize, umem, usize), in test_copy_struct_from_user()
136 ret |= test(memcmp(kmem, expected, ksize), in test_copy_struct_from_user()
147 ret |= test(copy_struct_from_user(kmem, ksize, umem, usize), in test_copy_struct_from_user()
[all …]
/Linux-v5.4/drivers/mmc/core/
Dmmc_test.c177 static int mmc_test_set_blksize(struct mmc_test_card *test, unsigned size) in mmc_test_set_blksize() argument
179 return mmc_set_blocklen(test->card, size); in mmc_test_set_blksize()
188 static void mmc_test_prepare_sbc(struct mmc_test_card *test, in mmc_test_prepare_sbc() argument
191 struct mmc_card *card = test->card; in mmc_test_prepare_sbc()
208 static void mmc_test_prepare_mrq(struct mmc_test_card *test, in mmc_test_prepare_mrq() argument
224 if (!mmc_card_blockaddr(test->card)) in mmc_test_prepare_mrq()
243 mmc_test_prepare_sbc(test, mrq, blocks); in mmc_test_prepare_mrq()
245 mmc_set_data_timeout(mrq->data, test->card); in mmc_test_prepare_mrq()
257 static int mmc_test_wait_busy(struct mmc_test_card *test) in mmc_test_wait_busy() argument
267 cmd.arg = test->card->rca << 16; in mmc_test_wait_busy()
[all …]
/Linux-v5.4/tools/perf/tests/attr/
DREADME1 The struct perf_event_attr test (attr tests) support
28 the test definition, executes it and checks results.
32 Directory containing all attr test definitions.
35 perf record kill (test-record-basic)
36 perf record -b kill (test-record-branch-any)
37 perf record -j any kill (test-record-branch-filter-any)
38 perf record -j any_call kill (test-record-branch-filter-any_call)
39 perf record -j any_ret kill (test-record-branch-filter-any_ret)
40 perf record -j hv kill (test-record-branch-filter-hv)
41 perf record -j ind_call kill (test-record-branch-filter-ind_call)
[all …]
/Linux-v5.4/tools/testing/selftests/bpf/
Dtest_progs.c41 static void dump_test_log(const struct prog_test_def *test, bool failed) in dump_test_log() argument
48 if (env.verbose || test->force_log || failed) { in dump_test_log()
62 if (env.test->skip_cnt) { in skip_account()
64 env.test->skip_cnt = 0; in skip_account()
70 struct prog_test_def *test = env.test; in test__end_subtest() local
71 int sub_error_cnt = test->error_cnt - test->old_error_cnt; in test__end_subtest()
79 dump_test_log(test, sub_error_cnt); in test__end_subtest()
82 test->test_num, test->subtest_num, in test__end_subtest()
83 test->subtest_name, sub_error_cnt ? "FAIL" : "OK"); in test__end_subtest()
88 struct prog_test_def *test = env.test; in test__start_subtest() local
[all …]
Dtest_sock_addr.c55 typedef int (*load_fn)(const struct sock_addr_test *test);
86 static int bind4_prog_load(const struct sock_addr_test *test);
87 static int bind6_prog_load(const struct sock_addr_test *test);
88 static int connect4_prog_load(const struct sock_addr_test *test);
89 static int connect6_prog_load(const struct sock_addr_test *test);
90 static int sendmsg_allow_prog_load(const struct sock_addr_test *test);
91 static int sendmsg_deny_prog_load(const struct sock_addr_test *test);
92 static int recvmsg_allow_prog_load(const struct sock_addr_test *test);
93 static int recvmsg_deny_prog_load(const struct sock_addr_test *test);
94 static int sendmsg4_rw_asm_prog_load(const struct sock_addr_test *test);
[all …]
Dtest_section_names.c149 static int test_prog_type_by_name(const struct sec_name_test *test) in test_prog_type_by_name() argument
155 rc = libbpf_prog_type_by_name(test->sec_name, &prog_type, in test_prog_type_by_name()
158 if (rc != test->expected_load.rc) { in test_prog_type_by_name()
159 warnx("prog: unexpected rc=%d for %s", rc, test->sec_name); in test_prog_type_by_name()
166 if (prog_type != test->expected_load.prog_type) { in test_prog_type_by_name()
168 test->sec_name); in test_prog_type_by_name()
172 if (expected_attach_type != test->expected_load.expected_attach_type) { in test_prog_type_by_name()
174 expected_attach_type, test->sec_name); in test_prog_type_by_name()
181 static int test_attach_type_by_name(const struct sec_name_test *test) in test_attach_type_by_name() argument
186 rc = libbpf_attach_type_by_name(test->sec_name, &attach_type); in test_attach_type_by_name()
[all …]
Dtest_verifier.c617 static void do_test_fixup(struct bpf_test *test, enum bpf_prog_type prog_type, in do_test_fixup() argument
620 int *fixup_map_hash_8b = test->fixup_map_hash_8b; in do_test_fixup()
621 int *fixup_map_hash_48b = test->fixup_map_hash_48b; in do_test_fixup()
622 int *fixup_map_hash_16b = test->fixup_map_hash_16b; in do_test_fixup()
623 int *fixup_map_array_48b = test->fixup_map_array_48b; in do_test_fixup()
624 int *fixup_map_sockmap = test->fixup_map_sockmap; in do_test_fixup()
625 int *fixup_map_sockhash = test->fixup_map_sockhash; in do_test_fixup()
626 int *fixup_map_xskmap = test->fixup_map_xskmap; in do_test_fixup()
627 int *fixup_map_stacktrace = test->fixup_map_stacktrace; in do_test_fixup()
628 int *fixup_prog1 = test->fixup_prog1; in do_test_fixup()
[all …]
/Linux-v5.4/tools/testing/selftests/powerpc/vphn/
Dtest-vphn.c21 static struct test { struct
366 static int test_one(struct test *test) in test_one() argument
371 vphn_unpack_associativity(test->input, output); in test_one()
374 if (len != test->expected[0]) { in test_one()
375 printf("expected %d elements, got %d\n", test->expected[0], in test_one()
382 if (val != test->expected[i]) { in test_one()
384 test->expected[i]); in test_one()
394 static struct test *test; in test_vphn() local
396 for (test = all_tests; test->descr; test++) { in test_vphn()
399 ret = test_one(test); in test_vphn()
[all …]
/Linux-v5.4/tools/testing/selftests/ftrace/
DREADME5 shell scripts for testing. Feel free to add new test cases.
17 # ./ftracetest test.d/basic3.tc
21 # ./ftracetest test.d/kprobe/
26 Copy test.d/template to your testcase (whose filename must have *.tc
27 extension) and rewrite the test description line.
36 * You can add a directory for your testcases under test.d/ if needed.
38 * The test cases should run on dash (busybox shell) for testing on
42 command fails, the test will be terminated immediately.
52 * PASS: The test succeeded as expected. The test which exits with 0 is
53 counted as passed test.
[all …]
/Linux-v5.4/samples/kfifo/
Dbytestream-example.c40 static struct kfifo test; variable
42 static DECLARE_KFIFO(test, unsigned char, FIFO_SIZE);
61 kfifo_in(&test, "hello", 5); in testfunc()
65 kfifo_put(&test, i); in testfunc()
68 printk(KERN_INFO "fifo len: %u\n", kfifo_len(&test)); in testfunc()
71 i = kfifo_out(&test, buf, 5); in testfunc()
75 ret = kfifo_out(&test, buf, 2); in testfunc()
78 ret = kfifo_in(&test, buf, ret); in testfunc()
83 kfifo_skip(&test); in testfunc()
86 for (i = 20; kfifo_put(&test, i); i++) in testfunc()
[all …]
Drecord-example.c48 struct kfifo_rec_ptr_1 test; variable
53 static mytest test; variable
78 kfifo_in(&test, &hello, sizeof(hello)); in testfunc()
81 printk(KERN_INFO "fifo peek len: %u\n", kfifo_peek_len(&test)); in testfunc()
86 kfifo_in(&test, buf, i + 1); in testfunc()
91 kfifo_skip(&test); in testfunc()
93 printk(KERN_INFO "fifo len: %u\n", kfifo_len(&test)); in testfunc()
96 ret = kfifo_out_peek(&test, buf, sizeof(buf)); in testfunc()
102 while (!kfifo_is_empty(&test)) { in testfunc()
103 ret = kfifo_out(&test, buf, sizeof(buf)); in testfunc()
[all …]
Dinttype-example.c40 static DECLARE_KFIFO_PTR(test, int);
42 static DEFINE_KFIFO(test, int, FIFO_SIZE);
62 kfifo_put(&test, i); in testfunc()
65 printk(KERN_INFO "fifo len: %u\n", kfifo_len(&test)); in testfunc()
68 ret = kfifo_out(&test, buf, 2); in testfunc()
71 ret = kfifo_in(&test, buf, ret); in testfunc()
76 kfifo_skip(&test); in testfunc()
79 for (i = 20; kfifo_put(&test, i); i++) in testfunc()
82 printk(KERN_INFO "queue len: %u\n", kfifo_len(&test)); in testfunc()
85 if (kfifo_peek(&test, &i)) in testfunc()
[all …]
/Linux-v5.4/tools/perf/arch/x86/include/
Darch-tests.h6 struct test;
9 int test__rdpmc(struct test *test __maybe_unused, int subtest);
10 int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest);
11 int test__insn_x86(struct test *test __maybe_unused, int subtest);
12 int test__intel_pt_pkt_decoder(struct test *test, int subtest);
13 int test__bp_modify(struct test *test, int subtest);
22 extern struct test arch_tests[];
/Linux-v5.4/drivers/of/unittest-data/
Dtests-overlay.dtsi7 /* test bus */
8 unittest_test_bus: test-bus {
13 unittest100: test-unittest100 {
19 unittest101: test-unittest101 {
25 unittest0: test-unittest0 {
31 unittest1: test-unittest1 {
37 unittest2: test-unittest2 {
43 unittest3: test-unittest3 {
49 unittest5: test-unittest5 {
55 unittest6: test-unittest6 {
[all …]
/Linux-v5.4/drivers/spi/
Dspi-loopback-test.c529 struct spi_test *test) in spi_test_check_elapsed_time() argument
535 for (i = 0; i < test->transfer_count; i++) { in spi_test_check_elapsed_time()
536 struct spi_transfer *xfer = test->transfers + i; in spi_test_check_elapsed_time()
547 if (test->elapsed_time < estimated_time) { in spi_test_check_elapsed_time()
550 test->elapsed_time, estimated_time); in spi_test_check_elapsed_time()
664 struct spi_test *test) in spi_test_fill_pattern() argument
666 struct spi_transfer *xfers = test->transfers; in spi_test_fill_pattern()
680 for (i = 0; i < test->transfer_count; i++) { in spi_test_fill_pattern()
692 switch (test->fill_option) { in spi_test_fill_pattern()
694 *tx_buf = test->fill_pattern; in spi_test_fill_pattern()
[all …]
/Linux-v5.4/drivers/usb/musb/
Dmusb_debugfs.c118 unsigned test; in musb_test_mode_show() local
121 test = musb_readb(musb->mregs, MUSB_TESTMODE); in musb_test_mode_show()
125 if (test == (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_FS)) in musb_test_mode_show()
128 else if (test == (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_HS)) in musb_test_mode_show()
131 else if (test == MUSB_TEST_FORCE_HOST) in musb_test_mode_show()
134 else if (test == MUSB_TEST_FIFO_ACCESS) in musb_test_mode_show()
137 else if (test == MUSB_TEST_FORCE_FS) in musb_test_mode_show()
140 else if (test == MUSB_TEST_FORCE_HS) in musb_test_mode_show()
143 else if (test == MUSB_TEST_PACKET) in musb_test_mode_show()
146 else if (test == MUSB_TEST_K) in musb_test_mode_show()
[all …]
/Linux-v5.4/tools/testing/scatterlist/
Dmain.c23 struct test { in main() struct
30 } *test, tests[] = { in main() local
55 for (i = 0, test = tests; test->expected_segments; test++, i++) { in main()
60 set_pages(pages, test->pfn, test->num_pages); in main()
62 ret = __sg_alloc_table_from_pages(&st, pages, test->num_pages, in main()
63 0, test->size, test->max_seg, in main()
65 assert(ret == test->alloc_ret); in main()
67 if (test->alloc_ret) in main()
70 assert(st.nents == test->expected_segments); in main()
71 assert(st.orig_nents == test->expected_segments); in main()
/Linux-v5.4/tools/perf/Documentation/
Dperf-test.txt1 perf-test(1)
6 perf-test - Runs sanity tests.
11 'perf test [<options>] [{list <test-name-fragment>|[<test-name-fragments>|<test-numbers>]}]'
18 To get a list of available tests use 'perf test list', specifying a test name
21 To run just specific tests, inform test name fragments or the numbers obtained
22 from 'perf test list'.
36 Do not fork child for each test, run all tests within single process.

12345678910>>...37