RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Files | Data Structures | Macros | Typedefs | Functions | Variables
Stack Checker Mechanism

Files

file  stackchk.h
 This header file provides the Stack Checker API.
 
file  check.c
 This file contains the Stack Overflow Check user extension set.
 

Data Structures

struct  rtems_stack_checker_info
 Stack information provided by the stack checker. More...
 

Macros

#define RTEMS_STACK_CHECKER_EXTENSION
 Stack Checker Extension Set Definition.
 

Typedefs

typedef void(* rtems_stack_checker_visitor) (const rtems_stack_checker_info *info, void *arg)
 Visitor routines invoked by rtems_stack_checker_iterate() shall have this type.
 
typedef void(* Stack_checker_Reporter_handler) (const rtems_tcb *running, bool pattern_ok)
 The Stack Checker Reporter Initialization Handler.
 

Functions

bool rtems_stack_checker_is_blown (void)
 Checks if current task is blown its stack.
 
void rtems_stack_checker_report_usage (void)
 Print the stack usage report using printk.
 
void rtems_stack_checker_report_usage_with_plugin (const rtems_printer *printer)
 Print the stack usage report using caller's routine.
 
void rtems_stack_checker_iterate (rtems_stack_checker_visitor visit, void *arg)
 Iterates over all stacks used by the system and invokes the visitor routine for each stack.
 
bool rtems_stack_checker_create_extension (rtems_tcb *running, rtems_tcb *the_thread)
 Stack Checker Task Create Extension.
 
void rtems_stack_checker_begin_extension (rtems_tcb *executing)
 
void rtems_stack_checker_switch_extension (rtems_tcb *running, rtems_tcb *heir)
 Stack Checker Task Context Switch Extension.
 
void rtems_stack_checker_reporter_quiet (const rtems_tcb *running, bool pattern_ok)
 A Quiet Version of Stack Checker Reporter.
 
void rtems_stack_checker_reporter_print_details (const rtems_tcb *running, bool pattern_ok)
 The Default Function to Report a Blown Stack.
 

Variables

const Stack_checker_Reporter_handler Stack_checker_Reporter
 The Stack Checker Reporter Initialization Handler.
 

Detailed Description

Macro Definition Documentation

◆ RTEMS_STACK_CHECKER_EXTENSION

#define RTEMS_STACK_CHECKER_EXTENSION
Value:
{ \
rtems_stack_checker_create_extension, /* rtems_task_create */ \
0, /* rtems_task_start */ \
0, /* rtems_task_restart */ \
0, /* rtems_task_delete */ \
rtems_stack_checker_begin_extension, /* task_begin */ \
0, /* task_exitted */ \
0, /* fatal */ \
0 /* terminate */ \
}
void rtems_stack_checker_switch_extension(rtems_tcb *running, rtems_tcb *heir)
Stack Checker Task Context Switch Extension.
Definition: check.c:326
bool rtems_stack_checker_create_extension(rtems_tcb *running, rtems_tcb *the_thread)
Stack Checker Task Create Extension.

Stack Checker Extension Set Definition.

This macro defines the user extension handler set for the stack checker. This macro is normally only used by confdefs.h.

Typedef Documentation

◆ rtems_stack_checker_visitor

typedef void(* rtems_stack_checker_visitor) (const rtems_stack_checker_info *info, void *arg)

Visitor routines invoked by rtems_stack_checker_iterate() shall have this type.

Parameters
[in]infois the stack information.
[in]argis the argument passed to rtems_stack_checker_iterate().

◆ Stack_checker_Reporter_handler

typedef void(* Stack_checker_Reporter_handler) (const rtems_tcb *running, bool pattern_ok)

The Stack Checker Reporter Initialization Handler.

Parameters
[in]runningrunning points to the currently executing thread which is being context switched out.
[in]pattern_okbool variable to check if the pattern is still valid or not.

Function Documentation

◆ rtems_stack_checker_create_extension()

bool rtems_stack_checker_create_extension ( rtems_tcb running,
rtems_tcb the_thread 
)

Stack Checker Task Create Extension.

This method is the task create extension for the stack checker.

Parameters
[in]runningpoints to the currently executing task
[in]the_threadpoints to the newly created task
Note
If this this the first task created, the stack checker will automatically intialize itself.

◆ rtems_stack_checker_is_blown()

bool rtems_stack_checker_is_blown ( void  )

Checks if current task is blown its stack.

This method is used to determine if the current stack pointer of the currently executing task is within bounds.

Return values
Thismethod returns true if the currently executing task has blown its stack.

◆ rtems_stack_checker_iterate()

void rtems_stack_checker_iterate ( rtems_stack_checker_visitor  visit,
void *  arg 
)

Iterates over all stacks used by the system and invokes the visitor routine for each stack.

This method prints a stack usage report for the curently executing task.

Parameters
[in]visitoris the visitor routine invoked for each stack.
[in]argis the argument passed to each visitor routine invocation during the iteration.

◆ rtems_stack_checker_report_usage()

void rtems_stack_checker_report_usage ( void  )

Print the stack usage report using printk.

This method prints a stack usage report for the curently executing task.

Note
It uses printk to print the report.

◆ rtems_stack_checker_report_usage_with_plugin()

void rtems_stack_checker_report_usage_with_plugin ( const rtems_printer printer)

Print the stack usage report using caller's routine.

This method prints a stack usage report for the curently executing task.

Parameters
[in]contextis the context to pass to the print handler
[in]printis the print handler
Note
It uses the caller's routine to print the report.

◆ rtems_stack_checker_reporter_print_details()

void rtems_stack_checker_reporter_print_details ( const rtems_tcb running,
bool  pattern_ok 
)

The Default Function to Report a Blown Stack.

Parameters
[in]runningrunning points to the currently executing thread which is being context switched out.
[in]pattern_okbool variable to check if the pattern is still valid or not

◆ rtems_stack_checker_reporter_quiet()

void rtems_stack_checker_reporter_quiet ( const rtems_tcb running,
bool  pattern_ok 
)

A Quiet Version of Stack Checker Reporter.

Parameters
[in]runningrunning points to the currently executing thread which is being context switched out.
[in]pattern_okbool variable to check if the pattern is still valid or not

◆ rtems_stack_checker_switch_extension()

void rtems_stack_checker_switch_extension ( rtems_tcb running,
rtems_tcb heir 
)

Stack Checker Task Context Switch Extension.

This method is the task context switch extension for the stack checker.

Parameters
[in]runningpoints to the currently executing task which is being context switched out
[in]heirpoints to the heir task which we are switching to
Note
This is called from the internal method _Thread_Dispatch.

Variable Documentation

◆ Stack_checker_Reporter

const Stack_checker_Reporter_handler Stack_checker_Reporter
extern

The Stack Checker Reporter Initialization Handler.

Application provided via <rtems/confdefs.h>