Skip to content

Commit

Permalink
perf auxtrace: Fix auxtrace queue conflict
Browse files Browse the repository at this point in the history
[ Upstream commit b410ed2 ]

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: e502789 ("perf auxtrace: Add helpers for queuing AUX area tracing data")
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20210308151143.18338-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ahunter6 authored and gregkh committed Mar 30, 2021
1 parent 321dbe6 commit 693d9a5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tools/perf/util/auxtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ static int auxtrace_queues__queue_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++;
Expand Down

0 comments on commit 693d9a5

Please sign in to comment.