Commit cf0c37b6 authored by Leo Yan's avatar Leo Yan Committed by Arnaldo Carvalho de Melo

perf cs-etm: Don't check cs_etm_queue::prev_packet validity

Since cs_etm_queue::prev_packet is allocated for all cases, it will
never be NULL pointer; now validity checking prev_packet is pointless,
remove all of them.
Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
Tested-by: default avatarRobert Walker <robert.walker@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20190428083228.20246-2-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 167e418f
...@@ -981,7 +981,6 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) ...@@ -981,7 +981,6 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
* PREV_PACKET is a branch. * PREV_PACKET is a branch.
*/ */
if (etm->synth_opts.last_branch && if (etm->synth_opts.last_branch &&
etmq->prev_packet &&
etmq->prev_packet->sample_type == CS_ETM_RANGE && etmq->prev_packet->sample_type == CS_ETM_RANGE &&
etmq->prev_packet->last_instr_taken_branch) etmq->prev_packet->last_instr_taken_branch)
cs_etm__update_last_branch_rb(etmq); cs_etm__update_last_branch_rb(etmq);
...@@ -1014,7 +1013,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) ...@@ -1014,7 +1013,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq)
etmq->period_instructions = instrs_over; etmq->period_instructions = instrs_over;
} }
if (etm->sample_branches && etmq->prev_packet) { if (etm->sample_branches) {
bool generate_sample = false; bool generate_sample = false;
/* Generate sample for tracing on packet */ /* Generate sample for tracing on packet */
...@@ -1071,9 +1070,6 @@ static int cs_etm__flush(struct cs_etm_queue *etmq) ...@@ -1071,9 +1070,6 @@ static int cs_etm__flush(struct cs_etm_queue *etmq)
struct cs_etm_auxtrace *etm = etmq->etm; struct cs_etm_auxtrace *etm = etmq->etm;
struct cs_etm_packet *tmp; struct cs_etm_packet *tmp;
if (!etmq->prev_packet)
return 0;
/* Handle start tracing packet */ /* Handle start tracing packet */
if (etmq->prev_packet->sample_type == CS_ETM_EMPTY) if (etmq->prev_packet->sample_type == CS_ETM_EMPTY)
goto swap_packet; goto swap_packet;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment