nuttx-apps/testing/ostest
Marco Casaroli 2631d3e59a testing/ostest: build the perf test only where it can link
perf_gettime() and perf_getfreq() are kernel functions, defined in
sched/clock/clock_perf.c.  Neither appears in syscall.csv, and libc supplies
only perf_gettime(), under CONFIG_ARCH_HAVE_PERF_EVENTS_USER_ACCESS.  So a
protected or kernel build cannot resolve either of them from user space:

  ostest/perf_gettime.c:91:  undefined reference to `perf_gettime'
  ostest/perf_gettime.c:184: undefined reference to `perf_getfreq'
  make[1]: *** [nuttx_user.elf] Error 1

The call in user_main() is guarded by CONFIG_ARCH_PERF_EVENTS &&
!CONFIG_ARCH_PERF_EVENTS_USER_ACCESS -- which is exactly the case where the
symbols are kernel-only -- so every such configuration fails to link.
mps3-an547:knsh is one: it sets CONFIG_SCHED_IRQMONITOR, which makes
ARCH_PERF_EVENTS default y.  mps2-an521:knsh escapes only because it sets
neither monitor, leaving ARCH_PERF_EVENTS off, so the call compiles out and
the archive member is never pulled in.

Require CONFIG_BUILD_FLAT, where ostest links against the kernel's own copy.
No configuration that runs the test today stops running it.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 09:49:59 -03:00
..
aio.c nshlib/testing: Fix open() arguments. 2026-05-22 13:39:04 +08:00
barrier.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
cancel.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
CMakeLists.txt testing/ostest: build the perf test only where it can link 2026-07-31 09:49:59 -03:00
cond.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
dev_null.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
fpu.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
getopt.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
hrtimer.c ostest/hrtimer: Update the comments. 2026-02-26 13:42:45 -05:00
Kconfig testing/ostest: create temp passwd file for multiuser test 2026-07-31 01:14:30 +08:00
libc_memmem.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Make.defs testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile testing/ostest: build the perf test only where it can link 2026-07-31 09:49:59 -03:00
mqueue.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
multiuser.c testing/ostest: create temp passwd file for multiuser test 2026-07-31 01:14:30 +08:00
mutex.c ostest: Implement mutex move test functionality 2025-03-24 20:34:54 +08:00
nsem.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
nxevent.c sched/event: add nxevent_getmask tests 2025-09-10 13:59:04 +08:00
ostest.h testing/ostest: build the perf test only where it can link 2026-07-31 09:49:59 -03:00
ostest_main.c testing/ostest: build the perf test only where it can link 2026-07-31 09:49:59 -03:00
perf_gettime.c testing/ostest: Add performance event time counter test 2026-02-02 14:01:00 +08:00
posixtimer.c ostest: Make POSIX timers test work with CONFIG_ENABLE_PARTIAL_SIGNALS 2026-06-16 08:49:22 +02:00
prioinherit.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
pthread_cleanup.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
pthread_exit.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
pthread_rwlock.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
pthread_rwlock_cancel.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
restart.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
rmutex.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
robust.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
roundrobin.c testing/ostest/roundrobin: add compatible for SMP 2025-12-01 19:09:27 +08:00
sched_thread_local.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
schedlock.c Remove unused header files across multiple source files 2025-01-10 21:42:00 +08:00
sem.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
semtimed.c !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-22 13:38:25 +08:00
setjmp.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
setvbuf.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
sigev_thread.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
sighand.c sighand: need block WAKEUP_SIGNAL in current tcb 2026-01-12 00:55:33 +08:00
sighelper.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
signest.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
sigprocmask.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
smp_call.c testing/ostest/smp_call.c: fix smp_call cpu_set inconsistency issue 2025-12-09 09:44:37 -05:00
specific.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
spinlock.c testing/ostest: Fix Coverity for spinlock test. 2026-01-27 22:59:36 +08:00
sporadic.c testing/{ostest,sched/smp}: Remove BOARD_LOOPSPERMSEC references 2026-02-09 09:21:50 +01:00
sporadic2.c testing/{ostest,sched/smp}: Remove BOARD_LOOPSPERMSEC references 2026-02-09 09:21:50 +01:00
suspend.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
timedmqueue.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
timedmutex.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
timedwait.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
tls.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
vfork.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
waitpid.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
wdog.c !apps: replace sclock_t with clock_t and drop redundant time_t/off_t casts 2026-05-11 17:38:32 +08:00
wqueue.c testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00