• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/04-Jan-2025-244168

CMakeLists.txtD04-Jan-2025262 118

KconfigD04-Jan-2025971 4738

README.rstD04-Jan-20251.8 KiB4636

prj-assert.confD04-Jan-2025220 72

prj.confD04-Jan-2025125 75

testcase.yamlD04-Jan-2025500 2221

README.rst

1POSIX Thread Benchmark
2######################
3
4Overview
5********
6
7This benchmark creates and joins as many threads as possible within a configurable time window.
8It provides a rough comparison Zephyr's POSIX threads (pthreads) with Zephyr's kernel threads
9(k_threads) API, highlighting the overhead of the POSIX. Ideally, this overhead would shrink over
10time.
11
12Sample output of the benchmark::
13
14    *** Booting Zephyr OS build v4.0.0-1410-gfca33facee37 ***
15    ASSERT: y
16    BOARD: qemu_riscv64
17    NUM_CPUS: 1
18    TEST_DELAY_US: 0
19    TEST_DURATION_S: 5
20    SMP: n
21    API, Thread ID, time(s), threads, cores, rate (threads/s/core)
22    k_thread, ALL, 5, 47663, 1, 9532
23    pthread, ALL, 5, 28180, 1, 5636
24    PROJECT EXECUTION SUCCESSFUL
25
26To observe periodic statistics on a per-thread basis in addition to the summary of statistics
27printed at the end of execution, use CONFIG_TEST_PERIODIC_STATS.
28
29Several other options can be tuned on an as-needed basis:
30
31- CONFIG_MP_MAX_NUM_CPUS - Number of CPUs to use in parallel.
32- CONFIG_TEST_DURATION_S - Number of seconds to run the test.
33- CONFIG_TEST_DELAY_US - Microseconds to delay between pthread join and create.
34- CONFIG_TEST_KTHREADS - Exercise k_threads in the test app.
35- CONFIG_TEST_PTHREADS - Exercise pthreads in the test app.
36- CONFIG_TEST_STACK_SIZE - Size of each thread stack in this test.
37
38The following table summarizes the purposes of the different extra
39configuration files that are available to be used with this benchmark.
40A tester may mix and match them allowing them different scenarios to
41be easily compared the default.
42
43+-----------------------------+----------------------------------------+
44| prj-assert.conf             | Enable assertions for API verification |
45+-----------------------------+----------------------------------------+
46