From patchwork Wed Nov 11 22:18:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 56411 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp76398lbb; Wed, 11 Nov 2015 14:23:42 -0800 (PST) X-Received: by 10.68.227.69 with SMTP id ry5mr18180454pbc.148.1447280622677; Wed, 11 Nov 2015 14:23:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uh5si15256228pab.115.2015.11.11.14.23.42; Wed, 11 Nov 2015 14:23:42 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbbKKWXk (ORCPT + 28 others); Wed, 11 Nov 2015 17:23:40 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33761 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753094AbbKKWTp (ORCPT ); Wed, 11 Nov 2015 17:19:45 -0500 Received: by pabfh17 with SMTP id fh17so42987997pab.0 for ; Wed, 11 Nov 2015 14:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D+I39M6rgjKk3I/UUQoiOuCY5q+RqgkJIRPqP+30pBw=; b=wXvWxnQSF8zfD0WlhLB42EEhYOn/DRNegyfCWzo3pFW7RdS3yN6g1eIkgKru3ieQX7 cVBTNLP4ej34hvowHZv82Aexaamlq0BlcgS+OB+8cesSx6g5tvfyUf6DEZX7W+f/9AZS xhkddtBPGxNKgn96CvMcUhHhWXDx77b7ImYCGtRQBv/x5NFgpxa/hU3DwfBFikW8CW5G srB4kJ56ahNSfCRuzs/YCDQPzdVLVrjRGojSI6Eywplk4TNyPHLTS3A1MzO9eKVcA4Wk F4sTOt5ZBU1EFM8+134QGfGpRmdLep7nUnX0h7PSKgXBz8M/6eqm/xUWLhNKvmV9IvRb Jxsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D+I39M6rgjKk3I/UUQoiOuCY5q+RqgkJIRPqP+30pBw=; b=NaroBkVSRFOn/b3e/D09gGg4FJGHUuFqxBkSr/kG0gok6m62Fc5Z6G03C4t9Kv0c+p FXQjo4/jjuJtreksuWwPfv51xqzQL01rZxLFyZYT70h23hWi3w1ZIPUUVfgJCSoRDWWP tl3KHKnvX0lX2b9WcXTv+eE1461t7E3DXVKWwsT7U+/HCDHRvX45BypVF5fEHY2aGNNN J6ayTYS1irsQuePoR/dn/LZvjJtJZTa5ItWFBfYV/GD+rMaElN0w4YC5+rKD/QzDNCNk DJCgHdxIvS4DnotBd2FXe7woY7J4pOqEJWG5IXTJD6BArNJ5MHp7Ed4TJ0iMi4vLJZvP HVoQ== X-Gm-Message-State: ALoCoQmB7q3QXTGPL4NrZNzXb3Exo+BttL4wT/TcjVOQcgPaqAbe9tMHdTjfSrH7kIuauUqJYOvL X-Received: by 10.66.141.42 with SMTP id rl10mr18023026pab.18.1447280385263; Wed, 11 Nov 2015 14:19:45 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id h10sm11156697pat.7.2015.11.11.14.19.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Nov 2015 14:19:44 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH V3 16/26] perf: changing pmu::setup_aux() parameter to include event Date: Wed, 11 Nov 2015 15:18:06 -0700 Message-Id: <1447280296-19147-17-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> References: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For Coresight ETMv3/4 tracers the event carries information about trace modes such as user or kernel space tracing and whether tracing is allowed when operating in secure mode. Since this information is to be embedded in the private structure returned by setup_aux(), changing the first parameter to be of type struct perf_event * so that all the necessary information can be conveyed. Also changing current customer of the API to reflect the modification. Signed-off-by: Mathieu Poirier --- arch/x86/kernel/cpu/perf_event_intel_bts.c | 4 +++- arch/x86/kernel/cpu/perf_event_intel_pt.c | 5 +++-- include/linux/perf_event.h | 2 +- kernel/events/ring_buffer.c | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/arch/x86/kernel/cpu/perf_event_intel_bts.c b/arch/x86/kernel/cpu/perf_event_intel_bts.c index d1c0f254afbe..773600b2f313 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_bts.c +++ b/arch/x86/kernel/cpu/perf_event_intel_bts.c @@ -68,10 +68,12 @@ static size_t buf_size(struct page *page) } static void * -bts_buffer_setup_aux(int cpu, void **pages, int nr_pages, bool overwrite) +bts_buffer_setup_aux(struct perf_event *event, void **pages, + int nr_pages, bool overwrite) { struct bts_buffer *buf; struct page *page; + int cpu = event->cpu; int node = (cpu == -1) ? cpu : cpu_to_node(cpu); unsigned long offset; size_t size = nr_pages << PAGE_SHIFT; diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c index 42169283448b..f8b881210648 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_pt.c +++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c @@ -863,10 +863,11 @@ static int pt_buffer_init_topa(struct pt_buffer *buf, unsigned long nr_pages, * Return: Our private PT buffer structure. */ static void * -pt_buffer_setup_aux(int cpu, void **pages, int nr_pages, bool snapshot) +pt_buffer_setup_aux(struct perf_event *event, void **pages, + int nr_pages, bool snapshot) { struct pt_buffer *buf; - int node, ret; + int node, ret, cpu = event->cpu; if (!nr_pages) return NULL; diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 092a0e8a479a..0d9964b5ed4d 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -292,7 +292,7 @@ struct pmu { /* * Set up pmu-private data structures for an AUX area */ - void *(*setup_aux) (int cpu, void **pages, + void *(*setup_aux) (struct perf_event *event, void **pages, int nr_pages, bool overwrite); /* optional */ diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index 182bc30899d5..87171b700c77 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -522,7 +522,7 @@ int rb_alloc_aux(struct ring_buffer *rb, struct perf_event *event, goto out; } - rb->aux_priv = event->pmu->setup_aux(event->cpu, rb->aux_pages, nr_pages, + rb->aux_priv = event->pmu->setup_aux(event, rb->aux_pages, nr_pages, overwrite); if (!rb->aux_priv) goto out;