From: Sasha Levin Date: Mon, 29 Mar 2021 04:00:45 +0000 (-0400) Subject: Fixes for 4.4 X-Git-Tag: v5.11.11~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5105607198d82ad9781a049d7701fb2d4c617022;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/perf-auxtrace-fix-auxtrace-queue-conflict.patch b/queue-4.4/perf-auxtrace-fix-auxtrace-queue-conflict.patch new file mode 100644 index 00000000000..5be582fe8bd --- /dev/null +++ b/queue-4.4/perf-auxtrace-fix-auxtrace-queue-conflict.patch @@ -0,0 +1,57 @@ +From 3b3f56813fdf347c63063a5e26ce657abeb7b8ed Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Mar 2021 17:11:43 +0200 +Subject: perf auxtrace: Fix auxtrace queue conflict + +From: Adrian Hunter + +[ Upstream commit b410ed2a8572d41c68bd9208555610e4b07d0703 ] + +The only requirement of an auxtrace queue is that the buffers are in +time order. That is achieved by making separate queues for separate +perf buffer or AUX area buffer mmaps. + +That generally means a separate queue per cpu for per-cpu contexts, and +a separate queue per thread for per-task contexts. + +When buffers are added to a queue, perf checks that the buffer cpu and +thread id (tid) match the queue cpu and thread id. + +However, generally, that need not be true, and perf will queue buffers +correctly anyway, so the check is not needed. + +In addition, the check gets erroneously hit when using sample mode to +trace multiple threads. + +Consequently, fix that case by removing the check. + +Fixes: e502789302a6 ("perf auxtrace: Add helpers for queuing AUX area tracing data") +Reported-by: Andi Kleen +Signed-off-by: Adrian Hunter +Reviewed-by: Andi Kleen +Cc: Jiri Olsa +Link: http://lore.kernel.org/lkml/20210308151143.18338-1-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/util/auxtrace.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c +index 4b898b15643d..80e461dd2db2 100644 +--- a/tools/perf/util/auxtrace.c ++++ b/tools/perf/util/auxtrace.c +@@ -239,10 +239,6 @@ static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues, + queue->set = true; + queue->tid = buffer->tid; + queue->cpu = buffer->cpu; +- } else if (buffer->cpu != queue->cpu || buffer->tid != queue->tid) { +- pr_err("auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n", +- queue->cpu, queue->tid, buffer->cpu, buffer->tid); +- return -EINVAL; + } + + buffer->buffer_nr = queues->next_buffer_nr++; +-- +2.30.1 + diff --git a/queue-4.4/series b/queue-4.4/series index cf23691c4e1..1e7a5df53a9 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -27,3 +27,4 @@ can-m_can-m_can_do_rx_poll-fix-extraneous-msg-loss-w.patch mac80211-fix-rate-mask-reset.patch net-cdc-phonet-fix-data-interface-release-on-probe-f.patch rdma-cxgb4-fix-adapter-le-hash-errors-while-destroyi.patch +perf-auxtrace-fix-auxtrace-queue-conflict.patch