From patchwork Mon Jan 23 17:41:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 9533237 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 0C3C060434 for ; Mon, 23 Jan 2017 17:44:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F127A28495 for ; Mon, 23 Jan 2017 17:44:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E612D2849A; Mon, 23 Jan 2017 17:44:33 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no 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 B4E5128495 for ; Mon, 23 Jan 2017 17:44:33 +0000 (UTC) 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 1cVifO-0005R2-FC; Mon, 23 Jan 2017 17:44:30 +0000 Received: from mail-it0-f54.google.com ([209.85.214.54]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVidl-0004M2-JA for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2017 17:42:51 +0000 Received: by mail-it0-f54.google.com with SMTP id d9so25230603itc.0 for ; Mon, 23 Jan 2017 09:42:29 -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:in-reply-to:references; bh=PKQuR+d4Z0sbRcS06iKwK13PTAIzh92+6kUxc2gcH+0=; b=kmE3E53M/1LtohriyOg5hwEkEIHUZsJ5OO3I5F+onNo7L2NJOcszv2D1ejzCTG7RNM wh2c0PZu+gHRMqdz52dtkSsEmOwIGvG2yavjFB9tZ4hfpMTKh9hz7e7E24Bvtx69c/E4 Yp/bq03/mhnaSXFbs4CbH1ifLtFbdv9Ra6Dwo= 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=PKQuR+d4Z0sbRcS06iKwK13PTAIzh92+6kUxc2gcH+0=; b=N1nmIesAra6/1AFiT8yKiii1vP8Hem4IH3Z+pb2i7zIwaQlQSqO8qvsbiW6jy7BJWt yNjFgWQ9S6vdU90sehpdgO8VXOHUC3ZvLGw+/2HhT3/nyAufEtN0LaDy8gD/tex9BD4i 8xY7knaVW+RAoaZGg/jPIL1SjDZaBdir7riAzS/w4C3KEqcS+6NgKHaVp4neZUxUT/+y 0oc+p4YdIBvITZJj8sxKRI9XfQz1UUMDVmoQc51+BCu8skOJD0EtzfBiMWr1K3m9oMW0 xI0Bn0DOEGLyP68+zMOXyTXRB6eB4uiJk4kvCnn5oIoQL8mOIyrEHRTnarX5jyyZ64Z1 NsOw== X-Gm-Message-State: AIkVDXLd5VL+WxTzurZdsQrk9UhMW0DYlrWzknMF/1jsFWlcBwEiZyz6GFQ2rkYorMvsNAkb X-Received: by 10.36.181.82 with SMTP id j18mr15281153iti.81.1485193288742; Mon, 23 Jan 2017 09:41:28 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id t65sm2886736itt.12.2017.01.23.09.41.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 09:41:28 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 3/3] coresight: etm4x: Fix timestamp configuration when working from perf Date: Mon, 23 Jan 2017 10:41:24 -0700 Message-Id: <1485193284-31636-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485193284-31636-1-git-send-email-mathieu.poirier@linaro.org> References: <1485193284-31636-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_094249_671073_20925247 X-CRM114-Status: GOOD ( 13.85 ) 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-kernel@vger.kernel.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-Virus-Scanned: ClamAV using ClamSMTP When using the ETM4x tracers from the perf interface two trace options are available: cycle accurate and timestamp. Enabling the timestamp feature is done by setting TRCCONFIGR.TS (bit 11). The position of the timestamp bit in that register coincidentally happens to be the same as what was chosen to enable timestamping from the 'mode' sysFS entry. The code does the right thing but the semantic is wrong. This patch sets TRCCONFIGR.TS explicitly, as it is done from the sysFS interface. That way timestamps are set the same way from both perf and sysFS and there is no misunderstanding as to what is intended. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index f432febdda49..d1340fb4e457 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -222,7 +222,8 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata, config->ccctlr = ETM_CYC_THRESHOLD_DEFAULT; } if (attr->config & BIT(ETM_OPT_TS)) - config->cfg |= ETMv4_MODE_TIMESTAMP; + /* bit[11], Global timestamp tracing bit */ + config->cfg |= BIT(11); out: return ret;