From patchwork Fri Nov 7 16:25:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 40440 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4581B20D85 for ; Fri, 7 Nov 2014 16:28:10 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k14sf2099504wgh.7 for ; Fri, 07 Nov 2014 08:28:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=UPbte9egr/hoxuFKQ4RQHo4rmyNS46X4dK5VPupH9g0=; b=YZHoff+Tf79izpfkwAp6jDNOygG48aDVA6i3EMtkd0EO8RY13CWMPgRKG2mKXK2Xw7 VkwvbVHRqop+aNMYpyJPj4S7O49qO4hLPaWG5DNllahcQRr0Qj0Zml47ZBx1BqR425ur TVoiLnjQICPTrCHHCU/Co+cbZVBnSQ5OQo0wDHdjlaybiACCTrBsc9Y1ArcuUSET9s2a nd+MiqFoZhxaFa8QKGS1X+VielBAMAG80BRM4QK2WkdTedXJOWgdZupCqDes12wN+5Tj MzsJe8EbJcOB2t4noIV/+IyJnSNISrlCciXgn8COfEGNv6TF2yoD0XweCHsNHWZs0r1I F7iA== X-Gm-Message-State: ALoCoQkq7IwZ+wujhCr7Kn0jMsaz3SrhGMbjriD+xwYiG5oKyuurw0lTnJRjDy0+JJTKFqNccmZ5 X-Received: by 10.181.8.194 with SMTP id dm2mr855135wid.2.1415377689423; Fri, 07 Nov 2014 08:28:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.166 with SMTP id x6ls230074lal.93.gmail; Fri, 07 Nov 2014 08:28:08 -0800 (PST) X-Received: by 10.152.25.226 with SMTP id f2mr2979939lag.98.1415377688979; Fri, 07 Nov 2014 08:28:08 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ap1si15656928lac.54.2014.11.07.08.28.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Nov 2014 08:28:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id ge10so4583435lab.8 for ; Fri, 07 Nov 2014 08:28:08 -0800 (PST) X-Received: by 10.112.130.41 with SMTP id ob9mr11994682lbb.74.1415377688858; Fri, 07 Nov 2014 08:28:08 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp228514lbc; Fri, 7 Nov 2014 08:28:07 -0800 (PST) X-Received: by 10.70.47.42 with SMTP id a10mr13291193pdn.18.1415377687161; Fri, 07 Nov 2014 08:28:07 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zt7si9452735pbc.129.2014.11.07.08.28.06 for ; Fri, 07 Nov 2014 08:28:07 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbaKGQ14 (ORCPT + 25 others); Fri, 7 Nov 2014 11:27:56 -0500 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:48336 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbaKGQ1y (ORCPT ); Fri, 7 Nov 2014 11:27:54 -0500 Received: from leverpostej.cambridge.arm.com (leverpostej.cambridge.arm.com [10.1.205.151]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id sA7GPwx0014702; Fri, 7 Nov 2014 16:27:07 GMT From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, will.deacon@arm.com, Mark Rutland Subject: [PATCH 10/11] arm: perf: remove singleton PMU restriction Date: Fri, 7 Nov 2014 16:25:35 +0000 Message-Id: <1415377536-12841-11-git-send-email-mark.rutland@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415377536-12841-1-git-send-email-mark.rutland@arm.com> References: <1415377536-12841-1-git-send-email-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mark.rutland@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Now that we can describe PMUs in heterogeneous systems, the only item in the way of perf support for big.LITTLE is the singleton cpu_pmu variable used for OProfile compatibility. Signed-off-by: Mark Rutland --- arch/arm/kernel/perf_event_cpu.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c index f09c8a0..09de0e6 100644 --- a/arch/arm/kernel/perf_event_cpu.c +++ b/arch/arm/kernel/perf_event_cpu.c @@ -34,7 +34,7 @@ #include /* Set at runtime when we know what CPU type we are. */ -static struct arm_pmu *cpu_pmu; +static struct arm_pmu *__oprofile_cpu_pmu; /* * Despite the names, these two functions are CPU-specific and are used @@ -42,10 +42,10 @@ static struct arm_pmu *cpu_pmu; */ const char *perf_pmu_name(void) { - if (!cpu_pmu) + if (!__oprofile_cpu_pmu) return NULL; - return cpu_pmu->name; + return __oprofile_cpu_pmu->name; } EXPORT_SYMBOL_GPL(perf_pmu_name); @@ -53,8 +53,8 @@ int perf_num_counters(void) { int max_events = 0; - if (cpu_pmu != NULL) - max_events = cpu_pmu->num_events; + if (__oprofile_cpu_pmu != NULL) + max_events = __oprofile_cpu_pmu->num_events; return max_events; } @@ -528,19 +528,16 @@ static int cpu_pmu_device_probe(struct platform_device *pdev) struct arm_pmu *pmu; int ret = -ENODEV; - if (cpu_pmu) { - pr_info("attempt to register multiple PMU devices!\n"); - return -ENOSPC; - } - pmu = kzalloc(sizeof(struct arm_pmu), GFP_KERNEL); if (!pmu) { pr_info("failed to allocate PMU device!\n"); return -ENOMEM; } - cpu_pmu = pmu; - cpu_pmu->plat_device = pdev; + if (!__oprofile_cpu_pmu) + __oprofile_cpu_pmu = pmu; + + pmu->plat_device = pdev; ret = cpu_pmu_parse_interrupts(pmu); if (ret) @@ -558,18 +555,18 @@ static int cpu_pmu_device_probe(struct platform_device *pdev) goto out_free; } - ret = cpu_pmu_init(cpu_pmu); + ret = cpu_pmu_init(pmu); if (ret) goto out_free; - ret = armpmu_register(cpu_pmu, -1); + ret = armpmu_register(pmu, -1); if (ret) goto out_destroy; return 0; out_destroy: - cpu_pmu_destroy(cpu_pmu); + cpu_pmu_destroy(pmu); out_free: kfree(pmu->irq_map); out_free_pmu: