zephyrproject-rtos/zephyr

syscall stack usage report

Open

#27,189 创建于 2020年7月27日

在 GitHub 查看
 (4 评论) (0 反应) (1 负责人)C (15,249 star) (9,144 fork)batch import
EnhancementGood first issuearea: Memory Managementarea: Memory Protection

描述

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.

贡献者指南