Zephyr Project API 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ztress.h File Reference

Zephyr testing framework ztress macros. More...

#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>

Go to the source code of this file.

Data Structures

struct  ztress_context_data
 

Macros

#define ZTRESS_ID_THREAD   0
 
#define ZTRESS_ID_K_TIMER   1
 
#define ZTRESS_TIMER(handler, user_data, exec_cnt, init_timeout)    (ZTRESS_ID_K_TIMER, handler, user_data, exec_cnt, 0, init_timeout)
 Descriptor of a k_timer handler execution context.
 
#define ZTRESS_THREAD(handler, user_data, exec_cnt, preempt_cnt, init_timeout)    (ZTRESS_ID_THREAD, handler, user_data, exec_cnt, preempt_cnt, init_timeout)
 Descriptor of a thread execution context.
 
#define ZTRESS_CONTEXT_INITIALIZER(_handler, _user_data, _exec_cnt, _preempt_cnt, _t)
 Initialize context structure.
 
#define ZTRESS_EXECUTE(...)
 Setup and run stress test.
 

Typedefs

typedef bool(* ztress_handler) (void *user_data, uint32_t cnt, bool last, int prio)
 User handler called in one of the configured contexts.
 

Functions

int ztress_execute (struct ztress_context_data *timer_data, struct ztress_context_data *thread_data, size_t cnt)
 Execute contexts.
 
void ztress_abort (void)
 Abort ongoing stress test.
 
void ztress_set_timeout (k_timeout_t t)
 Set test timeout.
 
void ztress_report (void)
 Print last test report.
 
int ztress_exec_count (uint32_t id)
 Get number of executions of a given context in the last test.
 
int ztress_preempt_count (uint32_t id)
 Get number of preemptions of a given context in the last test.
 
uint32_t ztress_optimized_ticks (uint32_t id)
 Get optimized timeout base of a given context in the last test.
 

Detailed Description

Zephyr testing framework ztress macros.

Macro Definition Documentation

◆ ZTRESS_ID_K_TIMER

#define ZTRESS_ID_K_TIMER   1

◆ ZTRESS_ID_THREAD

#define ZTRESS_ID_THREAD   0