From 1815f1b2aa0a3ff0654f4eb65fdd0a5bdfe8c7b7 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Fri, 5 May 2017 22:58:34 -0400 Subject: Port profiling code, using a new SysTick hook and new CLI commands. --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d8c9593..398e442 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,9 @@ LIBCLI_BLD = $(LIBS_DIR)/libcli LIBTFM_SRC = $(CRYPTECH_ROOT)/sw/thirdparty/libtfm LIBTFM_BLD = $(LIBS_DIR)/libtfm +LIBPROF_SRC = $(LIBS_DIR)/libprof +LIBPROF_BLD = $(LIBS_DIR)/libprof + LIBS = $(MBED_DIR)/libstmf4.a # linker script @@ -105,7 +108,7 @@ CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DSTM32F429xx CFLAGS += -D__CORTEX_M4 -DTARGET_STM -DTARGET_STM32F4 -DTARGET_STM32F429ZI -DTOOLCHAIN_GCC -D__FPU_PRESENT=1 -D$(BOARD) CFLAGS += -DENABLE_WEAK_FUNCTIONS CFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections -CFLAGS += -std=c99 +CFLAGS += -std=gnu99 CFLAGS += -I$(TOPLEVEL) CFLAGS += -I$(MBED_DIR)/api CFLAGS += -I$(MBED_DIR)/targets/cmsis @@ -140,11 +143,20 @@ $(LIBHAL_BLD)/libhal.a: $(LIBTFM_BLD)/libtfm.a .FORCE $(LIBCLI_BLD)/libcli.a: .FORCE $(MAKE) -C $(LIBCLI_BLD) +$(LIBPROF_BLD)/libprof.a: .FORCE + $(MAKE) -C $(LIBPROF_BLD) + libhal-test: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a .FORCE $(MAKE) -C projects/libhal-test +ifdef DO_PROFILING +CFLAGS += -pg -DDO_PROFILING +hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a $(LIBCLI_BLD)/libcli.a $(LIBPROF_BLD)/libprof.a .FORCE + $(MAKE) -C projects/hsm +else hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a $(LIBCLI_BLD)/libcli.a .FORCE $(MAKE) -C projects/hsm +endif bootloader: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a .FORCE $(MAKE) -C projects/bootloader @@ -176,3 +188,4 @@ distclean: clean $(MAKE) -C $(MBED_DIR) clean $(MAKE) -C $(LIBTFM_BLD) clean $(MAKE) -C $(LIBCLI_BLD) clean + $(MAKE) -C $(LIBPROF_BLD) clean -- cgit v1.2.3 From 65b94ef5ba1981c74a99cb43ee768fbf480c698b Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Wed, 10 May 2017 00:00:04 -0400 Subject: Sigh, right offset for the wrong register. Get the PC (the address we interrupted) rather than LR (the return address from the function we interrupted). Also, change u_short and u_int to unsigned short and unsigned int, since gcc recently decided that those aren't part of the C99 standard. Finally, add profilable versions of memcpy, memset, and friends, because they get called a lot in the course of unit testing, and it would be nice to know who's calling them. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 398e442..432260b 100644 --- a/Makefile +++ b/Makefile @@ -108,7 +108,7 @@ CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DSTM32F429xx CFLAGS += -D__CORTEX_M4 -DTARGET_STM -DTARGET_STM32F4 -DTARGET_STM32F429ZI -DTOOLCHAIN_GCC -D__FPU_PRESENT=1 -D$(BOARD) CFLAGS += -DENABLE_WEAK_FUNCTIONS CFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections -CFLAGS += -std=gnu99 +CFLAGS += -std=c99 CFLAGS += -I$(TOPLEVEL) CFLAGS += -I$(MBED_DIR)/api CFLAGS += -I$(MBED_DIR)/targets/cmsis -- cgit v1.2.3 From 15d74433c59ba4410cd9b5706916a27e4a43e027 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Wed, 24 May 2017 17:53:00 -0400 Subject: Duh, actually build task_metrics --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 432260b..68f4da3 100644 --- a/Makefile +++ b/Makefile @@ -151,6 +151,9 @@ libhal-test: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a .FORCE ifdef DO_PROFILING CFLAGS += -pg -DDO_PROFILING +endif +ifdef DO_TASK_METRICS +CFLAGS += -DDO_TASK_METRICS hsm: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a $(LIBCLI_BLD)/libcli.a $(LIBPROF_BLD)/libprof.a .FORCE $(MAKE) -C projects/hsm else -- cgit v1.2.3