diff options
author | Leo Yan <leo.yan@linaro.org> | 2019-04-28 04:32:28 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-05-02 16:00:20 -0400 |
commit | cf0c37b6dbf74fb71bea07b516612d29e00dcbc4 (patch) | |
tree | 030fa0a5219842715da9b70ba761f981dcf3f8a8 | |
parent | 167e418fa0871c083e2c74508d73012abb01e6f7 (diff) |
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: Leo Yan <leo.yan@linaro.org>
Tested-by: Robert 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/cs-etm.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 110804936fc3..7777cfc1ad8c 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c | |||
@@ -981,7 +981,6 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) | |||
981 | * PREV_PACKET is a branch. | 981 | * PREV_PACKET is a branch. |
982 | */ | 982 | */ |
983 | if (etm->synth_opts.last_branch && | 983 | if (etm->synth_opts.last_branch && |
984 | etmq->prev_packet && | ||
985 | etmq->prev_packet->sample_type == CS_ETM_RANGE && | 984 | etmq->prev_packet->sample_type == CS_ETM_RANGE && |
986 | etmq->prev_packet->last_instr_taken_branch) | 985 | etmq->prev_packet->last_instr_taken_branch) |
987 | cs_etm__update_last_branch_rb(etmq); | 986 | cs_etm__update_last_branch_rb(etmq); |
@@ -1014,7 +1013,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) | |||
1014 | etmq->period_instructions = instrs_over; | 1013 | etmq->period_instructions = instrs_over; |
1015 | } | 1014 | } |
1016 | 1015 | ||
1017 | if (etm->sample_branches && etmq->prev_packet) { | 1016 | if (etm->sample_branches) { |
1018 | bool generate_sample = false; | 1017 | bool generate_sample = false; |
1019 | 1018 | ||
1020 | /* Generate sample for tracing on packet */ | 1019 | /* Generate sample for tracing on packet */ |
@@ -1071,9 +1070,6 @@ static int cs_etm__flush(struct cs_etm_queue *etmq) | |||
1071 | struct cs_etm_auxtrace *etm = etmq->etm; | 1070 | struct cs_etm_auxtrace *etm = etmq->etm; |
1072 | struct cs_etm_packet *tmp; | 1071 | struct cs_etm_packet *tmp; |
1073 | 1072 | ||
1074 | if (!etmq->prev_packet) | ||
1075 | return 0; | ||
1076 | |||
1077 | /* Handle start tracing packet */ | 1073 | /* Handle start tracing packet */ |
1078 | if (etmq->prev_packet->sample_type == CS_ETM_EMPTY) | 1074 | if (etmq->prev_packet->sample_type == CS_ETM_EMPTY) |
1079 | goto swap_packet; | 1075 | goto swap_packet; |