From patchwork Wed Jan 4 09:47:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 89797 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8409506qgi; Wed, 4 Jan 2017 01:48:53 -0800 (PST) X-Received: by 10.99.61.13 with SMTP id k13mr122883566pga.154.1483523333019; Wed, 04 Jan 2017 01:48:53 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id w76si17081198pfd.95.2017.01.04.01.48.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2017 01:48:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOiAY-0006tJ-Dq; Wed, 04 Jan 2017 09:47:42 +0000 Received: from mail-wj0-x231.google.com ([2a00:1450:400c:c01::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOiAU-0006qR-6T for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 09:47:39 +0000 Received: by mail-wj0-x231.google.com with SMTP id c11so259826825wjx.3 for ; Wed, 04 Jan 2017 01:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=LgeJ6NDt7MdUb/NtMWeg3dGN8PAmk9SqnvRsN2gmicM=; b=ZUsZ7qkAYDpT6FIlBba7qHXFRmZ3gQBLcbbYoyW/VuviK+6wi08SdqbGCBHBVyayZx Qe7yThQQXnpC3A3RFGswKrqRDn5GWXU+nNY0nhohppHAwjwk8y8QEkrdeBZPeVLRLXNM fuCSgK6qkJbaHUedhFbBM2hdtINj43U4Earvs= 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; bh=LgeJ6NDt7MdUb/NtMWeg3dGN8PAmk9SqnvRsN2gmicM=; b=coh+6+CcnQa5z0OPs5mTJX3LmF2fHNP5mNqBAelYj8CyTVt0jFcQfhEDaAqbdJvH5z tvblcbkqBJSS/jrt3LTqTVC96ioU0nvOfIPLifFIQW06ItkcYBm06cJwwmCnxFUqo+oY RTsVeg7P1kWPaQ1A3Vz78pAISYDuT99Xbqo+E4DiU1SPfTfDeViHYKI1wPdh33S7qC0Q I1hCOmnY6F6EDYpGHrwqiod4Ob5E0ZHAJF6XRu1pEYBWQOg+J0AmqpaYp/BZEFTu4bBa 5N5/v0oUzL18Sg+TxMFScJHFRo6gRqrBviPMQs4r5tNIsvwBFBdKTxiW3NGwaBhXjhFI s2UA== X-Gm-Message-State: AIkVDXIsHiDOIo3dq/GT1H8MJ0tKnVXG5gV2Q9MbiZnzATeexO0Amv77tT1uqMtUxJfKD8se X-Received: by 10.194.146.228 with SMTP id tf4mr56432805wjb.183.1483523235577; Wed, 04 Jan 2017 01:47:15 -0800 (PST) Received: from linaro.org (cpc80201-blbn11-2-0-cust167.10-1.cable.virginm.net. [86.6.126.168]) by smtp.gmail.com with ESMTPSA id kq7sm97275968wjb.30.2017.01.04.01.47.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jan 2017 01:47:15 -0800 (PST) From: Mike Leach To: mathieu.poirier@linaro.org Subject: [PATCH v2] coresight: etm4x: Fix enabling of cycle accurate tracing in perf. Date: Wed, 4 Jan 2017 09:47:11 +0000 Message-Id: <1483523231-23993-1-git-send-email-mike.leach@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_014738_444203_01C2EF62 X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c01:0:0:0:231 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Mike Leach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Using perf record 'cyclacc' option in cs_etm event was not setting up cycle accurate trace correctly. Corrects bit set in TRCCONFIGR to enable cycle accurate trace. Programs TRCCCCTLR with a valid threshold value as required by ETMv4 spec. Signed-off-by: Mike Leach --- drivers/hwtracing/coresight/coresight-etm4x.c | 7 +++++-- drivers/hwtracing/coresight/coresight-etm4x.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 4db8d6a..c5a65d1 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -216,8 +216,11 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata, goto out; /* Go from generic option to ETMv4 specifics */ - if (attr->config & BIT(ETM_OPT_CYCACC)) - config->cfg |= ETMv4_MODE_CYCACC; + if (attr->config & BIT(ETM_OPT_CYCACC)) { + config->cfg |= BIT(4); + /* TRM: Must program this for cycacc to work */ + config->ccctlr = ETM_CYC_THRESHOLD_DEFAULT; + } if (attr->config & BIT(ETM_OPT_TS)) config->cfg |= ETMv4_MODE_TIMESTAMP; diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index ba8d3f8..b3b5ea7 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -146,6 +146,7 @@ #define ETM_ARCH_V4 0x40 #define ETMv4_SYNC_MASK 0x1F #define ETM_CYC_THRESHOLD_MASK 0xFFF +#define ETM_CYC_THRESHOLD_DEFAULT 0x100 #define ETMv4_EVENT_MASK 0xFF #define ETM_CNTR_MAX_VAL 0xFFFF #define ETM_TRACEID_MASK 0x3f