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: 92263 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1335450qgi; Mon, 23 Jan 2017 09:42:06 -0800 (PST) X-Received: by 10.98.19.145 with SMTP id 17mr24696334pft.26.1485193326668; Mon, 23 Jan 2017 09:42:06 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si16316082pld.144.2017.01.23.09.42.06; Mon, 23 Jan 2017 09:42:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbdAWRlp (ORCPT + 25 others); Mon, 23 Jan 2017 12:41:45 -0500 Received: from mail-it0-f46.google.com ([209.85.214.46]:38498 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdAWRl3 (ORCPT ); Mon, 23 Jan 2017 12:41:29 -0500 Received: by mail-it0-f46.google.com with SMTP id c7so71455624itd.1 for ; Mon, 23 Jan 2017 09:41: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=saSwOX9LVIXZM0/SXst+SUKlvj7U0Gt9npkA6wkeoeT3Y3msHOMEWohmJ74MsMMWNP 7rDDQUw7AGryGT+lEYHgCneNZjMiz1p5TaUUD1nKwRXOv2K8ky773bnOJGTS+xr7QDef Pa4wST9oPPrY4fTdPAcyz68+CDNbR+C78U5L0fjB7ZZnt/ixY1qFqYTBcdhW8M9Q0w8z awMOyJZ2YnYJwBD2S/qTsDPVPFyhoJ2pAXU+SS5HrJ1n1zKydks1PPdfIbwKxGuIgvYC F5hXOCmJZxgAnNy3o7Sc4I8xobHQRnKt9WzmeFf22Av5Pf82J3r2TmkqELl7Twwoeqaq JnYg== X-Gm-Message-State: AIkVDXKMA4JiLAQuyogeG16h4vebvLOtMrEx+J//itGob+WY39NQENyJ1gitEeuMPYN3uWUq 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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;