]> git.baikalelectronics.ru Git - kernel.git/commit
perf cs-etm: Fix indexing for decoder packet queue
authorMathieu Poirier <mathieu.poirier@linaro.org>
Fri, 25 May 2018 23:10:54 +0000 (17:10 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 30 May 2018 18:38:40 +0000 (15:38 -0300)
commit79e35e79b23c6385df8c12e8388e35ebc78b6680
tree1a5363cb9b9e915f3471ada96398841fa7535099
parentaedcd42d1ad3a532fdf0b6f7b6faafd77fc620a9
perf cs-etm: Fix indexing for decoder packet queue

The tail of a queue is supposed to be pointing to the next available
slot in a queue.  In this implementation the tail is incremented before
it is used and as such points to the last used element, something that
has the immense advantage of centralizing tail management at a single
location and eliminating a lot of redundant code.

But this needs to be taken into consideration on the dequeueing side
where the head also needs to be incremented before it is used, or the
first available element of the queue will be skipped.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Walker <robert.walker@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1527289854-10755-1-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/cs-etm-decoder/cs-etm-decoder.c