build: Add STACK_USAGE(-fstack-usage) to assist the stack analysis
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
ab059a7ba3
commit
fd64e38072
7 changed files with 28 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -27,6 +27,7 @@
|
||||||
*.wsp
|
*.wsp
|
||||||
*.ddc
|
*.ddc
|
||||||
*.dds
|
*.dds
|
||||||
|
*.su
|
||||||
*~
|
*~
|
||||||
.depend
|
.depend
|
||||||
/.config
|
/.config
|
||||||
|
|
7
Kconfig
7
Kconfig
|
@ -1945,6 +1945,13 @@ config STACK_CANARIES
|
||||||
Enabling this option can result in a significant increase
|
Enabling this option can result in a significant increase
|
||||||
in footprint and an associated decrease in performance.
|
in footprint and an associated decrease in performance.
|
||||||
|
|
||||||
|
config STACK_USAGE
|
||||||
|
bool "Generate stack usage information"
|
||||||
|
help
|
||||||
|
Generate an extra file that specifies the maximum amount of stack used,
|
||||||
|
on a per-function basis. Please use https://github.com/HBehrens/puncover
|
||||||
|
or tools/showstack.sh to generate the more useful report.
|
||||||
|
|
||||||
config ARCH_HAVE_HEAPCHECK
|
config ARCH_HAVE_HEAPCHECK
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -54,6 +54,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
||||||
ARCHOPTIMIZATION += -fstack-protector-all
|
ARCHOPTIMIZATION += -fstack-protector-all
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_STACK_USAGE),y)
|
||||||
|
ARCHOPTIMIZATION += -fstack-usage
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
||||||
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -63,6 +63,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
||||||
ARCHOPTIMIZATION += -fstack-protector-all
|
ARCHOPTIMIZATION += -fstack-protector-all
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_STACK_USAGE),y)
|
||||||
|
ARCHOPTIMIZATION += -fstack-usage
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
||||||
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -75,6 +75,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
||||||
ARCHOPTIMIZATION += -fstack-protector-all
|
ARCHOPTIMIZATION += -fstack-protector-all
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_STACK_USAGE),y)
|
||||||
|
ARCHOPTIMIZATION += -fstack-usage
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
||||||
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -75,6 +75,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
||||||
ARCHOPTIMIZATION += -fstack-protector-all
|
ARCHOPTIMIZATION += -fstack-protector-all
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_STACK_USAGE),y)
|
||||||
|
ARCHOPTIMIZATION += -fstack-usage
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
||||||
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -67,6 +67,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
||||||
ARCHOPTIMIZATION += -fstack-protector-all
|
ARCHOPTIMIZATION += -fstack-protector-all
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_STACK_USAGE),y)
|
||||||
|
ARCHOPTIMIZATION += -fstack-usage
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
|
||||||
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue