From patchwork Mon Dec 19 17:47:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 9480655 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 8A615601C2 for ; Mon, 19 Dec 2016 17:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C66200E7 for ; Mon, 19 Dec 2016 17:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 633BE284E1; Mon, 19 Dec 2016 17:50:11 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 472AC200E7 for ; Mon, 19 Dec 2016 17:50:10 +0000 (UTC) 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 1cJ22v-0005nP-08; Mon, 19 Dec 2016 17:48:21 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJ22p-0005jq-TC for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2016 17:48:16 +0000 Received: by mail-pg0-x241.google.com with SMTP id b1so9075865pgc.1 for ; Mon, 19 Dec 2016 09:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=XSzDO0qi0b51Zgln6TZr8jjfjtId5iF0gZDLrn0xaUI=; b=D9kTAl5HEVL4OQnIenWUaw7rnKK/Wox7UlgDTMZP5q1CUFUXT2O8irG52zsVjICMhe mv7n7WP2sTUTn+6H91g4GLgeTLMNShM8VcvEMcoiQWL1XOVnkedMgN+OyV2i4KFOz6bu cT4zc2QGESFnkea9MLOnLAmVygzEk9Geob/aLD/5i58ckIAsu5dhWr10BY8861KsE+Lp MXzw2o6TEKj9r2GljHXkrek3m/LAlT0e/HbeNiHf3F4HXkmcCx7rXlZGvflV7n0nY/wJ 5o3etKME81S9H4jPJPP1Ahu5PRPB7p7bwAAuZ2OzN1ZvHSp1PXps5oW6VwHn/xav5OVg S8Ag== 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=XSzDO0qi0b51Zgln6TZr8jjfjtId5iF0gZDLrn0xaUI=; b=BLE73GAWlc+IV5egLP/TqrRAzyqM6pITixMvygXJv3zzonSRID8n2ABwJEJsy86iBu yHgRzlxCxEB1QNRrFNd+H+qWzmMzko07oT1nrdOvPC+GPW1BFOzieJIxWtirD08ev7LE v5fEUxQizLUp+de79dS31sS2oF5khPRcBD/sZj7KjAuqzyhVDSg38+O28MwloG5AgxxE sEPsaK2GsV+nGawRchJ4fXHBhveoccUf3C1gXwVAjz/fcKKn19v3v61NY5l0QnWVPllM zfMyPTFw3UgJjjfrBJASyjaGJLIUrKjXc2QkoE4S7IJupbwDS7dFMy4Juo+kmgwmcMIN BQJA== X-Gm-Message-State: AIkVDXLTMnV9nBmSeqz8/9aD7nsAdzOPYDAjk34e/aJ2gRQnvCYIXyaftG7sHCkoUnIB3A== X-Received: by 10.99.149.1 with SMTP id p1mr21638182pgd.21.1482169674224; Mon, 19 Dec 2016 09:47:54 -0800 (PST) Received: from brutus.lixom.net (173-13-129-225-sfba.hfc.comcastbusiness.net. [173.13.129.225]) by smtp.gmail.com with ESMTPSA id y73sm32979717pfa.68.2016.12.19.09.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Dec 2016 09:47:53 -0800 (PST) From: Olof Johansson To: mark.rutland@arm.com, marc.zyngier@arm.com Subject: [PATCH] clocksource: arm_arch_timer: print timer value at init time Date: Mon, 19 Dec 2016 09:47:37 -0800 Message-Id: <1482169657-15773-1-git-send-email-olof@lixom.net> X-Mailer: git-send-email 2.8.0.rc3.29.gb552ff8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161219_094816_029392_5D6920F2 X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. 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: Olof Johansson , tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, daniel.lezcano@linaro.or 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 This is useful to get an indication of how much time we spent in firmware. It's not guaranteed that the timer started at 0 on reset, so it's just an approximation, and might very well be invalid on some systems. But it's still a useful metric to have access to. Signed-off-by: Olof Johansson --- drivers/clocksource/arm_arch_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 02fef68..c26078b 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -521,6 +521,8 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np) static void arch_timer_banner(unsigned type) { + unsigned long cnt = arch_timer_read_counter(); + pr_info("Architected %s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n", type & ARCH_CP15_TIMER ? "cp15" : "", type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? " and " : "", @@ -534,6 +536,8 @@ static void arch_timer_banner(unsigned type) type & ARCH_MEM_TIMER ? arch_timer_mem_use_virtual ? "virt" : "phys" : ""); + pr_info("Initial timer value: 0x%lx: %ld.%02lds\n", + cnt, cnt/arch_timer_rate, (cnt/(arch_timer_rate/100)) % 100); } u32 arch_timer_get_rate(void)