提交 64eed1de 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

perf values: Fix thread index bug

We are taking wrong index (+1) for first thread, which leaves thread
with index 0 unused and uninitialized.
Signed-off-by: NJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20170824162737.7813-7-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 dac7f6b7
......@@ -98,7 +98,7 @@ static int perf_read_values__findnew_thread(struct perf_read_values *values,
return i;
}
i = values->threads + 1;
i = values->threads;
values->value[i] = malloc(values->counters_max * sizeof(**values->value));
if (!values->value[i]) {
pr_debug("failed to allocate read_values counters array");
......@@ -106,7 +106,7 @@ static int perf_read_values__findnew_thread(struct perf_read_values *values,
}
values->pid[i] = pid;
values->tid[i] = tid;
values->threads = i;
values->threads = i + 1;
return i;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册