From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Leo Yan <leo.yan@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Coresight ML <coresight@lists.linaro.org>,
linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Robert Walker <robert.walker@arm.com>,
Jiri Olsa <jolsa@redhat.com>,
linux-arm-kernel@lists.infradead.org,
Mike Leach <mike.leach@linaro.org>
Subject: Re: [PATCH v6 1/8] perf cs-etm: Add last instruction information in packet
Date: Wed, 23 Jan 2019 14:03:07 -0700 [thread overview]
Message-ID: <20190123210307.GA620@xps15> (raw)
In-Reply-To: <20190119014347.27441-2-leo.yan@linaro.org>
On Sat, Jan 19, 2019 at 09:43:40AM +0800, Leo Yan wrote:
> 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@linaro.org>
> ---
> 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;
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-23 21:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 1:43 [PATCH v6 0/8] perf cs-etm: Add support for sample flags Leo Yan
2019-01-19 1:43 ` [PATCH v6 1/8] perf cs-etm: Add last instruction information in packet Leo Yan
2019-01-23 21:03 ` Mathieu Poirier [this message]
2019-01-19 1:43 ` [PATCH v6 2/8] perf cs-etm: Set sample flags for instruction range packet Leo Yan
2019-01-23 21:03 ` Mathieu Poirier
2019-01-19 1:43 ` [PATCH v6 3/8] perf cs-etm: Set sample flags for trace discontinuity Leo Yan
2019-01-23 21:04 ` Mathieu Poirier
2019-01-19 1:43 ` [PATCH v6 4/8] perf cs-etm: Add exception number in exception packet Leo Yan
2019-01-23 21:05 ` Mathieu Poirier
2019-01-19 1:43 ` [PATCH v6 5/8] perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata Leo Yan
2019-01-23 21:13 ` Mathieu Poirier
2019-01-23 23:45 ` Leo Yan
2019-01-19 1:43 ` [PATCH v6 6/8] perf cs-etm: Add traceID in packet Leo Yan
2019-01-23 21:23 ` Mathieu Poirier
2019-01-19 1:43 ` [PATCH v6 7/8] perf cs-etm: Set sample flags for exception packet Leo Yan
2019-01-23 21:39 ` Mathieu Poirier
2019-01-19 1:43 ` [PATCH v6 8/8] perf cs-etm: Set sample flags for exception return packet Leo Yan
2019-01-23 21:51 ` Mathieu Poirier
2019-01-23 23:36 ` Leo Yan
2019-01-24 0:22 ` [PATCH v6 0/8] perf cs-etm: Add support for sample flags Mathieu Poirier
2019-01-24 4:00 ` Leo Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190123210307.GA620@xps15 \
--to=mathieu.poirier@linaro.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=jolsa@redhat.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=namhyung@kernel.org \
--cc=robert.walker@arm.com \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).