mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:06:09 +08:00
arch/x86_64:Add runtime stack size analysis
Add runtime stack size analysis tool Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
This commit is contained in:
@@ -150,7 +150,7 @@ static inline_function bool up_interrupt_context(void)
|
|||||||
{
|
{
|
||||||
bool flag;
|
bool flag;
|
||||||
__asm__ volatile("movb %%gs:(%c1), %0"
|
__asm__ volatile("movb %%gs:(%c1), %0"
|
||||||
: "=qm" (flag)
|
: "=qr" (flag)
|
||||||
: "i" (offsetof(struct intel64_cpu_s,
|
: "i" (offsetof(struct intel64_cpu_s,
|
||||||
interrupt_context)));
|
interrupt_context)));
|
||||||
return flag;
|
return flag;
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ if(${CONFIG_STACK_USAGE_WARNING})
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_ARCH_INSTRUMENT_ALL)
|
||||||
|
add_compile_options(-finstrument-functions)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(CONFIG_COVERAGE_ALL)
|
if(CONFIG_COVERAGE_ALL)
|
||||||
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
|
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -71,6 +71,12 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
|
|||||||
ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
|
ARCHOPTIMIZATION += -Wstack-usage=$(CONFIG_STACK_USAGE_WARNING)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Instrumentation options
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARCH_INSTRUMENT_ALL),y)
|
||||||
|
ARCHOPTIMIZATION += -finstrument-functions
|
||||||
|
endif
|
||||||
|
|
||||||
ARCHCFLAGS += -fno-common -Wno-attributes
|
ARCHCFLAGS += -fno-common -Wno-attributes
|
||||||
ARCHCXXFLAGS += -fno-common -Wno-attributes -nostdinc++
|
ARCHCXXFLAGS += -fno-common -Wno-attributes -nostdinc++
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ uint64_t *irq_handler(uint64_t *regs, uint64_t irq_no)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
nosanitize_address
|
noinstrument_function nosanitize_address
|
||||||
uint64_t *irq_xcp_regs(void)
|
uint64_t *irq_xcp_regs(void)
|
||||||
{
|
{
|
||||||
/* This must be the simplest as possible, so we not use too much registers.
|
/* This must be the simplest as possible, so we not use too much registers.
|
||||||
|
|||||||
Reference in New Issue
Block a user