From f508e24f5b872a8f7d642eb4fb2217dd1497de96 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Thu, 21 Sep 2017 11:24:02 -0400 Subject: cleanup --- libraries/libprof/README.txt | 18 ++++++++++-------- libraries/libprof/gmon.c | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'libraries') diff --git a/libraries/libprof/README.txt b/libraries/libprof/README.txt index f0b8ee8..f0bacc7 100644 --- a/libraries/libprof/README.txt +++ b/libraries/libprof/README.txt @@ -24,7 +24,7 @@ How to build From the top level, run - make DO_PROFILING=1 hsm + $ make DO_PROFILING=1 hsm By default, all code is profiled, *except* the profiling code itself, because that would cause fatal recursion. @@ -38,24 +38,26 @@ before you try to use it as a remote file system. I recommend executing the following in the projects/hsm directory, so that gmon.out ends up in the same directory as hsm.elf. -Start OpenOCD: +Start the debugger: - $ openocd -f /usr/share/openocd/scripts/board/stm32f4discovery.cfg & + $ ../../bin/debug hsm -Connect to OpenOCD: +In another window, connect to OpenOCD: $ telnet localhost 4444 In the OpenOCD console, enable semihosting: > arm semihosting enable + > exit -In another window, start the debugger: +Then connect to the Cryptech management console: - $ ../../bin/debug hsm + $ cryptech_console -In the CLI, type `profile start`, then start the unit test or whatever -will be exercising the hsm. Afterwards, in the CLI, type `profile stop`. +In the Cryptech console, type `profile start`, then start the unit test or +whatever will be exercising the hsm. Afterwards, in the console, type +`profile stop`. After invoking `profile stop`, it can take several minutes to write gmon.out over OpenOCD to the host. diff --git a/libraries/libprof/gmon.c b/libraries/libprof/gmon.c index 92054fc..317a173 100644 --- a/libraries/libprof/gmon.c +++ b/libraries/libprof/gmon.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "gmon.h" #include "profil.h" #include -- cgit v1.2.3