Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion testing/ostest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ if(CONFIG_TESTING_OSTEST)
list(APPEND SRCS nxevent.c)
endif()

if(CONFIG_ARCH_HAVE_PERF_EVENTS)
# perf_gettime() and perf_getfreq() live in the kernel and are not system
# calls, so only a flat build can reach them from here.

if(CONFIG_ARCH_HAVE_PERF_EVENTS AND CONFIG_BUILD_FLAT)
list(APPEND SRCS perf_gettime.c)
endif()

Expand Down
5 changes: 5 additions & 0 deletions testing/ostest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ CSRCS += nxevent.c
endif
endif

# perf_gettime() and perf_getfreq() live in the kernel and are not system
# calls, so only a flat build can reach them from here.

ifeq ($(CONFIG_ARCH_HAVE_PERF_EVENTS),y)
ifeq ($(CONFIG_BUILD_FLAT),y)
CSRCS += perf_gettime.c
endif
endif

ifeq ($(CONFIG_BUILD_FLAT),y)
CSRCS += wdog.c spinlock.c
Expand Down
2 changes: 1 addition & 1 deletion testing/ostest/ostest.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void spinlock_test(void);

/* perf_gettime.c ***********************************************************/

#ifdef CONFIG_ARCH_HAVE_PERF_EVENTS
#if defined(CONFIG_ARCH_HAVE_PERF_EVENTS) && defined(CONFIG_BUILD_FLAT)
void perf_gettime_test(void);
#endif

Expand Down
3 changes: 2 additions & 1 deletion testing/ostest/ostest_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ static int user_main(int argc, char *argv[])
check_test_memory_usage();
#endif

#if defined(CONFIG_ARCH_PERF_EVENTS) && !defined(CONFIG_ARCH_PERF_EVENTS_USER_ACCESS)
#if defined(CONFIG_ARCH_PERF_EVENTS) && \
!defined(CONFIG_ARCH_PERF_EVENTS_USER_ACCESS) && defined(CONFIG_BUILD_FLAT)
/* Verify performance event time counter */

printf("\nuser_main: performance event time counter test\n");
Expand Down
Loading