Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719402

[PATCH 06/10] perf values: Fix thread index bug

From Jiri Olsa <jolsa@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 06/10] perf values: Fix thread index bug
Date 2017-08-24 18:30 +0200
Message-ID <ui3b5-tc-53@gated-at.bofh.it> (permalink)
References <ui3b3-tc-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We are taking wrong index (+1) for first thread, which
leaves thread with index 0 unused and uninitialized.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/values.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c
index 5de2e15e2eda..9ac36bf2c438 100644
--- a/tools/perf/util/values.c
+++ b/tools/perf/util/values.c
@@ -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;
 }
-- 
2.9.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] perf: inherit_stat related fixes Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 07/10] perf values: Fix allocation check Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 08/10] perf values: Zero value buffers Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 10/10] perf stat: Support inherit/no-inherit terms Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
    Re: [PATCH 10/10] perf stat: Support inherit/no-inherit terms Andi Kleen <andi@firstfloor.org> - 2017-08-24 18:40 +0200
      Re: [PATCH 10/10] perf stat: Support inherit/no-inherit terms Jiri Olsa <jolsa@redhat.com> - 2017-08-24 18:50 +0200
  [PATCH 02/10] perf: Fix leader for removed sibling event in perf_group_detach Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 09/10] perf report: Group stat values on global event id Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 05/10] perf report: Add dump_read function Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 06/10] perf values: Fix thread index bug Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:30 +0200
  [PATCH 01/10] perf/x86: Add warning on proper cpu during event's update Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:40 +0200
  [PATCH 03/10] perf: Make sure we read only scheduled events Jiri Olsa <jolsa@kernel.org> - 2017-08-24 18:40 +0200

csiph-web