aboutsummaryrefslogtreecommitdiff
path: root/projects
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-09-07 18:17:12 -0400
committerPaul Selkirk <paul@psgd.org>2017-09-07 18:20:55 -0400
commit72227852729ed3125af58cff3f593340b3247fed (patch)
tree234d45ae587ce51bfbbce6d8c059a121a44bf1e6 /projects
parent2e1f88062c7ec6cd12688ce7522e802bbf09bba1 (diff)
parent5ff8c9512db48d128cf07904f68eb5139bebf952 (diff)
Rebase branch 'profiling' from master
Diffstat (limited to 'projects')
-rw-r--r--projects/hsm/Makefile6
-rw-r--r--projects/hsm/hsm.c5
-rw-r--r--projects/hsm/mgmt-task.c9
3 files changed, 15 insertions, 5 deletions
diff --git a/projects/hsm/Makefile b/projects/hsm/Makefile
index 429069d..9a75b92 100644
--- a/projects/hsm/Makefile
+++ b/projects/hsm/Makefile
@@ -12,8 +12,6 @@ OBJS = mgmt-cli.o \
log.o \
$(TOPLEVEL)/task.o
-CFLAGS += -DTASK_METRICS
-
CFLAGS += -DNUM_RPC_TASK=4
CFLAGS += -I$(LIBHAL_SRC)
@@ -32,6 +30,10 @@ LIBS += $(LIBPROF_BLD)/libprof.a
LDFLAGS += --specs=rdimon.specs -lc -lrdimon
endif
+ifdef DO_TASK_METRICS
+CFLAGS += -DDO_TASK_METRICS
+endif
+
all: $(PROJ:=.elf)
%.elf: %.o $(BOARD_OBJS) $(OBJS) $(LIBS)
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index b6b8820..5ef2ccc 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -268,6 +268,11 @@ size_t uart_rx_max = 0;
void HAL_SYSTICK_Callback(void)
{
+#ifdef DO_PROFILING
+ extern void profil_callback(void);
+ profil_callback();
+#endif
+
size_t count = RINGBUF_COUNT(uart_ringbuf);
if (uart_rx_max < count) uart_rx_max = count;
diff --git a/projects/hsm/mgmt-task.c b/projects/hsm/mgmt-task.c
index 9f6a908..4668585 100644
--- a/projects/hsm/mgmt-task.c
+++ b/projects/hsm/mgmt-task.c
@@ -73,7 +73,7 @@ static int cmd_task_show(struct cli_def *cli, const char *command, char *argv[],
return CLI_OK;
}
-#ifdef TASK_METRICS
+#ifdef DO_TASK_METRICS
static int cmd_task_show_metrics(struct cli_def *cli, const char *command, char *argv[], int argc)
{
struct task_metrics tm;
@@ -99,9 +99,12 @@ void configure_cli_task(struct cli_def *cli)
struct cli_command *c = cli_register_command(cli, NULL, "task", NULL, 0, 0, NULL);
/* task show */
- struct cli_command *c_show = cli_register_command(cli, c, "show", cmd_task_show, 0, 0, "Show the active tasks");
+#ifdef DO_TASK_METRICS
+ struct cli_command *c_show =
+#endif
+ cli_register_command(cli, c, "show", cmd_task_show, 0, 0, "Show the active tasks");
-#ifdef TASK_METRICS
+#ifdef DO_TASK_METRICS
/* task show metrics */
cli_register_command(cli, c_show, "metrics", cmd_task_show_metrics, 0, 0, "Show task metrics");