Skip to contentSkip to conversation

perf auxtrace: Fix queue resize

PATCH Applied Adrian Hunter 3 participants 3 messages Aug 14, 2018 – Aug 18, 2018 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf auxtrace: Fix queue resize

When the number of queues grows beyond 32, the array of queues is resized but not all members were being copied. Fix by also copying 'tid', 'cpu' and 'set'.

Fixes e502789302a6e ("perf auxtrace: Add helpers for queuing AUX area tracing data")
---
 tools/perf/util/auxtrace.c | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/util/auxtrace.c +3 -0
index ae8c37b219c9..db1511359c5e 100644
@@ -203,6 +203,9 @@ static int auxtrace_queues__grow(struct auxtrace_queues *queues,
 	for (i = 0; i < queues->nr_queues; i++) {
 		list_splice_tail(&queues->queue_array[i].head,
 				 &queue_array[i].head);
+		queue_array[i].tid = queues->queue_array[i].tid;
+		queue_array[i].cpu = queues->queue_array[i].cpu;
+		queue_array[i].set = queues->queue_array[i].set;
 		queue_array[i].priv = queues->queue_array[i].priv;
 	}
 
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

Em Tue, Aug 14, 2018 at 11:46:08AM +0300, Adrian Hunter escreveu:

Quoted 3 lines

When the number of queues grows beyond 32, the array of queues is resized but not all members were being copied. Fix by also copying 'tid', 'cpu' and 'set'.

Thanks, applied.

Quoted 23 lines
Fixes e502789302a6e ("perf auxtrace: Add helpers for queuing AUX area tracing data")
---
 tools/perf/util/auxtrace.c | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/util/auxtrace.c +3 -0
index ae8c37b219c9..db1511359c5e 100644
@@ -203,6 +203,9 @@ static int auxtrace_queues__grow(struct auxtrace_queues *queues,
 	for (i = 0; i < queues->nr_queues; i++) {
 		list_splice_tail(&queues->queue_array[i].head,
 				 &queue_array[i].head);
+		queue_array[i].tid = queues->queue_array[i].tid;
+		queue_array[i].cpu = queues->queue_array[i].cpu;
+		queue_array[i].set = queues->queue_array[i].set;
 		queue_array[i].priv = queues->queue_array[i].priv;
 	}
 
Signature · 1 line
2.17.1
#2 lore raw
In reply to Adrian Hunter
perf auxtrace: Fix queue resize
Commit-ID:  99cbbe56eb8bede625f410ab62ba34673ffa7d21
Gitweb:     https://git.kernel.org/tip/99cbbe56eb8bede625f410ab62ba34673ffa7d21
Author:     Adrian Hunter <[email protected]>
AuthorDate: Tue, 14 Aug 2018 11:46:08 +0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 14 Aug 2018 19:00:53 -0300

perf auxtrace: Fix queue resize

When the number of queues grows beyond 32, the array of queues is resized but not all members were being copied. Fix by also copying 'tid', 'cpu' and 'set'.

Cc Jiri Olsa <[email protected]>
Fixes e502789302a6e ("perf auxtrace: Add helpers for queuing AUX area tracing data")
---
 tools/perf/util/auxtrace.c | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/util/auxtrace.c +3 -0
index ae8c37b219c9..db1511359c5e 100644
@@ -203,6 +203,9 @@ static int auxtrace_queues__grow(struct auxtrace_queues *queues,
 	for (i = 0; i < queues->nr_queues; i++) {
 		list_splice_tail(&queues->queue_array[i].head,
 				 &queue_array[i].head);
+		queue_array[i].tid = queues->queue_array[i].tid;
+		queue_array[i].cpu = queues->queue_array[i].cpu;
+		queue_array[i].set = queues->queue_array[i].set;
 		queue_array[i].priv = queues->queue_array[i].priv;
 	}