zephyrproject-rtos/zephyr

syscall stack usage report

Open

#27,189 opened on Jul 27, 2020

View on GitHub
 (4 comments) (0 reactions) (1 assignee)C (15,249 stars) (9,144 forks)batch import
EnhancementGood first issuearea: Memory Managementarea: Memory Protection

Description

Is your enhancement proposal related to a problem? Please describe. Syscalls run on fixed-sized privilege elevation stacks. There is a hard limit on how much stack space a system call can use because of this. We don't have good data on how much stack syscalls actually use.

Describe the solution you'd like I'd like to be able to use CONFIG_STACK_USAGE to be able to generate a report, for every API exposed with __syscall, the upper bound on stack usage. Outliers that exceed the default privilege stack size should be flagged as issues.

This usage data must be from the syscall perspective; the measurements have to start from the syscall trap handler, through the verification and marshalling functions. We could probably get by with starting measurements at each mrsh function for every syscall; trap handler overhead would be a constant value added to the result.

Contributor guide