etm: print something when trace buffer empty
authorJon Povey <jon.povey@racelogic.co.uk>
Mon, 31 May 2010 02:56:42 +0000 (11:56 +0900)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 31 May 2010 05:14:38 +0000 (07:14 +0200)
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>
src/target/etm.c

index 4f4bf9a43066c2523dd90996a93d5d66d1afd599..61ee99a0403453ed90b0d92d73b8b0745a0e594f 100644 (file)
@@ -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;