mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
parisc,metag: Implement CONFIG_DEBUG_STACK_USAGE option
On parisc and metag the stack grows upwards, so for those we need to scan the stack downwards in order to calculate how much stack a process has used. Tested on a 64bit parisc kernel. Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
56649be9e6
commit
6c31da3464
2 changed files with 9 additions and 1 deletions
|
|
@ -2870,10 +2870,18 @@ static inline unsigned long stack_not_used(struct task_struct *p)
|
|||
unsigned long *n = end_of_stack(p);
|
||||
|
||||
do { /* Skip over canary */
|
||||
# ifdef CONFIG_STACK_GROWSUP
|
||||
n--;
|
||||
# else
|
||||
n++;
|
||||
# endif
|
||||
} while (!*n);
|
||||
|
||||
# ifdef CONFIG_STACK_GROWSUP
|
||||
return (unsigned long)end_of_stack(p) - (unsigned long)n;
|
||||
# else
|
||||
return (unsigned long)n - (unsigned long)end_of_stack(p);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
extern void set_task_stack_end_magic(struct task_struct *tsk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue