From patchwork Fri Sep 18 16:26:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7219071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA8D89F372 for ; Fri, 18 Sep 2015 16:32:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D069320918 for ; Fri, 18 Sep 2015 16:32:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4A9B20878 for ; Fri, 18 Sep 2015 16:32:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcyY8-0005GR-Qo; Fri, 18 Sep 2015 16:30:13 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcyVe-0001Yh-DI for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2015 16:27:39 +0000 Received: by padhy16 with SMTP id hy16so55272774pad.1 for ; Fri, 18 Sep 2015 09:27:22 -0700 (PDT) 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=Sb0KrDSTyQaMg3wVMufCyTn74Ej5Yhj1FRqBBXaLehw=; b=miKPAbahiDwTbff7bqZ6NvZU1V4yrp2jJKGTEq5jdAcWdShh561v4Qb2i4i26ELU8C oRPYgkc297r89XJlHmPuFU44T5oonNDEZC2akbPp2ZqQNQVlE11SN1nzWd1uXrQOFPxx 1XbDFKke+dsysBLBtu91IvhwXJ+AioVPjWekqPSII6ENyTyQqW4eP7JvLTwMoZDrEyu2 oj7ZolreUBx3YC8Gg6yqXirnWa+egVwKBCLCTHyywNvd1E8/f8IzVcha3V7IFXJAyRCs CAz4QLnB7e6D6PnjwlDpfehBtqmQXG8hKTRMP1YyzgT6fgw+UQRT9biPJRcrR578t9u/ oYlQ== X-Gm-Message-State: ALoCoQkInHoOUH0Nb5SK21TbejU8stLJXKiDF/zz+ax1BYTc9atchiADqLrk4cZLupZvSFDK2Y24 X-Received: by 10.68.180.131 with SMTP id do3mr8046967pbc.133.1442593642862; Fri, 18 Sep 2015 09:27:22 -0700 (PDT) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id la4sm9847027pbc.76.2015.09.18.09.27.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 09:27:22 -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 Subject: [RFC PATCH 15/20] coresight: etm-perf: implementing 'setup_aux()' API Date: Fri, 18 Sep 2015 10:26:29 -0600 Message-Id: <1442593594-10665-16-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442593594-10665-1-git-send-email-mathieu.poirier@linaro.org> References: <1442593594-10665-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150918_092738_749035_A7631E4B X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: al.grant@arm.com, pawel.moll@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, tor@ti.com, mike.leach@arm.com, zhang.chunyan@linaro.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before trace can be collected the PMU needs to get a handle on the mmpap'ed memory that was granted. Since the collection of traces can be done by sink buffers of various types, representation of the memory layout is done at the sink level rather than the tracer PMU driver. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm-perf.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index a21171a3e929..3aeb4215bb22 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -227,6 +227,27 @@ out: return ret; } +static void *etm_setup_aux(int cpu, void **pages, + int nr_pages, bool overwrite) +{ + struct coresight_device *csdev; + + if (cpu == -1) + cpu = smp_processor_id(); + + csdev = per_cpu(csdev_sink, cpu); + if (!csdev) + return NULL; + + return sink_ops(csdev)->setup_aux(csdev, cpu, pages, + nr_pages, overwrite); +} + +static void etm_free_aux(void *data) +{ + kfree(data); +} + static int __init etm_perf_init(void) { etm_pmu.capabilities = PERF_PMU_CAP_EXCLUSIVE; @@ -235,6 +256,8 @@ static int __init etm_perf_init(void) etm_pmu.task_ctx_nr = perf_sw_context; etm_pmu.read = etm_event_read; etm_pmu.event_init = etm_event_init; + etm_pmu.setup_aux = etm_setup_aux; + etm_pmu.free_aux = etm_free_aux; return perf_pmu_register(&etm_pmu, CORESIGHT_ETM_PMU_NAME, -1); }