[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-ca45d843a599b0812a655ba58d42dddacd538e31@git.kernel.org>
Date: Sat, 9 Feb 2019 04:51:33 -0800
From: tip-bot for Leo Yan <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, robert.walker@....com, leo.yan@...aro.org,
mike.leach@...aro.org, namhyung@...nel.org,
linux-kernel@...r.kernel.org, coresight@...ts.linaro.org,
alexander.shishkin@...ux.intel.com, mingo@...nel.org,
jolsa@...hat.com, tglx@...utronix.de, suzuki.poulose@....com,
mathieu.poirier@...aro.org, hpa@...or.com
Subject: [tip:perf/core] perf cs-etm: Add last instruction information in
packet
Commit-ID: ca45d843a599b0812a655ba58d42dddacd538e31
Gitweb: https://git.kernel.org/tip/ca45d843a599b0812a655ba58d42dddacd538e31
Author: Leo Yan <leo.yan@...aro.org>
AuthorDate: Tue, 29 Jan 2019 20:28:35 +0800
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 6 Feb 2019 10:00:40 -0300
perf cs-etm: Add last instruction information in packet
Decoder provides last instruction related information, these information
can be used for trace analysis; specifically we can get to know what
kind of branch instruction has been executed, mainly the information are
contained in three element fields:
last_i_type: this is significant type for waypoint calculation, it
indicates the last instruction is one of immediate branch instruction,
indirect branch instruction, instruction barrier (ISB), or data
barrier (DSB/DMB).
last_i_subtype: this is used for instruction sub type, it can be
branch with link, ARMv8 return instruction, ARMv8 eret instruction
(return from exception), or ARMv7 instruction which could imply
return (e.g. MOV PC, LR; POP { ,PC}).
last_instr_cond: it indicates if the last instruction was conditional.
But these three fields are not saved into cs_etm_packet struct, thus
cs-etm layer don't know related information and cannot generate sample
flags for branch instructions.
This patch add corresponding three new fields in cs_etm_packet struct
and save related value into the packet structure, it is preparation for
supporting sample flags.
Signed-off-by: Leo Yan <leo.yan@...aro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mike Leach <mike.leach@...aro.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Robert Walker <robert.walker@....com>
Cc: Suzuki K Poulouse <suzuki.poulose@....com>
Cc: coresight ml <coresight@...ts.linaro.org>
Cc: linux-arm-kernel@...ts.infradead.org
Link: http://lkml.kernel.org/r/20190129122842.32041-2-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 9 +++++++++
tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 3 +++
2 files changed, 12 insertions(+)
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index 8c155575c6c5..8a19310500d9 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -290,6 +290,9 @@ static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder)
decoder->packet_buffer[i].instr_count = 0;
decoder->packet_buffer[i].last_instr_taken_branch = false;
decoder->packet_buffer[i].last_instr_size = 0;
+ decoder->packet_buffer[i].last_instr_type = 0;
+ decoder->packet_buffer[i].last_instr_subtype = 0;
+ decoder->packet_buffer[i].last_instr_cond = 0;
decoder->packet_buffer[i].cpu = INT_MIN;
}
}
@@ -323,6 +326,9 @@ cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder,
decoder->packet_buffer[et].instr_count = 0;
decoder->packet_buffer[et].last_instr_taken_branch = false;
decoder->packet_buffer[et].last_instr_size = 0;
+ decoder->packet_buffer[et].last_instr_type = 0;
+ decoder->packet_buffer[et].last_instr_subtype = 0;
+ decoder->packet_buffer[et].last_instr_cond = 0;
if (decoder->packet_count == MAX_BUFFER - 1)
return OCSD_RESP_WAIT;
@@ -366,6 +372,9 @@ cs_etm_decoder__buffer_range(struct cs_etm_decoder *decoder,
packet->start_addr = elem->st_addr;
packet->end_addr = elem->en_addr;
packet->instr_count = elem->num_instr_range;
+ packet->last_instr_type = elem->last_i_type;
+ packet->last_instr_subtype = elem->last_i_subtype;
+ packet->last_instr_cond = elem->last_instr_cond;
switch (elem->last_i_type) {
case OCSD_INSTR_BR:
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
index a6407d41598f..7cdd6a9c68a7 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.h
@@ -43,6 +43,9 @@ struct cs_etm_packet {
u64 start_addr;
u64 end_addr;
u32 instr_count;
+ u32 last_instr_type;
+ u32 last_instr_subtype;
+ u8 last_instr_cond;
u8 last_instr_taken_branch;
u8 last_instr_size;
int cpu;
Powered by blists - more mailing lists