提交 adf35d05 编写于 作者: S Suzuki K Poulose 提交者: Mathieu Poirier

coresight: trbe: Make sure we have enough space

The TRBE driver makes sure that there is enough space for a meaningful
run, otherwise pads the given space and restarts the offset calculation
once. But there is no guarantee that we may find space or hit "no space".
Make sure that we repeat the step until, either :
  - We have the minimum space
   OR
  - There is NO space at all.

Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Reviewed-by: NAnshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20211019163153.3692640-13-suzuki.poulose@arm.comSigned-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
上级 7c2cc5e2
...@@ -477,10 +477,14 @@ static unsigned long trbe_normal_offset(struct perf_output_handle *handle) ...@@ -477,10 +477,14 @@ static unsigned long trbe_normal_offset(struct perf_output_handle *handle)
* If the head is too close to the limit and we don't * If the head is too close to the limit and we don't
* have space for a meaningful run, we rather pad it * have space for a meaningful run, we rather pad it
* and start fresh. * and start fresh.
*
* We might have to do this more than once to make sure
* we have enough required space.
*/ */
if (limit && ((limit - head) < trbe_min_trace_buf_size(handle))) { while (limit && ((limit - head) < trbe_min_trace_buf_size(handle))) {
trbe_pad_buf(handle, limit - head); trbe_pad_buf(handle, limit - head);
limit = __trbe_normal_offset(handle); limit = __trbe_normal_offset(handle);
head = PERF_IDX2OFF(handle->head, buf);
} }
return limit; return limit;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册