From patchwork Fri Jul 1 11:24:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 71299 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp248703qgy; Fri, 1 Jul 2016 04:24:31 -0700 (PDT) X-Received: by 10.66.168.13 with SMTP id zs13mr30582569pab.68.1467372271055; Fri, 01 Jul 2016 04:24:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e64si3730416pfe.100.2016.07.01.04.24.30; Fri, 01 Jul 2016 04:24:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752219AbcGALYQ (ORCPT + 30 others); Fri, 1 Jul 2016 07:24:16 -0400 Received: from foss.arm.com ([217.140.101.70]:38281 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbcGALYP (ORCPT ); Fri, 1 Jul 2016 07:24:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34E46424; Fri, 1 Jul 2016 04:25:09 -0700 (PDT) Received: from leverpostej.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A1DD63F445; Fri, 1 Jul 2016 04:24:13 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa Subject: [PATCH] tools: perf: remove redundant evsel logic Date: Fri, 1 Jul 2016 12:24:03 +0100 Message-Id: <1467372243-15858-1-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa --- tools/perf/util/evsel.c | 3 --- 1 file changed, 3 deletions(-) -- 1.9.1 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) {