From patchwork Fri Dec 2 08:14:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Ramana X-Patchwork-Id: 9458009 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 3138460515 for ; Fri, 2 Dec 2016 08:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20C312852B for ; Fri, 2 Dec 2016 08:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1206F2852E; Fri, 2 Dec 2016 08:17: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 78A6A2852B for ; Fri, 2 Dec 2016 08:17: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 1cCj0G-0007Qt-UE; Fri, 02 Dec 2016 08:15:32 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cCj0C-0006Ro-Cw for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2016 08:15:29 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8BDDC615DA; Fri, 2 Dec 2016 08:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1480666507; bh=blkwrgcwlwnMyYU62Zozs3YmXGwqZdLmNZzQ8PNV1wM=; h=From:To:Cc:Subject:Date:From; b=VUNkje7VKzB9JvOuXBbmz8s0zGiH6IiwFCbq7LjsteosRjdfgh3RpbhT3usHRTlQ5 LegwL0mujeQrYyhzl13bOrRWiL56lG1LhoJ946pkL/kDnA76KQAevwH/9ojgTa6n2V lWxMpc85hes9bVy4sJ7kGzntwC9NIKUNvKRYTQ+0= Received: from sramana-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sramana@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5206F6126A; Fri, 2 Dec 2016 08:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1480666507; bh=blkwrgcwlwnMyYU62Zozs3YmXGwqZdLmNZzQ8PNV1wM=; h=From:To:Cc:Subject:Date:From; b=VUNkje7VKzB9JvOuXBbmz8s0zGiH6IiwFCbq7LjsteosRjdfgh3RpbhT3usHRTlQ5 LegwL0mujeQrYyhzl13bOrRWiL56lG1LhoJ946pkL/kDnA76KQAevwH/9ojgTa6n2V lWxMpc85hes9bVy4sJ7kGzntwC9NIKUNvKRYTQ+0= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 5206F6126A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sramana@codeaurora.org From: Srinivas Ramana To: catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH] trace: extend trace_clock to support arch_arm clock counter Date: Fri, 2 Dec 2016 13:44:55 +0530 Message-Id: <1480666495-26536-1-git-send-email-sramana@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161202_001528_567142_C9353541 X-CRM114-Status: GOOD ( 13.73 ) 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: linux-arm-msm@vger.kernel.org, Srinivas Ramana , 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 Extend the trace_clock to support the arch timer cycle counter so that we can get the monotonic cycle count in the traces. This will help in correlating the traces with the timestamps/events in other subsystems in the soc which share this common counter for driving their timers. Signed-off-by: Srinivas Ramana --- arch/arm64/include/asm/Kbuild | 1 - arch/arm64/include/asm/trace_clock.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/include/asm/trace_clock.h diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 44e1d7f10add..c943e9c9823a 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild @@ -41,7 +41,6 @@ generic-y += swab.h generic-y += switch_to.h generic-y += termbits.h generic-y += termios.h -generic-y += trace_clock.h generic-y += types.h generic-y += unaligned.h generic-y += user.h diff --git a/arch/arm64/include/asm/trace_clock.h b/arch/arm64/include/asm/trace_clock.h new file mode 100644 index 000000000000..dc9af640738d --- /dev/null +++ b/arch/arm64/include/asm/trace_clock.h @@ -0,0 +1,20 @@ +#ifndef _ASM_ARM64_TRACE_CLOCK_H +#define _ASM_ARM64_TRACE_CLOCK_H + +#include +#include +#include + +/* + * trace_clock_arm64_count_vct(): A clock that is just the cycle counter. + * Unlike the other clocks, this is not in nanoseconds. + */ +static inline u64 notrace trace_clock_arm64_count_vct(void) +{ + return arch_counter_get_cntvct(); +} + +# define ARCH_TRACE_CLOCKS \ + { trace_clock_arm64_count_vct, "arm64-count-vct", 0 }, + +#endif /* _ASM_ARM64_TRACE_CLOCK_H */