summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Povey <jon.povey@racelogic.co.uk>2010-05-31 11:56:42 +0900
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-05-31 07:14:38 +0200
commitd944a0bed73c63fe52cf546a7121823318e8b593 (patch)
treedf52f3924e5a58043dcd5613b412c66a042f5df6
parent86e851e1e263c79f19eb9db52553de99f19b8bb9 (diff)
downloadopenocd+libswd-d944a0bed73c63fe52cf546a7121823318e8b593.tar.gz
openocd+libswd-d944a0bed73c63fe52cf546a7121823318e8b593.tar.bz2
openocd+libswd-d944a0bed73c63fe52cf546a7121823318e8b593.tar.xz
openocd+libswd-d944a0bed73c63fe52cf546a7121823318e8b593.zip
etm: print something when trace buffer empty
ETM analyze produced no output when the trace buffer was empty. This patch provides users with a clue. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r--src/target/etm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/target/etm.c b/src/target/etm.c
index 4f4bf9a4..61ee99a0 100644
--- a/src/target/etm.c
+++ b/src/target/etm.c
@@ -882,6 +882,11 @@ static int etmv1_analyze_trace(struct etm_context *ctx, struct command_context *
if (ctx->trace_depth == 0)
ctx->capture_driver->read_trace(ctx);
+ if (ctx->trace_depth == 0) {
+ command_print(cmd_ctx, "Trace is empty.");
+ return ERROR_OK;
+ }
+
/* start at the beginning of the captured trace */
ctx->pipe_index = 0;
ctx->data_index = 0;