From patchwork Tue Jul 11 11:25:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 9834537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5231E60363 for ; Tue, 11 Jul 2017 11:26:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43889251F4 for ; Tue, 11 Jul 2017 11:26:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3860027F8E; Tue, 11 Jul 2017 11:26:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C54B6251F4 for ; Tue, 11 Jul 2017 11:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=JFDKOQhcWMvkYUb7EepEMCUMw8eqMmCJwpEtDFfrbqM=; b=Bk4ZRvnYPavtDHw4AFWCYtYepm IcD/mSxPvjLLpP12BpGGgQVqvQ4dl+not2K2GD4xhcQnO+OB+T1P33r2HdJnTYdhbho5GpKlPeNcz oQWCx6xuuKCmPfDz8LUj3VcPevK7afixWDxvxqwBviI7DtQN5/En+tQpqTcGYeY3iWkqqS2QnpxmM H7TVvztKukv1LNia8lJpVd5LDjKpAyVpoRriBRSqEb0VzurxlHnKP28OPJfo6BrxTLjNZAC99fTg+ +01X6X2HAKbfob5QbNMRjCpQwbLTtU8p7BY4u8nDOjbt3167krSaPRWIk+ejub4RlKk8GGrZKzYYL TMhevTbQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dUtJK-0005AI-J9; Tue, 11 Jul 2017 11:26:34 +0000 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dUtJ7-0004iY-CU for linux-arm-kernel@lists.infradead.org; Tue, 11 Jul 2017 11:26:23 +0000 Received: by mail-wr0-x22a.google.com with SMTP id r103so179216328wrb.0 for ; Tue, 11 Jul 2017 04:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sXyCILDnNIfjvpiwhF5JIxOosm3/OBV1FZHoJc7j5XQ=; b=XCf+WTK3iPM8ciwV+XDqiHcTRRZlcyCUxqNHri9BCX05w2z9VyLrXWnzxBrDL1cJ19 un1G9WuOZwYDH+0tibyXoZ/5YeHRO2koE1nNHpgTO6JXpq26Ub8jN2G+/eBPCL3+We9B TJI0dwhhiDPA/46xUJhmoPBy60Sf+ajrhjTuI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sXyCILDnNIfjvpiwhF5JIxOosm3/OBV1FZHoJc7j5XQ=; b=S3McIS4tZraiSUolS+Vfr403IgNbE45v8UH7pr8CNszY3fXIojBTxUbTUYibP7pJXH QX31zM6ADwgUtK/o9vyKd4OhO4DvuZqVgRTFcDYU4SBpdDvhnB3nOWFjieTGgR5rK5P+ lnR3KqbN2QZtbI+Fka4PyFFsqsm/C452deo2tRu6hK6m9g6v2ZTqoC9ogUo8GTnXHOvm ZUE9UHgxw/Ggn1g+lkc6kiA8azbV+Hv8PezFSVttJEX5JKoPv8ReF5t3kDDuWTewaWIF 8MLyWI1pfGy/lHOFIwx1wXb9ZIXN/8UGa2aw3HX4/o/osujig7qJ7xZTUFE4BFF5yFhd XJ2Q== X-Gm-Message-State: AIVw1136gdYuWNEpd79Qlje7RToxxUPhrsfoyZkcPzMmO/Sy1kiFoxO4 Ob86yX0stJVpaGPu X-Received: by 10.28.26.2 with SMTP id a2mr11246958wma.32.1499772359646; Tue, 11 Jul 2017 04:25:59 -0700 (PDT) Received: from linaro.org (cpc116592-blbn11-2-0-cust240.10-1.cable.virginm.net. [80.5.18.241]) by smtp.gmail.com with ESMTPSA id d1sm16217847wra.43.2017.07.11.04.25.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 04:25:58 -0700 (PDT) From: Mike Leach To: mathieu.poirier@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] coresight: pmu: Adds return stack option to perf coresight pmu Date: Tue, 11 Jul 2017 12:25:49 +0100 Message-Id: <1499772351-2210-2-git-send-email-mike.leach@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499772351-2210-1-git-send-email-mike.leach@linaro.org> References: <1499772351-2210-1-git-send-email-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170711_042621_577402_90921643 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Leach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Return stack is a programmable option on some ETM and PTM hardware. Adds the option flags to enable this from the perf event command line. Signed-off-by: Mike Leach --- drivers/hwtracing/coresight/coresight-etm-perf.c | 2 ++ include/linux/coresight-pmu.h | 1 + tools/include/linux/coresight-pmu.h | 1 + 3 files changed, 4 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 8f546f5..5804551 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -53,10 +53,12 @@ static DEFINE_PER_CPU(struct coresight_device *, csdev_src); /* ETMv3.5/PTM's ETMCR is 'config' */ PMU_FORMAT_ATTR(cycacc, "config:" __stringify(ETM_OPT_CYCACC)); PMU_FORMAT_ATTR(timestamp, "config:" __stringify(ETM_OPT_TS)); +PMU_FORMAT_ATTR(retstack, "config:" __stringify(ETM_OPT_RETSTK)); static struct attribute *etm_config_formats_attr[] = { &format_attr_cycacc.attr, &format_attr_timestamp.attr, + &format_attr_retstack.attr, NULL, }; diff --git a/include/linux/coresight-pmu.h b/include/linux/coresight-pmu.h index 7d41026..45852c2 100644 --- a/include/linux/coresight-pmu.h +++ b/include/linux/coresight-pmu.h @@ -24,6 +24,7 @@ /* ETMv3.5/PTM's ETMCR config bit */ #define ETM_OPT_CYCACC 12 #define ETM_OPT_TS 28 +#define ETM_OPT_RETSTK 29 static inline int coresight_get_trace_id(int cpu) { diff --git a/tools/include/linux/coresight-pmu.h b/tools/include/linux/coresight-pmu.h index 7d41026..45852c2 100644 --- a/tools/include/linux/coresight-pmu.h +++ b/tools/include/linux/coresight-pmu.h @@ -24,6 +24,7 @@ /* ETMv3.5/PTM's ETMCR config bit */ #define ETM_OPT_CYCACC 12 #define ETM_OPT_TS 28 +#define ETM_OPT_RETSTK 29 static inline int coresight_get_trace_id(int cpu) {