From patchwork Sun Oct 18 18:24:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 55210 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 7E12622FFA for ; Sun, 18 Oct 2015 18:30:01 +0000 (UTC) Received: by lbbor1 with SMTP id or1sf19132725lbb.2 for ; Sun, 18 Oct 2015 11:30:00 -0700 (PDT) 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=feCwJf613SNrmJKUYxhmMVVpnVSzTaGq0L/khmKq5XE=; b=EzgDiD165QaF/9+jUB/6x/xqok5Ezm2EYe3c0dgNhz/8W8DE7YVPDNl4qgIf82F32c Him02o8BaCbPVD9LsZaHWLhKQ9wWULvJTlpDi4/RI0XYeYp2Szi+wML4w4mEkuzpQDQt wpiulVSF4MGR4EG4vn9DlNl2ORG1mZrDu2GvvfmJOKcTdB4XayusFbm2ChfRPnZQtzni ekOcpFDs0qlWaAC641uCkMnQuBGO1PFXvcxGsWEYTsoLxZosVOYlP6pWNb2hbHjdrn+3 S6eheBPKT7KQG+1E7YgmLNnED4h2Gg2lr4buI4uzI8ocUqPF3oUKtkBVIwVOADBVgTKb nXtw== X-Gm-Message-State: ALoCoQmhhEpatvDh9gtQ4KccKL+UW1Qp4EKAJIQANRMW27kNWPSq7KFJb2fcgk/yRus0yxFBf7Hu X-Received: by 10.180.87.164 with SMTP id az4mr3487432wib.1.1445193000331; Sun, 18 Oct 2015 11:30:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.150.209 with SMTP id y200ls443192lfd.17.gmail; Sun, 18 Oct 2015 11:29:59 -0700 (PDT) X-Received: by 10.25.41.79 with SMTP id p76mr8317950lfp.16.1445192999880; Sun, 18 Oct 2015 11:29:59 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id n7si20101400lbd.127.2015.10.18.11.29.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 11:29:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcao8 with SMTP id ao8so127476015lbc.3 for ; Sun, 18 Oct 2015 11:29:59 -0700 (PDT) X-Received: by 10.112.199.137 with SMTP id jk9mr12728782lbc.86.1445192999732; Sun, 18 Oct 2015 11:29:59 -0700 (PDT) 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.59.35 with SMTP id w3csp1078944lbq; Sun, 18 Oct 2015 11:29:58 -0700 (PDT) X-Received: by 10.68.98.34 with SMTP id ef2mr29676938pbb.45.1445192998645; Sun, 18 Oct 2015 11:29:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ys4si46486021pac.68.2015.10.18.11.29.58; Sun, 18 Oct 2015 11:29:58 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753189AbbJRS34 (ORCPT + 28 others); Sun, 18 Oct 2015 14:29:56 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35957 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752414AbbJRS0C (ORCPT ); Sun, 18 Oct 2015 14:26:02 -0400 Received: by pacfv9 with SMTP id fv9so70834442pac.3 for ; Sun, 18 Oct 2015 11:26:02 -0700 (PDT) X-Received: by 10.66.157.135 with SMTP id wm7mr29725020pab.22.1445192761957; Sun, 18 Oct 2015 11:26:01 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id hq1sm20402076pbb.43.2015.10.18.11.26.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Oct 2015 11:26:01 -0700 (PDT) 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, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH V2 17/30] perf: changing pmu::setup_aux() parameter to include event Date: Sun, 18 Oct 2015 12:24:34 -0600 Message-Id: <1445192687-24112-18-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> References: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> 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: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mailfrom=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: , For some tracers the event carries information to be embedded in the private structure returned by setup_aux(). As such 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(-) 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;