unified/test: Adapt object tracing tests to unified kernel
Change-Id: I657410d64432d2d09938bd19a4db482bc1f23529 Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
parent
e7d2cc216d
commit
ee842535a4
5 changed files with 50 additions and 2 deletions
|
@ -38,6 +38,26 @@
|
||||||
#define IPM_THREAD 0
|
#define IPM_THREAD 0
|
||||||
#endif /* CONFIG_IPM_CONSOLE_RECEIVER && CONFIG_PRINTK*/
|
#endif /* CONFIG_IPM_CONSOLE_RECEIVER && CONFIG_PRINTK*/
|
||||||
|
|
||||||
|
#if defined(CONFIG_KERNEL_V2)
|
||||||
|
|
||||||
|
/* Must account for:
|
||||||
|
* N Philosopher threads
|
||||||
|
* 1 Object monitor thread
|
||||||
|
* 1 System idle thread
|
||||||
|
* 1 System workqueue thread
|
||||||
|
* 1 IPM console thread
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TOTAL_THREADS (N_PHILOSOPHERS + 3 + IPM_THREAD)
|
||||||
|
|
||||||
|
#define OBJ_LIST_NAME k_mutex
|
||||||
|
#define OBJ_LIST_TYPE struct k_mutex
|
||||||
|
|
||||||
|
/* unified kernel doesn't support task-specific tracing, so it always passes */
|
||||||
|
#define test_task_tracing() 1
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
/* Must account for:
|
/* Must account for:
|
||||||
* N Philosopher tasks
|
* N Philosopher tasks
|
||||||
* 1 Object monitor task
|
* 1 Object monitor task
|
||||||
|
@ -80,11 +100,16 @@ static inline int test_task_tracing(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_KERNEL_V2 */
|
||||||
|
|
||||||
static inline int test_thread_monitor(void)
|
static inline int test_thread_monitor(void)
|
||||||
{
|
{
|
||||||
int obj_counter = 0;
|
int obj_counter = 0;
|
||||||
struct tcs *thread_list = NULL;
|
struct tcs *thread_list = NULL;
|
||||||
|
|
||||||
|
/* wait a bit to allow any initialization-only threads to terminate */
|
||||||
|
task_sleep(100);
|
||||||
|
|
||||||
thread_list = (struct tcs *)SYS_THREAD_MONITOR_HEAD;
|
thread_list = (struct tcs *)SYS_THREAD_MONITOR_HEAD;
|
||||||
while (thread_list != NULL) {
|
while (thread_list != NULL) {
|
||||||
if (thread_list->prio == -1) {
|
if (thread_list->prio == -1) {
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[test]
|
[test]
|
||||||
tags = core
|
tags = core unified_capable
|
||||||
kernel = micro
|
kernel = micro
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
CONFIG_NANO_TIMEOUTS=y
|
||||||
CONFIG_DEBUG_TRACING_KERNEL_OBJECTS=y
|
CONFIG_DEBUG_TRACING_KERNEL_OBJECTS=y
|
||||||
CONFIG_THREAD_MONITOR=y
|
CONFIG_THREAD_MONITOR=y
|
||||||
|
|
|
@ -38,6 +38,23 @@
|
||||||
#define IPM_THREAD 0
|
#define IPM_THREAD 0
|
||||||
#endif /* CONFIG_IPM_CONSOLE_RECEIVER && CONFIG_PRINTK*/
|
#endif /* CONFIG_IPM_CONSOLE_RECEIVER && CONFIG_PRINTK*/
|
||||||
|
|
||||||
|
#if defined(CONFIG_KERNEL_V2)
|
||||||
|
|
||||||
|
/* Must account for:
|
||||||
|
* N Philosopher threads
|
||||||
|
* 1 Object monitor thread
|
||||||
|
* 1 System idle thread
|
||||||
|
* 1 System workqueue thread
|
||||||
|
* 1 IPM console thread
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TOTAL_THREADS (N_PHILOSOPHERS + 3 + IPM_THREAD)
|
||||||
|
|
||||||
|
#define OBJ_LIST_NAME k_sem
|
||||||
|
#define OBJ_LIST_TYPE struct k_sem
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
/* Must account for:
|
/* Must account for:
|
||||||
* N Philosopher fibers
|
* N Philosopher fibers
|
||||||
* 1 Object monitor fiber
|
* 1 Object monitor fiber
|
||||||
|
@ -52,11 +69,16 @@
|
||||||
#define OBJ_LIST_NAME nano_sem
|
#define OBJ_LIST_NAME nano_sem
|
||||||
#define OBJ_LIST_TYPE struct nano_sem
|
#define OBJ_LIST_TYPE struct nano_sem
|
||||||
|
|
||||||
|
#endif /* CONFIG_KERNEL_V2 */
|
||||||
|
|
||||||
static inline int test_thread_monitor(void)
|
static inline int test_thread_monitor(void)
|
||||||
{
|
{
|
||||||
int obj_counter = 0;
|
int obj_counter = 0;
|
||||||
struct tcs *thread_list = NULL;
|
struct tcs *thread_list = NULL;
|
||||||
|
|
||||||
|
/* wait a bit to allow any initialization-only threads to terminate */
|
||||||
|
fiber_sleep(100);
|
||||||
|
|
||||||
thread_list = (struct tcs *)SYS_THREAD_MONITOR_HEAD;
|
thread_list = (struct tcs *)SYS_THREAD_MONITOR_HEAD;
|
||||||
while (thread_list != NULL) {
|
while (thread_list != NULL) {
|
||||||
if (thread_list->prio == -1) {
|
if (thread_list->prio == -1) {
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[test]
|
[test]
|
||||||
tags = core
|
tags = core unified_capable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue