Skip to content

Commit 49ccf87

Browse files
Leo Yanacmel
authored andcommitted
perf cs-etm: Rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY
TRACE_ON element is used at the beginning of trace, it also can be appeared in the middle of trace data to indicate discontinuity; for example, it's possible to see multiple TRACE_ON elements in the trace stream if the trace is being limited by address range filtering. Furthermore, except TRACE_ON element is for discontinuity, NO_SYNC and EO_TRACE also can be used to indicate discontinuity, though they are used for different scenarios for which the trace is interrupted. This patch renames sample type CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY, firstly the new name describes more closely the purpose of the packet; secondly this is a preparation for other output elements which also cause the trace discontinuity thus they can share the same one packet type. 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: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Robert Walker <robert.walker@arm.com> Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-6-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent cfc1d42 commit 49ccf87

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎tools/perf/util/cs-etm-decoder/cs-etm-decoder.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,11 @@ cs_etm_decoder__buffer_range(struct cs_etm_decoder *decoder,
390390
}
391391

392392
static ocsd_datapath_resp_t
393-
cs_etm_decoder__buffer_trace_on(struct cs_etm_decoder *decoder,
394-
const uint8_t trace_chan_id)
393+
cs_etm_decoder__buffer_discontinuity(struct cs_etm_decoder *decoder,
394+
const uint8_t trace_chan_id)
395395
{
396396
return cs_etm_decoder__buffer_packet(decoder, trace_chan_id,
397-
CS_ETM_TRACE_ON);
397+
CS_ETM_DISCONTINUITY);
398398
}
399399

400400
static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
@@ -412,8 +412,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
412412
case OCSD_GEN_TRC_ELEM_NO_SYNC:
413413
break;
414414
case OCSD_GEN_TRC_ELEM_TRACE_ON:
415-
resp = cs_etm_decoder__buffer_trace_on(decoder,
416-
trace_chan_id);
415+
resp = cs_etm_decoder__buffer_discontinuity(decoder,
416+
trace_chan_id);
417417
break;
418418
case OCSD_GEN_TRC_ELEM_INSTR_RANGE:
419419
resp = cs_etm_decoder__buffer_range(decoder, elem,

‎tools/perf/util/cs-etm-decoder/cs-etm-decoder.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct cs_etm_buffer {
2525
enum cs_etm_sample_type {
2626
CS_ETM_EMPTY,
2727
CS_ETM_RANGE,
28-
CS_ETM_TRACE_ON,
28+
CS_ETM_DISCONTINUITY,
2929
};
3030

3131
enum cs_etm_isa {

‎tools/perf/util/cs-etm.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,8 @@ static inline int cs_etm__t32_instr_size(struct cs_etm_queue *etmq,
562562

563563
static inline u64 cs_etm__first_executed_instr(struct cs_etm_packet *packet)
564564
{
565-
/* Returns 0 for the CS_ETM_TRACE_ON packet */
566-
if (packet->sample_type == CS_ETM_TRACE_ON)
565+
/* Returns 0 for the CS_ETM_DISCONTINUITY packet */
566+
if (packet->sample_type == CS_ETM_DISCONTINUITY)
567567
return 0;
568568

569569
return packet->start_addr;
@@ -572,8 +572,8 @@ static inline u64 cs_etm__first_executed_instr(struct cs_etm_packet *packet)
572572
static inline
573573
u64 cs_etm__last_executed_instr(const struct cs_etm_packet *packet)
574574
{
575-
/* Returns 0 for the CS_ETM_TRACE_ON packet */
576-
if (packet->sample_type == CS_ETM_TRACE_ON)
575+
/* Returns 0 for the CS_ETM_DISCONTINUITY packet */
576+
if (packet->sample_type == CS_ETM_DISCONTINUITY)
577577
return 0;
578578

579579
return packet->end_addr - packet->last_instr_size;
@@ -972,7 +972,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
972972
bool generate_sample = false;
973973

974974
/* Generate sample for tracing on packet */
975-
if (etmq->prev_packet->sample_type == CS_ETM_TRACE_ON)
975+
if (etmq->prev_packet->sample_type == CS_ETM_DISCONTINUITY)
976976
generate_sample = true;
977977

978978
/* Generate sample for branch taken packet */
@@ -1148,7 +1148,7 @@ static int cs_etm__run_decoder(struct cs_etm_queue *etmq)
11481148
*/
11491149
cs_etm__sample(etmq);
11501150
break;
1151-
case CS_ETM_TRACE_ON:
1151+
case CS_ETM_DISCONTINUITY:
11521152
/*
11531153
* Discontinuity in trace, flush
11541154
* previous branch stack

0 commit comments

Comments
 (0)