From patchwork Wed Jan 4 17:22:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 89884 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8590454qgi; Wed, 4 Jan 2017 09:25:54 -0800 (PST) X-Received: by 10.99.128.198 with SMTP id j189mr122887239pgd.180.1483550754440; Wed, 04 Jan 2017 09:25:54 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si73068325pfg.258.2017.01.04.09.25.54; Wed, 04 Jan 2017 09:25:54 -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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936657AbdADRYR (ORCPT + 25 others); Wed, 4 Jan 2017 12:24:17 -0500 Received: from mail-io0-f178.google.com ([209.85.223.178]:32804 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933193AbdADRWa (ORCPT ); Wed, 4 Jan 2017 12:22:30 -0500 Received: by mail-io0-f178.google.com with SMTP id d9so458986684ioe.0 for ; Wed, 04 Jan 2017 09:22:30 -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=PKQuR+d4Z0sbRcS06iKwK13PTAIzh92+6kUxc2gcH+0=; b=Zh2/OIZy1WLmDSUZ1JuMszTJPEBjROj8H0R28TQ8fStidgjDZws0bp0lw0YpTPaJzh B/DNnJucZ67ivtX/Jf/2SghBQ6KhGtYelK+EpuD+bUJSXXx3USXLdrITB6EetyC8ltxQ NwcXaOdKmogWXNrpYZOZ/1hqvludo+MF9prY4= 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=PKQuR+d4Z0sbRcS06iKwK13PTAIzh92+6kUxc2gcH+0=; b=P6mek2V41T++DFxXLjA4f4QPAy7VQp18K5pnPjsDHzyW5tyCRYPS+QOOUXzkzFbhKl uUeX2tYIHmcWmObJcwfAq6vP77XyVHRaSXQBfjm3aQb/mR41Vw3PwmYwqgEA/XrJuahS LC51AKZCLjP7PD5RDp9dAkts6vYtbdrLBiZCExm9lwikH7o7HjGf2xNrqUhHB/d/k9S1 Tten1HlM3r2/n4wPSqC6V6yn6ymYdU1K1Nu3H2SPKfyNzwUCbgoUcFQ3cHqx96dF6Qd5 wgWk8eqnCDBJKK6/kuQgL6ipbM+TcK9sqkY8g59kg7raVZXUXtzvcjuVrVUQWafKeJDF nqUQ== X-Gm-Message-State: AIkVDXIgiZkKm3NdbQaTlBNdNjqiobGv9AL1R2Gcy9k5lDA0wSqdyJK/VIIiOOhpWEhhvC1v X-Received: by 10.107.50.3 with SMTP id y3mr21650069ioy.177.1483550550161; Wed, 04 Jan 2017 09:22:30 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id p77sm35872894iod.35.2017.01.04.09.22.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Jan 2017 09:22:29 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, mike.leach@linaro.org Subject: [PATCH] coresight: etm4x: Fix timestamp configuration when working from perf Date: Wed, 4 Jan 2017 10:22:28 -0700 Message-Id: <1483550548-14034-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 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;