lkml.org 
[lkml]   [2016]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tools: perf: remove redundant evsel logic
Date
The only caller of perf_evsel__alloc_fd is __perf_evsel__open, which
already has to explicitly handle the case when evsel->system_wide is
true (and therefore nthreads == 1), such that the number of FDs opened
matches the number of FDs it allocates space for.

Remove the duplicate logic and have perf_evsel__alloc_fd trust its
caller to provide the right number of threads.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/evsel.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 5d7037e..a1fa1c2 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -926,9 +926,6 @@ static int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthread
{
int cpu, thread;

- if (evsel->system_wide)
- nthreads = 1;
-
evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int));

if (evsel->fd) {
--
1.9.1
\
 
 \ /
  Last update: 2016-07-01 14:01    [W:0.020 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site