perf cs-etm: Introduce invalid address macro
authorLeo Yan <leo.yan@linaro.org>
Mon, 18 Jun 2018 05:09:54 +0000 (13:09 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Jul 2018 17:48:22 +0000 (14:48 -0300)
This patch introduces invalid address macro and uses it to replace dummy
value '0xdeadbeefdeadbeefUL'.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kim Phillips <kim.phillips@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Walker <robert.walker@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1529298599-3876-2-git-send-email-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c

index 4d5fc374e7302e30428266df5a1fb9da03304fd8..938def6d0bb9878bdf3b773d071e841a8ff0e595 100644 (file)
@@ -31,6 +31,8 @@
 #endif
 #endif
 
+#define CS_ETM_INVAL_ADDR      0xdeadbeefdeadbeefUL
+
 struct cs_etm_decoder {
        void *data;
        void (*packet_printer)(const char *msg);
@@ -261,8 +263,8 @@ static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder)
        decoder->tail = 0;
        decoder->packet_count = 0;
        for (i = 0; i < MAX_BUFFER; i++) {
-               decoder->packet_buffer[i].start_addr = 0xdeadbeefdeadbeefUL;
-               decoder->packet_buffer[i].end_addr = 0xdeadbeefdeadbeefUL;
+               decoder->packet_buffer[i].start_addr = CS_ETM_INVAL_ADDR;
+               decoder->packet_buffer[i].end_addr = CS_ETM_INVAL_ADDR;
                decoder->packet_buffer[i].last_instr_taken_branch = false;
                decoder->packet_buffer[i].exc = false;
                decoder->packet_buffer[i].exc_ret = false;
@@ -295,8 +297,8 @@ cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder,
        decoder->packet_buffer[et].exc = false;
        decoder->packet_buffer[et].exc_ret = false;
        decoder->packet_buffer[et].cpu = *((int *)inode->priv);
-       decoder->packet_buffer[et].start_addr = 0xdeadbeefdeadbeefUL;
-       decoder->packet_buffer[et].end_addr = 0xdeadbeefdeadbeefUL;
+       decoder->packet_buffer[et].start_addr = CS_ETM_INVAL_ADDR;
+       decoder->packet_buffer[et].end_addr = CS_ETM_INVAL_ADDR;
 
        if (decoder->packet_count == MAX_BUFFER - 1)
                return OCSD_RESP_WAIT;