From patchwork Wed Aug 2 16:22:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 9877041 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 1EB216035F for ; Wed, 2 Aug 2017 16:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C4BB286B4 for ; Wed, 2 Aug 2017 16:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00F76287FB; Wed, 2 Aug 2017 16:26:35 +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,RCVD_IN_DNSWL_NONE 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 8BCFA286B4 for ; Wed, 2 Aug 2017 16:26:35 +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=46XQq4c6wdfTanz3VMw9NX2kwm4Fxd8UVBkxFZOujfo=; b=DIAxSpjDfz2Hm+PsSLOX8JROnD qWMrpZdGSvA8kQq/AbPUBZykoR0tQLryZNUOQCHv7PHaCMK7niSFckMYQUXwxf+hhCD9bPyxjTvGd yVsh3GK1dvCFJsUpG0LAri1lpNe1SOPG6el31md8QPFDzAtlP6pNKEb25KnsxwaXBIHyKIcYunmFH aduqs+UIWVgx5aEvsf2qY3um/z3BOYh36iHKmZn+3PRe4v/TjasW7fjkjDy1bgNdoxdXn8GoJiOIg hFlGFl6ZE8Zdj6B4Umsi0/sdtTaJSfnwFHzLhJvRlwfyLpPbwBzg6wHSuGxgDRcD+ns7Q1+vc6jmx QskDLZDQ==; 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 1dcwTd-0006Oc-Rb; Wed, 02 Aug 2017 16:26:29 +0000 Received: from mail-it0-x230.google.com ([2607:f8b0:4001:c0b::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dcwQF-0001q9-Fp for linux-arm-kernel@lists.infradead.org; Wed, 02 Aug 2017 16:23:11 +0000 Received: by mail-it0-x230.google.com with SMTP id h199so27232340ith.1 for ; Wed, 02 Aug 2017 09:22:40 -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=FCFKMPjyuDAAweIptnZtFWYoqzBXrxwwLr9wqs8rI40=; b=fQ3KinFYBYZKuIpO/VHTTJF1TDml57S7+8aG93FcfQjRj/mmcKqunkgFn+VaEsOJiu hzw4vv0dAomolMuek3Vp8+j4xMXHEyGIYCwt3c+BdC9+orgYQ3qNgIx2ykBS0cD4Lji8 J9vJiZmIN1Z05Y/HvUysT6msPmgEdtqv7D/CQ= 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=FCFKMPjyuDAAweIptnZtFWYoqzBXrxwwLr9wqs8rI40=; b=JSaB0l5iUWZDjsfpCn7mQ3bEYSSKhGRRlL/D2a5CH7myaniIXn3r9vyURd8cvfoSDP IDovTGgJJQxnCxII3Yu56ciUepq2suqhjiyAipC93XgYljodz0AsV2RYSox2D2pLYJqb xysihHh/BHVN4xrDY3d1mM03L7+tAmaDkL+whvQnbxrUUsuvy1jOEkylWTHNVTHD1YnI QrgTg7ODsziigj3/9Cdm5UfZicDa169U4ONAfLwROKITh6QMqAbqrYVObxC+4JVmAJmv AaEBIZiOelRirVVV+72qiCsx8W96+Vj/A/uaWoKeOV4/Lbln9o9q+JXHwDOgfah0EsFg 0lrg== X-Gm-Message-State: AIVw112cojQtMMWVHh/HeBpmgkwXkwnmCg61F8RX82qGgNiG4Cmn8K7s UmNJkczUX2XIeeCc X-Received: by 10.36.214.203 with SMTP id o194mr5890811itg.3.1501690960099; Wed, 02 Aug 2017 09:22:40 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id x2sm2201870ita.43.2017.08.02.09.22.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 09:22:38 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 09/26] coresight: etm4x: Adds trace return stack option programming for ETMv4. Date: Wed, 2 Aug 2017 10:22:03 -0600 Message-Id: <1501690940-4137-10-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501690940-4137-1-git-send-email-mathieu.poirier@linaro.org> References: <1501690940-4137-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170802_092259_936877_FA437739 X-CRM114-Status: GOOD ( 10.66 ) 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: 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-Virus-Scanned: ClamAV using ClamSMTP From: Mike Leach Adds handling to program the return stack option into ETMv4 hardware if specified in the perf command line. If option is not supported by the hardware then it will be ignored. This allows capture to move between core/ETM combinations that have the hardware support to those that do not. Signed-off-by: Mike Leach Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 532adc9dd32a..ac77b4c973d8 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -224,6 +224,10 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata, if (attr->config & BIT(ETM_OPT_TS)) /* bit[11], Global timestamp tracing bit */ config->cfg |= BIT(11); + /* return stack - enable if selected and supported */ + if ((attr->config & BIT(ETM_OPT_RETSTK)) && drvdata->retstack) + /* bit[12], Return stack enable bit */ + config->cfg |= BIT(12); out: return ret;