Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Stack Usage Monotoring #15

Open
gerth2 opened this issue Nov 5, 2015 · 0 comments
Open

Implement Stack Usage Monotoring #15

gerth2 opened this issue Nov 5, 2015 · 0 comments
Assignees

Comments

@gerth2
Copy link
Contributor

gerth2 commented Nov 5, 2015

Each process in the RTOS uses a certain amt. of stack space, which varies at runtime with the depth of functions called. Motoring the peak stack usage is crucial to determining how many resources to allocate to each process, and predicting runtime errors from stack overflow.

Add functions and processes to do the following:

  1. After processes are created but before they are started, "Paint" the allocated stack space for the process with a deterministic pattern of bits
  2. At various points during runtime, walk each processes stack from top to bottom to determine the amount of "Undisturbed" stack left (assume that when a process actually uses stack space, it overwrites the deterministic pattern from step 1). The % stack usage is 100*(1-undisturbed_stack/total_stack)

Be sure to check for interactions with the RTOS's existing stack overflow checking functionality (especially method 2):

http://www.freertos.org/Stacks-and-stack-overflow-checking.html

This % usage calculation could likely just be an extension of method 2. Design is up to developer.

Print this info to a new page in the OLED display rotation.

@schandrachary schandrachary self-assigned this Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants